cd_audio.shtml
来自「mfc资源大全包含MFC编程各个方面的源码」· SHTML 代码 · 共 598 行 · 第 1/2 页
SHTML
598 行
dwDeviceType, BOOL bShareable = FALSE)<br>
virtual DWORD <strong>Open</strong>(LPCSTR lpstrName,
BOOL bShareable = FALSE); <br>
Opens the device. if <em>bShareable</em> is set to TRUE
the device can be shared with other applications that use
it. The device can be opened by a device type constant (<em>dwDeviceType</em>)
or by a driver name (<em>lpstrName</em>).</li>
<li><!--webbot bot="HTMLMarkup" startspan --><A NAME="#CLOSE">
<!--webbot
bot="HTMLMarkup" endspan -->virtual DWORD <strong>Close</strong>()
<br>
Closes the device</li>
<li>static DWORD <strong>CloseAll</strong>() <br>
Static member function. Closes all MCI devices opened by
the application: wait until devices are closed</li>
<li><!--webbot bot="HTMLMarkup" startspan --><A NAME="#GETLASTERROR">
<!--webbot
bot="HTMLMarkup" endspan -->MCIERROR <strong>GetLastError</strong>()<br>
Returns the code of the last error occurred.</li>
<li><!--webbot bot="HTMLMarkup" startspan --><A NAME="#GETDEVCAPS">
<!--webbot
bot="HTMLMarkup" endspan -->DWORD <strong>GetDevCaps</strong>(DWORD
dwDevcaps, BOOL bItem = FALSE)<br>
Retrieves static information about the device. If <em>bItem</em>
is set to TRUE you can retrieve specific capabilities
(see the <a href="#GETDEVCAPS">table</a> below)</li>
<li>virtual DWORD <strong>GetStatus</strong>(DWORD
dwStatusItem)<br>
Retrieves information about the device (see the <a
href="#GETSTATUS">table</a> below)</li>
<li><font size="3">virtual DWORD <strong>GetInfo</strong>(DWORD
dwInfoString, LPSTR lpstrReturn, DWORD dwRetSize).<br>
</font>Retrieves a string information from the device
(see the <a href="#MCIDEVICEGETINFO">table</a> below);</li>
<li>virtual DWORD <strong>GetMode</strong>()<br>
Shortcut for GetStatus(CMciDevice::StatusMode) (see the <a
href="#GETMODE">table</a> below)</li>
<li>HWND <strong>GetCallbackHwnd</strong>() const<br>
Retrieves the handle of the callback window</li>
<li><!--webbot bot="HTMLMarkup" startspan --><A NAME="#SETCALLBACKWND">
<!--webbot
bot="HTMLMarkup" endspan -->void <strong>SetCallbackWnd</strong>(CWnd*
pWnd)<br>
void <strong>SetCallbackWnd</strong>(HWND hWnd)<br>
Sets the callback Window.</li>
<li><!--webbot bot="HTMLMarkup" startspan --><A NAME="#REPORTERRORS">
<!--webbot
bot="HTMLMarkup" endspan -->void <strong>ReportErrors</strong>(BOOL
bReport = TRUE)<br>
Sets error report on/off</li>
</ul>
<p><strong>Static constants</strong></p>
<p><!--webbot bot="HTMLMarkup" startspan --><A NAME="#GETDEVCAPS">
<!--webbot
bot="HTMLMarkup" endspan -->Values for <em>dwDevcaps</em> <strong>GetDevCaps()</strong>
(bItem = FALSE)</p>
<ul>
<li>DWORD <strong>GetdevcapsCompound</strong></li>
<li>DWORD <strong>GetdevcapsHasAudio</strong></li>
<li>DWORD <strong>GetdevcapsHasVideo</strong></li>
<li>DWORD <strong>GetdevcapsHasVideo</strong></li>
<li>DWORD<strong> GetdevcapsUsesFiles</strong></li>
<li>DWORD<strong> GetdevcapsDeviceType</strong></li>
</ul>
<p>Values for <em>dwDevcaps</em> <strong>GetDevCaps()</strong>
(bItem = TRUE)</p>
<ul>
<li>DWORD <strong>GetdevcapsCanEject</strong></li>
<li>DWORD <strong>GetdevcapsCanPlay</strong></li>
<li>DWORD <strong>GetdevcapsCanRecord</strong></li>
<li>DWORD <strong>GetdevcapsCanSave</strong></li>
</ul>
<p>Values returned by<strong> GetDevCaps</strong>(CMciDevice::GetdevcapsDeviceType)</p>
<ul>
<li>DWORD <strong>DevtypeAnimation</strong></li>
<li>DWORD <strong>DevtypeCdaudio</strong></li>
<li>DWORD <strong>DevtypeDat</strong></li>
<li>DWORD <strong>DevtypeDigitalvideo</strong></li>
<li>DWORD <strong>DevtypeOther</strong></li>
<li>DWORD <strong>DevtypeOverlay</strong></li>
<li>DWORD <strong>DevtypeScanner</strong></li>
<li>DWORD <strong>DevtypeSequencer</strong></li>
<li>DWORD <strong>DevtypeVcr</strong></li>
<li>DWORD <strong>DevtypeVideodisc</strong></li>
<li>DWORD <strong>DevtypeWaveaudio</strong></li>
</ul>
<p><!--webbot bot="HTMLMarkup" startspan --><A NAME="#GETSTATUS">
<!--webbot
bot="HTMLMarkup" endspan -->Values for <em>dwStatusItem</em> in <strong>GetStatus()</strong></p>
<ul>
<li>DWORD <strong>StatusReady</strong></li>
<li>DWORD <strong>StatusMediaPresent</strong></li>
<li>DWORD <strong>StatusMode</strong></li>
<li>DWORD <strong>StatusNumberOfTracks</strong></li>
</ul>
<p><!--webbot bot="HTMLMarkup" startspan --><A NAME="#GETMODE">
<!--webbot
bot="HTMLMarkup" endspan -->Values returned by <strong>GetMode()</strong>.</p>
<ul>
<li>DWORD <strong>ModeNotReady</strong></li>
<li>DWORD <strong>ModePause</strong></li>
<li>DWORD <strong>ModePlay</strong></li>
<li>DWORD <strong>ModeStop</strong></li>
<li>DWORD <strong>ModeStop</strong></li>
<li>DWORD <strong>ModeRecord</strong></li>
<li>DWORD <strong>ModeSeek</strong></li>
</ul>
<p><!--webbot bot="HTMLMarkup" startspan --><A NAME="#MCIDEVICEGETINFO">
<!--webbot
bot="HTMLMarkup" endspan --><font size="3">Values for <em>dwInfoString</em>
in <strong>GetInfo()</strong></font></p>
<ul>
<li><font size="3">DWORD <strong>InfoProduct</strong></font></li>
</ul>
<p><strong>Operations for CCdAudio</strong></p>
<ul>
<li><font size="3">DWORD <strong>Open</strong>(BOOL
bShareable = FALSE)<br>
</font>Opens the device. <em>bShareable</em> has the same
meaning as in CMciDevice::<a href="MCIDEVICEOPEN">Open</a>()</li>
<li><font size="3">DWORD <strong>PlayTrack</strong>(BYTE
bTrack, BOOL bAsync = TRUE)<br>
</font>Plays a CD track asynchronously. If <em>bAsync</em>
is set to FALSE, the playback is performed synchronously.</li>
<li><!--webbot bot="HTMLMarkup" startspan --><A NAME="#PLAY">
<!--webbot
bot="HTMLMarkup" endspan --><font size="3">DWORD <strong>Play</strong>(DWORD
dwFrom = 0L, DWORD dwTo = 0L, BOOL bAsync = TRUE)<br>
</font>Plays from the position <em>dwFrom</em> to the
position <em>dwTo</em> asynchronously. If <em>bAsync</em>
is set to FALSE, the playback is performed synchronously.</li>
<li><!--webbot bot="HTMLMarkup" startspan --><A NAME="#STOP">
<!--webbot
bot="HTMLMarkup" endspan --><font size="3">DWORD <strong>Stop</strong>()<br>
</font>Stops playback</li>
<li><font size="3">DWORD <strong>Pause</strong>()<br>
</font>Pauses playback.</li>
<li><!--webbot bot="HTMLMarkup" startspan --><A NAME="#SEEK">
<!--webbot
bot="HTMLMarkup" endspan --><font size="3">DWORD <strong>Seek</strong>(DWORD
dwTo, BOOL bAsync = FALSE)<br>
</font>Seek to the position <em>dwTo</em>. If bAsync is
set to FALSE, the operation is performed synchronously.<font
size="3"><br>
DWORD <strong>SeekToStart</strong>(BOOL bAsync = FALSE)<br>
DWORD <strong>SeekToEnd</strong>(BOOL bAsync = FALSE)</font></li>
<li><font size="3">DWORD <strong>OpenDoor</strong>(BOOL
bOpenDoor = TRUE)<br>
</font>Opens/Closes the CD drawer</li>
<li><font size="3">DWORD <strong>GetNumberOfTracks</strong>()<br>
</font>Retrieves the number of playable tracks. It is a
shortcut for GetStatus(MciDevice::StatusNumberOfTracks).</li>
<li><font size="3">DWORD <strong>GetCurrentTrack</strong>().<br>
</font>Retrieves the current track number. It is a
shortcut for GetStatus(CCdAudio::StatusCurrentTrack).</li>
<li><font size="3">DWORD <strong>GetMediaLenght</strong>().<br>
</font>Retrieves the total CD length. It is a shortcut
for GetStatus(CMciDevice::StatusMediaLenght).</li>
<li><font size="3">DWORD <strong>GetStartPos</strong>().<br>
</font>Retrieves the CD starting position. It is a
shortcut for GetStatus(CCdAudio::StatusStart).</li>
<li><font size="3">DWORD <strong>GetCurrentPos</strong>()<br>
</font>Retrieves the current player position. It is a
shortcut for GetStatus(CCdAudio::StatusPosition).</li>
<li><font size="3">BOOL <strong>IsReady</strong>()<br>
</font>Checks if the device is ready to be operated. It
is a shortcut for GetStatus(MciDevice::StatusReady).</li>
<li><font size="3">DWORD <strong>GetTrackLength</strong>(DWORD
dwTrack)<br>
</font>Retrieves the length of the CD track <em>dwTrack</em>.</li>
<li><font size="3">DWORD <strong>GetTrackPos</strong>(DWORD
dwTrack)<br>
</font>Retrieves the starting position of the CD track <em>dwTrack.</em></li>
<li><font size="3">DWORD <strong>GetTrackType</strong>(DWORD
dwTrack)<br>
</font>Retrieves the type of the CD track <em>dwTrack </em>(see
the <a href="#SETTIMEFORMAT">table</a> below).</li>
<li><font size="3">DWORD <strong>GetTimeFormat</strong>()<br>
</font>Retrieves the current time format (see the <a
href="#SETTIMEFORMAT">table</a> below).</li>
<li><!--webbot bot="HTMLMarkup" startspan --><A NAME="#SETTIMEFORMAT">
<!--webbot
bot="HTMLMarkup" endspan --><font size="3">DWORD <strong>SetTimeFormat</strong>(DWORD
dwTimeFormat)<br>
</font>Sets a new time format for the device (see the <a
href="#SETTIMEFORMAT">table</a> below)..</li>
</ul>
<p><strong>Static constants</strong></p>
<p><!--webbot bot="HTMLMarkup" startspan --><A NAME="#SETTIMEFORMAT">
<!--webbot
bot="HTMLMarkup" endspan --><font size="3">Device specific time
formats for <em>dwTimeFormat</em> in <strong>SetTimeFormat()</strong></font></p>
<ul>
<li><font size="3">DWORD <strong>FormatMilliseconds</strong></font></li>
<li><font size="3">DWORD <strong>FormatMSF</strong></font></li>
<li><font size="3">DWORD <strong>FormatTMSF</strong></font></li>
</ul>
<p><!--webbot bot="HTMLMarkup" startspan --><A NAME="#GETSTATUS">
<!--webbot
bot="HTMLMarkup" endspan --><font size="3">Device-specific status
items for <strong>GetStatus()</strong></font></p>
<ul>
<li><font size="3">DWORD <strong>StatusCurrentTrack</strong></font></li>
<li><font size="3">DWORD <strong>StatusLenght</strong></font></li>
<li><font size="3">DWORD <strong>StatusPosition</strong></font></li>
<li><font size="3">DWORD <strong>StatusStart</strong></font></li>
</ul>
<p><!--webbot bot="HTMLMarkup" startspan --><A NAME="#GETTRACKTYPE">
<!--webbot
bot="HTMLMarkup" endspan --><font size="3">Values returned by <strong>GetTrackType()</strong></font></p>
<ul>
<li><font size="3">DWORD <strong>TrackTypeAudio</strong></font></li>
<li><font size="3">DWORD <strong>TrackTypeOther</strong></font></li>
</ul>
<p><!--webbot bot="HTMLMarkup" startspan --><A NAME="#GETINFO">
<!--webbot
bot="HTMLMarkup" endspan --><font size="3">Values for <em>dwInfoString</em>
in <strong>GetInfo()</strong></font></p>
<ul>
<li><font size="3">DWORD <strong>InfoProduct</strong></font></li>
<li><font size="3">DWORD <strong>InfoMediaIdentity</strong></font></li>
<li><font size="3">DWORD <strong>InfoMediaUPC</strong></font></li>
</ul>
<p><font size="3"><strong>What's new in the latest release?</strong></font></p>
<ul>
<li><font size="3">Some Getdevcap constant in CMciDevice was
added.</font></li>
<li><font size="3">Some bug fix in the CMciSendCommand
function: in the precedent version the error report
doesn't work fine. Now it works well also with the
CloseaAll() static function.</font></li>
<li><font size="3">The constant InfoProduct was added in
CCdAudio</font></li>
</ul>
<p><font size="3"><strong>Author's note</strong></font></p>
<p>This is a work in progress: I 'm continuously working to
improve it. I'll be grateful to you if you mail me your comments,
advice, or bug apparition reports!.</p>
<p>Last updated: 4 June 1998 </p>
<P><HR>
<!-- Codeguru contact details -->
<TABLE BORDER=0 WIDTH="100%">
<TR>
<TD WIDTH="33%"><FONT SIZE=-1><A HREF="http://www.codeguru.com">Goto HomePage</A></FONT></TD>
<TD WIDTH="33%">
<CENTER><FONT SIZE=-2>© 1998 Zafir Anjum</FONT> </CENTER>
</TD>
<TD WIDTH="34%">
<DIV ALIGN=right><FONT SIZE=-1>Contact me: <A HREF="mailto:zafir@home.com">zafir@home.com</A> </FONT></DIV>
</TD>
</TR>
</TABLE>
<!-- Counter -->
<CENTER><FONT SIZE=-2><!--#exec cgi="/cgi/counters/counter.cgi"--></FONT></CENTER>
</BODY>
</HTML>
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?