📄 sound_8h-source.html
字号:
00467 <a name="l00469"></a><a class="code" href="classPSoundChannel.html#z391_3">00469</a> <span class="keyword">virtual</span> <span class="keywordtype">unsigned</span> <a class="code" href="classPSoundChannel.html#z391_3">GetSampleRate</a>()<span class="keyword"> const</span>00470 <span class="keyword"> </span>{ <span class="keywordflow">return</span> (<a class="code" href="classPSoundChannel.html#n0">baseChannel</a> == NULL) ? 0 : <a class="code" href="classPSoundChannel.html#n0">baseChannel</a>-><a class="code" href="classPSoundChannel.html#z391_3">GetSampleRate</a>(); }00471 <a name="l00473"></a><a class="code" href="classPSoundChannel.html#z391_4">00473</a> <span class="keyword">virtual</span> <span class="keywordtype">unsigned</span> <a class="code" href="classPSoundChannel.html#z391_4">GetSampleSize</a>()<span class="keyword"> const </span>00474 <span class="keyword"> </span>{ <span class="keywordflow">return</span> (<a class="code" href="classPSoundChannel.html#n0">baseChannel</a> == NULL) ? 0 : <a class="code" href="classPSoundChannel.html#n0">baseChannel</a>-><a class="code" href="classPSoundChannel.html#z391_4">GetSampleSize</a>(); }00475 <a name="l00484"></a><a class="code" href="classPSoundChannel.html#z391_5">00484</a> <span class="keyword">virtual</span> BOOL <a class="code" href="classPSoundChannel.html#z391_5">SetBuffers</a>(00485 PINDEX size, 00486 PINDEX count = 2 00487 )00488 { <span class="keywordflow">return</span> (<a class="code" href="classPSoundChannel.html#n0">baseChannel</a> == NULL) ? FALSE : <a class="code" href="classPSoundChannel.html#n0">baseChannel</a>-><a class="code" href="classPSoundChannel.html#z391_5">SetBuffers</a>(size, count); }00489 <a name="l00495"></a><a class="code" href="classPSoundChannel.html#z391_6">00495</a> <span class="keyword">virtual</span> BOOL <a class="code" href="classPSoundChannel.html#z391_6">GetBuffers</a>(00496 PINDEX & size, <span class="comment">// Size of each buffer</span>00497 PINDEX & count <span class="comment">// Number of buffers</span>00498 )00499 { <span class="keywordflow">return</span> (<a class="code" href="classPSoundChannel.html#n0">baseChannel</a> == NULL) ? FALSE : <a class="code" href="classPSoundChannel.html#n0">baseChannel</a>-><a class="code" href="classPSoundChannel.html#z391_6">GetBuffers</a>(size, count); }00500 00501 <span class="keyword">enum</span> {00502 <a class="code" href="classPSoundChannel.html#z391_0s2">MaxVolume</a> = 10000503 };00504 <a name="l00511"></a><a class="code" href="classPSoundChannel.html#z391_7">00511</a> <span class="keyword">virtual</span> BOOL <a class="code" href="classPSoundChannel.html#z391_7">SetVolume</a>(00512 <span class="keywordtype">unsigned</span> volume 00513 )00514 { <span class="keywordflow">return</span> (<a class="code" href="classPSoundChannel.html#n0">baseChannel</a> == NULL) ? FALSE : <a class="code" href="classPSoundChannel.html#n0">baseChannel</a>-><a class="code" href="classPSoundChannel.html#z391_7">SetVolume</a>(volume); }00515 <a name="l00522"></a><a class="code" href="classPSoundChannel.html#z391_8">00522</a> <span class="keyword">virtual</span> BOOL <a class="code" href="classPSoundChannel.html#z391_8">GetVolume</a>(00523 <span class="keywordtype">unsigned</span> & volume 00524 )00525 { <span class="keywordflow">return</span> (<a class="code" href="classPSoundChannel.html#n0">baseChannel</a> == NULL) ? FALSE : <a class="code" href="classPSoundChannel.html#n0">baseChannel</a>-><a class="code" href="classPSoundChannel.html#z391_8">GetVolume</a>(volume); }00527 00530 <a name="l00542"></a><a class="code" href="classPSoundChannel.html#z393_0">00542</a> <span class="keyword">virtual</span> BOOL <a class="code" href="classPSoundChannel.html#z393_0">Write</a>(<span class="keyword">const</span> <span class="keywordtype">void</span> * buf, PINDEX len)00543 { <span class="keywordflow">return</span> (<a class="code" href="classPSoundChannel.html#n0">baseChannel</a> == NULL) ? FALSE : <a class="code" href="classPSoundChannel.html#n0">baseChannel</a>-><a class="code" href="classPSoundChannel.html#z393_0">Write</a>(buf, len); }00544 <a name="l00545"></a><a class="code" href="classPSoundChannel.html#z393_1">00545</a> PINDEX <a class="code" href="classPSoundChannel.html#z393_1">GetLastWriteCount</a>()<span class="keyword"> const</span>00546 <span class="keyword"> </span>{ <span class="keywordflow">return</span> (<a class="code" href="classPSoundChannel.html#n0">baseChannel</a> == NULL) ? <a class="code" href="classPChannel.html#n4">lastWriteCount</a> : <a class="code" href="classPSoundChannel.html#n0">baseChannel</a>-><a class="code" href="classPSoundChannel.html#z393_1">GetLastWriteCount</a>(); }00547 <a name="l00564"></a><a class="code" href="classPSoundChannel.html#z393_2">00564</a> <span class="keyword">virtual</span> BOOL <a class="code" href="classPSoundChannel.html#z393_2">PlaySound</a>(00565 <span class="keyword">const</span> <a class="code" href="classPSound.html">PSound</a> & sound, 00566 BOOL wait = TRUE 00567 )00568 { <span class="keywordflow">return</span> (<a class="code" href="classPSoundChannel.html#n0">baseChannel</a> == NULL) ? FALSE : <a class="code" href="classPSoundChannel.html#n0">baseChannel</a>-><a class="code" href="classPSoundChannel.html#z393_2">PlaySound</a>(sound, wait); }<a name="l00584"></a><a class="code" href="classPSoundChannel.html#z393_3">00584</a> <span class="keyword">virtual</span> BOOL <a class="code" href="classPSoundChannel.html#z393_3">PlayFile</a>(00585 <span class="keyword">const</span> <a class="code" href="classPFilePath.html">PFilePath</a> & file, 00586 BOOL wait = TRUE 00587 )00588 { <span class="keywordflow">return</span> (<a class="code" href="classPSoundChannel.html#n0">baseChannel</a> == NULL) ? FALSE : <a class="code" href="classPSoundChannel.html#n0">baseChannel</a>-><a class="code" href="classPSoundChannel.html#z393_3">PlayFile</a>(file, wait); }00589 <a name="l00596"></a><a class="code" href="classPSoundChannel.html#z393_4">00596</a> <span class="keyword">virtual</span> BOOL <a class="code" href="classPSoundChannel.html#z393_4">HasPlayCompleted</a>()00597 { <span class="keywordflow">return</span> (<a class="code" href="classPSoundChannel.html#n0">baseChannel</a> == NULL) ? FALSE : <a class="code" href="classPSoundChannel.html#n0">baseChannel</a>-><a class="code" href="classPSoundChannel.html#z393_4">HasPlayCompleted</a>(); }00598 <a name="l00605"></a><a class="code" href="classPSoundChannel.html#z393_5">00605</a> <span class="keyword">virtual</span> BOOL <a class="code" href="classPSoundChannel.html#z393_5">WaitForPlayCompletion</a>() 00606 { <span class="keywordflow">return</span> (<a class="code" href="classPSoundChannel.html#n0">baseChannel</a> == NULL) ? FALSE : <a class="code" href="classPSoundChannel.html#n0">baseChannel</a>-><a class="code" href="classPSoundChannel.html#z393_5">WaitForPlayCompletion</a>(); }00607 00609 <a name="l00624"></a><a class="code" href="classPSoundChannel.html#z395_0">00624</a> <span class="keyword">virtual</span> BOOL <a class="code" href="classPSoundChannel.html#z395_0">Read</a>(00625 <span class="keywordtype">void</span> * buf, 00626 PINDEX len 00627 )00628 { <span class="keywordflow">return</span> (<a class="code" href="classPSoundChannel.html#n0">baseChannel</a> == NULL) ? FALSE : <a class="code" href="classPSoundChannel.html#n0">baseChannel</a>-><a class="code" href="classPSoundChannel.html#z395_0">Read</a>(buf, len); }00629 <a name="l00630"></a><a class="code" href="classPSoundChannel.html#z395_1">00630</a> PINDEX <a class="code" href="classPSoundChannel.html#z395_1">GetLastReadCount</a>()<span class="keyword"> const</span>00631 <span class="keyword"> </span>{ <span class="keywordflow">return</span> (<a class="code" href="classPSoundChannel.html#n0">baseChannel</a> == NULL) ? <a class="code" href="classPChannel.html#n3">lastReadCount</a> : <a class="code" href="classPSoundChannel.html#n0">baseChannel</a>-><a class="code" href="classPSoundChannel.html#z395_1">GetLastReadCount</a>(); }00632 <a name="l00650"></a><a class="code" href="classPSoundChannel.html#z395_2">00650</a> <span class="keyword">virtual</span> BOOL <a class="code" href="classPSoundChannel.html#z395_2">RecordSound</a>(00651 <a class="code" href="classPSound.html">PSound</a> & sound 00652 )00653 { <span class="keywordflow">return</span> (<a class="code" href="classPSoundChannel.html#n0">baseChannel</a> == NULL) ? FALSE : <a class="code" href="classPSoundChannel.html#n0">baseChannel</a>-><a class="code" href="classPSoundChannel.html#z395_2">RecordSound</a>(sound); }00654 <a name="l00667"></a><a class="code" href="classPSoundChannel.html#z395_3">00667</a> <span class="keyword">virtual</span> BOOL <a class="code" href="classPSoundChannel.html#z395_3">RecordFile</a>(00668 <span class="keyword">const</span> <a class="code" href="classPFilePath.html">PFilePath</a> & file 00669 )00670 { <span class="keywordflow">return</span> (<a class="code" href="classPSoundChannel.html#n0">baseChannel</a> == NULL) ? FALSE : <a class="code" href="classPSoundChannel.html#n0">baseChannel</a>-><a class="code" href="classPSoundChannel.html#z395_3">RecordFile</a>(file); }00671 <a name="l00678"></a><a class="code" href="classPSoundChannel.html#z395_4">00678</a> <span class="keyword">virtual</span> BOOL <a class="code" href="classPSoundChannel.html#z395_4">StartRecording</a>()00679 { <span class="keywordflow">return</span> (<a class="code" href="classPSoundChannel.html#n0">baseChannel</a> == NULL) ? FALSE : <a class="code" href="classPSoundChannel.html#n0">baseChannel</a>-><a class="code" href="classPSoundChannel.html#z395_4">StartRecording</a>(); }00680 <a name="l00688"></a><a class="code" href="classPSoundChannel.html#z395_5">00688</a> <span class="keyword">virtual</span> BOOL <a class="code" href="classPSoundChannel.html#z395_5">IsRecordBufferFull</a>() 00689 { <span class="keywordflow">return</span> (<a class="code" href="classPSoundChannel.html#n0">baseChannel</a> == NULL) ? FALSE : <a class="code" href="classPSoundChannel.html#n0">baseChannel</a>-><a class="code" href="classPSoundChannel.html#z395_5">IsRecordBufferFull</a>(); }00690 <a name="l00699"></a><a class="code" href="classPSoundChannel.html#z395_6">00699</a> <span class="keyword">virtual</span> BOOL <a class="code" href="classPSoundChannel.html#z395_6">AreAllRecordBuffersFull</a>() 00700 { <span class="keywordflow">return</span> (<a class="code" href="classPSoundChannel.html#n0">baseChannel</a> == NULL) ? FALSE : <a class="code" href="classPSoundChannel.html#n0">baseChannel</a>-><a class="code" href="classPSoundChannel.html#z395_6">AreAllRecordBuffersFull</a>(); }00701 <a name="l00709"></a><a class="code" href="classPSoundChannel.html#z395_7">00709</a> <span class="keyword">virtual</span> BOOL <a class="code" href="classPSoundChannel.html#z395_7">WaitForRecordBufferFull</a>() 00710 { <span class="keywordflow">return</span> (<a class="code" href="classPSoundChannel.html#n0">baseChannel</a> == NULL) ? FALSE : <a class="code" href="classPSoundChannel.html#n0">baseChannel</a>-><a class="code" href="classPSoundChannel.html#z395_7">WaitForRecordBufferFull</a>() ; }00711 <a name="l00720"></a><a class="code" href="classPSoundChannel.html#z395_8">00720</a> <span class="keyword">virtual</span> BOOL <a class="code" href="classPSoundChannel.html#z395_8">WaitForAllRecordBuffersFull</a>() 00721 { <span class="keywordflow">return</span> (<a class="code" href="classPSoundChannel.html#n0">baseChannel</a> == NULL) ? FALSE : <a class="code" href="classPSoundChannel.html#n0">baseChannel</a>-><a class="code" href="classPSoundChannel.html#z395_8">WaitForAllRecordBuffersFull</a>() ; }00723 00724 <span class="keyword">protected</span>:<a name="l00725"></a><a class="code" href="classPSoundChannel.html#n0">00725</a> <a class="code" href="classPSoundChannel.html">PSoundChannel</a> * <a class="code" href="classPSoundChannel.html#n0">baseChannel</a>;00726 };00727 00728 00730 00731 <span class="comment">// define the sound plugin service descriptor</span>00732 <a name="l00733"></a><a class="code" href="classPSoundChannelPluginServiceDescriptor.html">00733</a> <span class="keyword">class </span><a class="code" href="classPSoundChannelPluginServiceDescriptor.html">PSoundChannelPluginServiceDescriptor</a> : <span class="keyword">public</span> <a class="code" href="classPPluginServiceDescriptor.html">PPluginServiceDescriptor</a> 00734 {00735 <span class="keyword">public</span>:<a name="l00736"></a><a class="code" href="classPSoundChannelPluginServiceDescriptor.html#a0">00736</a> <a class="code" href="classPSoundChannelPluginServiceDescriptor.html#a0">PSoundChannelPluginServiceDescriptor</a>(00737 <span class="keywordtype">unsigned</span> (*_GetVersion)(),00738 <a class="code" href="classPSoundChannel.html">PSoundChannel</a> *(*_CreateInstance)(),00739 <a class="code" href="classPStringArray.html">PStringArray</a> (*_GetDeviceNames)(<a class="code" href="classPSoundChannel.html#z387_0">PSoundChannel::Directions</a>)00740 )00741 : <a class="code" href="classPPluginServiceDescriptor.html">PPluginServiceDescriptor</a>(_GetVersion),00742 <a class="code" href="classPSoundChannelPluginServiceDescriptor.html#m0">CreateInstance</a>(_CreateInstance),00743 <a class="code" href="classPSoundChannelPluginServiceDescriptor.html#m1">GetDeviceNames</a>(_GetDeviceNames)00744 { }00745 00746 <a class="code" href="classPSoundChannel.html">PSoundChannel</a> *(*CreateInstance)();00747 <a class="code" href="classPStringArray.html">PStringArray</a> (*<a class="code" href="classPSoundChannelPluginServiceDescriptor.html#m1">GetDeviceNames</a>) (PSoundChannel::Directions);00748 };00749 00750 <a name="l00751"></a><a class="code" href="sound_8h.html#a0">00751</a> <span class="preprocessor">#define PCREATE_SOUND_SERVICE_DESCRIPTOR(className, versionFn) \</span>00752 <span class="preprocessor">PSoundChannel * className##_CreateInstance () \</span>00753 <span class="preprocessor">{ \</span>00754 <span class="preprocessor"> return new className; \</span>00755 <span class="preprocessor">} \</span>00756 <span class="preprocessor">\</span>00757 <span class="preprocessor">PStringArray className##_GetDeviceNames (PSoundChannel::Directions dir) \</span>00758 <span class="preprocessor">{ \</span>00759 <span class="preprocessor"> return className::GetDeviceNames(dir); \</span>00760 <span class="preprocessor">} \</span>00761 <span class="preprocessor">\</span>00762 <span class="preprocessor">PSoundChannelPluginServiceDescriptor className##_descriptor(\</span>00763 <span class="preprocessor"> versionFn, \</span>00764 <span class="preprocessor"> className##_CreateInstance, \</span>00765 <span class="preprocessor"> className##_GetDeviceNames \</span>00766 <span class="preprocessor">); \</span>00767 <span class="preprocessor"></span><a name="l00768"></a><a class="code" href="sound_8h.html#a1">00768</a> <span class="preprocessor"></span><span class="preprocessor">#define PCREATE_SOUND_PLUGIN(name, className) \</span>00769 <span class="preprocessor">PCREATE_PLUGIN_VERSION_FN(name, PSoundChannel) \</span>00770 <span class="preprocessor">PCREATE_SOUND_SERVICE_DESCRIPTOR(className, PPLUGIN_VERSION_FN(name, PSoundChannel)) \</span>00771 <span class="preprocessor">PCREATE_PLUGIN(name, PSoundChannel, &className##_descriptor)</span>00772 <span class="preprocessor"></span>00773 <span class="preprocessor">#endif</span>00774 <span class="preprocessor"></span>00775 <span class="comment">// End Of File ///////////////////////////////////////////////////////////////</span></pre></div><hr><address style="align: right;"><small>Generated on Wed Sep 29 22:44:12 2004 for PWLib by<a href="http://www.doxygen.org/index.html"><img src="doxygen.png" alt="doxygen" align="middle" border=0 width=110 height=53></a>1.2.18 </small></address></body></html>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -