⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 sdlcdstatus.html

📁 VC5.6.7的一个扩展库。跟DirectX的功能差不多。
💻 HTML
字号:
<HTML><HEAD><TITLE>SDL_CDStatus</TITLE><METANAME="GENERATOR"CONTENT="Modular DocBook HTML Stylesheet Version 1.76b+"><LINKREL="HOME"TITLE="SDL Library Documentation"HREF="index.html"><LINKREL="UP"TITLE="CD-ROM"HREF="cdrom.html"><LINKREL="PREVIOUS"TITLE="SDL_CDOpen"HREF="sdlcdopen.html"><LINKREL="NEXT"TITLE="SDL_CDPlay"HREF="sdlcdplay.html"></HEAD><BODYCLASS="REFENTRY"BGCOLOR="#FFF8DC"TEXT="#000000"LINK="#0000ee"VLINK="#551a8b"ALINK="#ff0000"><DIVCLASS="NAVHEADER"><TABLESUMMARY="Header navigation table"WIDTH="100%"BORDER="0"CELLPADDING="0"CELLSPACING="0"><TR><THCOLSPAN="3"ALIGN="center">SDL Library Documentation</TH></TR><TR><TDWIDTH="10%"ALIGN="left"VALIGN="bottom"><AHREF="sdlcdopen.html"ACCESSKEY="P">Prev</A></TD><TDWIDTH="80%"ALIGN="center"VALIGN="bottom"></TD><TDWIDTH="10%"ALIGN="right"VALIGN="bottom"><AHREF="sdlcdplay.html"ACCESSKEY="N">Next</A></TD></TR></TABLE><HRALIGN="LEFT"WIDTH="100%"></DIV><H1><ANAME="SDLCDSTATUS"></A>SDL_CDStatus</H1><DIVCLASS="REFNAMEDIV"><ANAME="AEN7308"></A><H2>Name</H2>SDL_CDStatus&nbsp;--&nbsp;Returns the current status of the given drive.</DIV><DIVCLASS="REFSYNOPSISDIV"><ANAME="AEN7311"></A><H2>Synopsis</H2><DIVCLASS="FUNCSYNOPSIS"><ANAME="AEN7312"></A><P></P><PRECLASS="FUNCSYNOPSISINFO">#include "SDL.h"</PRE><P><CODE><CODECLASS="FUNCDEF">CDstatus <BCLASS="FSFUNC">SDL_CDStatus</B></CODE>(SDL_CD *cdrom);</CODE></P><PRECLASS="FUNCSYNOPSISINFO">/* Given a status, returns true if there's a disk in the drive */#define CD_INDRIVE(status)      ((int)status &#62; 0)</PRE><P></P></DIV></DIV><DIVCLASS="REFSECT1"><ANAME="AEN7319"></A><H2>Description</H2><P>This function returns the current status of the given drive. Status is described like so:<PRECLASS="PROGRAMLISTING">typedef enum {  CD_TRAYEMPTY,  CD_STOPPED,  CD_PLAYING,  CD_PAUSED,  CD_ERROR = -1} CDstatus;</PRE></P><P>If the drive has a CD in it, the table of contents of the CD and currentplay position of the CD will be stored in the SDL_CD structure.</P><P>The macro <TTCLASS="LITERAL">CD_INDRIVE</TT> is provided for convenience, and given a status returns true if there's a disk in the drive.</P><DIVCLASS="NOTE"><BLOCKQUOTECLASS="NOTE"><P><B>Note: </B><TTCLASS="FUNCTION">SDL_CDStatus</TT> also updates the <AHREF="sdlcd.html"><SPANCLASS="STRUCTNAME">SDL_CD</SPAN></A> structure passed to it.</P></BLOCKQUOTE></DIV></DIV><DIVCLASS="REFSECT1"><ANAME="AEN7331"></A><H2>Example</H2><PRECLASS="PROGRAMLISTING">int playTrack(int track){  int playing = 0;  if ( CD_INDRIVE(SDL_CDStatus(cdrom)) ) {  /* clamp to the actual number of tracks on the CD */    if (track &#62;= cdrom-&#62;numtracks) {      track = cdrom-&#62;numtracks-1;    }    if ( SDL_CDPlayTracks(cdrom, track, 0, 1, 0) == 0 ) {      playing = 1;    }  }  return playing;}</PRE></DIV><DIVCLASS="REFSECT1"><ANAME="AEN7334"></A><H2>See Also</H2><P><AHREF="sdlcd.html"><TTCLASS="FUNCTION">SDL_CD</TT></A></P></DIV><DIVCLASS="NAVFOOTER"><HRALIGN="LEFT"WIDTH="100%"><TABLESUMMARY="Footer navigation table"WIDTH="100%"BORDER="0"CELLPADDING="0"CELLSPACING="0"><TR><TDWIDTH="33%"ALIGN="left"VALIGN="top"><AHREF="sdlcdopen.html"ACCESSKEY="P">Prev</A></TD><TDWIDTH="34%"ALIGN="center"VALIGN="top"><AHREF="index.html"ACCESSKEY="H">Home</A></TD><TDWIDTH="33%"ALIGN="right"VALIGN="top"><AHREF="sdlcdplay.html"ACCESSKEY="N">Next</A></TD></TR><TR><TDWIDTH="33%"ALIGN="left"VALIGN="top">SDL_CDOpen</TD><TDWIDTH="34%"ALIGN="center"VALIGN="top"><AHREF="cdrom.html"ACCESSKEY="U">Up</A></TD><TDWIDTH="33%"ALIGN="right"VALIGN="top">SDL_CDPlay</TD></TR></TABLE></DIV></BODY></HTML>

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -