zengine/doc/html/classZE_1_1ZMusic.html
James Turk dd4ed607df 0.8.3
2003-04-27 18:54:58 +00:00

533 lines
20 KiB
HTML

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<html><head><meta http-equiv="Content-Type" content="text/html;charset=iso-8859-1">
<title>ZE::ZMusic class Reference</title>
<link href="doxygen.css" rel="stylesheet" type="text/css">
</head><body>
<!-- Generated by Doxygen 1.3-rc2 -->
<center>
<a class="qindex" href="index.html">Main Page</a> &nbsp; <a class="qindex" href="namespaces.html">Namespace List</a> &nbsp; <a class="qindex" href="annotated.html">Compound List</a> &nbsp; <a class="qindex" href="files.html">File List</a> &nbsp; <a class="qindex" href="namespacemembers.html">Namespace Members</a> &nbsp; <a class="qindex" href="functions.html">Compound Members</a> &nbsp; <a class="qindex" href="globals.html">File Members</a> &nbsp; </center>
<hr><h1>ZE::ZMusic Class Reference</h1><code>#include &lt;<a class="el" href="ZE__ZMusic_8h-source.html">ZE_ZMusic.h</a>&gt;</code>
<p>
<a href="classZE_1_1ZMusic-members.html">List of all members.</a><hr><a name="_details"></a><h2>Detailed Description</h2>
<a class="el" href="classZE_1_1ZMusic.html">ZMusic</a> music class, class wraps common features for SDL_Mixer's Mix_Music. Inherited from ZObject.
<p>
<table border=0 cellpadding=0 cellspacing=0>
<tr><td></td></tr>
<tr><td colspan=2><br><h2>Public Methods</h2></td></tr>
<tr><td nowrap align=right valign=top>&nbsp;</td><td valign=bottom><a class="el" href="classZE_1_1ZMusic.html#a0">ZMusic</a> ()</td></tr>
<tr><td>&nbsp;</td><td><font size=-1><em>Default Constructor.</em> <a href="#a0"></a><em></em></font><br><br></td></tr>
<tr><td nowrap align=right valign=top>&nbsp;</td><td valign=bottom><a class="el" href="classZE_1_1ZMusic.html#a1">ZMusic</a> (string filename)</td></tr>
<tr><td>&nbsp;</td><td><font size=-1><em>Constructor that opens a music file.</em> <a href="#a1"></a><em></em></font><br><br></td></tr>
<tr><td nowrap align=right valign=top>virtual&nbsp;</td><td valign=bottom><a class="el" href="classZE_1_1ZMusic.html#a2">~ZMusic</a> ()</td></tr>
<tr><td>&nbsp;</td><td><font size=-1><em>Destructor, frees memory.</em> <a href="#a2"></a><em></em></font><br><br></td></tr>
<tr><td nowrap align=right valign=top>void&nbsp;</td><td valign=bottom><a class="el" href="classZE_1_1ZMusic.html#a3">Open</a> (string filename)</td></tr>
<tr><td>&nbsp;</td><td><font size=-1><em>Opens a music file.</em> <a href="#a3"></a><em></em></font><br><br></td></tr>
<tr><td nowrap align=right valign=top>void&nbsp;</td><td valign=bottom><a class="el" href="classZE_1_1ZMusic.html#a4">Release</a> ()</td></tr>
<tr><td>&nbsp;</td><td><font size=-1><em>Release music.</em> <a href="#a4"></a><em></em></font><br><br></td></tr>
<tr><td nowrap align=right valign=top>void&nbsp;</td><td valign=bottom><a class="el" href="classZE_1_1ZMusic.html#a5">Play</a> (int loopNum=0, int fadeTime=0) const</td></tr>
<tr><td>&nbsp;</td><td><font size=-1><em>Play currently loaded music.</em> <a href="#a5"></a><em></em></font><br><br></td></tr>
<tr><td nowrap align=right valign=top>void&nbsp;</td><td valign=bottom><a class="el" href="classZE_1_1ZMusic.html#a6">Pause</a> () const</td></tr>
<tr><td>&nbsp;</td><td><font size=-1><em>Pause music.</em> <a href="#a6"></a><em></em></font><br><br></td></tr>
<tr><td nowrap align=right valign=top>void&nbsp;</td><td valign=bottom><a class="el" href="classZE_1_1ZMusic.html#a7">Unpause</a> () const</td></tr>
<tr><td>&nbsp;</td><td><font size=-1><em>Unpause music.</em> <a href="#a7"></a><em></em></font><br><br></td></tr>
<tr><td nowrap align=right valign=top>void&nbsp;</td><td valign=bottom><a class="el" href="classZE_1_1ZMusic.html#a8">Rewind</a> () const</td></tr>
<tr><td>&nbsp;</td><td><font size=-1><em>Rewind music.</em> <a href="#a8"></a><em></em></font><br><br></td></tr>
<tr><td nowrap align=right valign=top>void&nbsp;</td><td valign=bottom><a class="el" href="classZE_1_1ZMusic.html#a9">Stop</a> (int fadeTime=0) const</td></tr>
<tr><td>&nbsp;</td><td><font size=-1><em>Stop music.</em> <a href="#a9"></a><em></em></font><br><br></td></tr>
<tr><td nowrap align=right valign=top>void&nbsp;</td><td valign=bottom><a class="el" href="classZE_1_1ZMusic.html#a10">SetVolume</a> (int volume)</td></tr>
<tr><td>&nbsp;</td><td><font size=-1><em>Change Volume.</em> <a href="#a10"></a><em></em></font><br><br></td></tr>
<tr><td nowrap align=right valign=top>bool&nbsp;</td><td valign=bottom><a class="el" href="classZE_1_1ZMusic.html#a11">IsLoaded</a> () const</td></tr>
<tr><td>&nbsp;</td><td><font size=-1><em>Check if file is loaded.</em> <a href="#a11"></a><em></em></font><br><br></td></tr>
<tr><td nowrap align=right valign=top>bool&nbsp;</td><td valign=bottom><a class="el" href="classZE_1_1ZMusic.html#a12">IsPlaying</a> () const</td></tr>
<tr><td>&nbsp;</td><td><font size=-1><em>Check if music is Playing.</em> <a href="#a12"></a><em></em></font><br><br></td></tr>
<tr><td nowrap align=right valign=top>bool&nbsp;</td><td valign=bottom><a class="el" href="classZE_1_1ZMusic.html#a13">IsPaused</a> () const</td></tr>
<tr><td>&nbsp;</td><td><font size=-1><em>Check if music is Paused.</em> <a href="#a13"></a><em></em></font><br><br></td></tr>
<tr><td nowrap align=right valign=top>int&nbsp;</td><td valign=bottom><a class="el" href="classZE_1_1ZMusic.html#a14">Volume</a> () const</td></tr>
<tr><td>&nbsp;</td><td><font size=-1><em>Find Current Volume of Music.</em> <a href="#a14"></a><em></em></font><br><br></td></tr>
<tr><td colspan=2><br><h2>Static Public Attributes</h2></td></tr>
<tr><td nowrap align=right valign=top><a name="p0" doxytag="ZE::ZMusic::LoopInfinite"></a>
const int&nbsp;</td><td valign=bottom><a class="el" href="classZE_1_1ZMusic.html#p0">LoopInfinite</a></td></tr>
<tr><td>&nbsp;</td><td><font size=-1><em>Static Variable For Infinite loop of sound. (Defined as -1).</em></font><br><br></td></tr>
<tr><td colspan=2><br><h2>Protected Attributes</h2></td></tr>
<tr><td nowrap align=right valign=top><a name="n0" doxytag="ZE::ZMusic::rEngine"></a>
<a class="el" href="classZE_1_1ZEngine.html">ZEngine</a> *&nbsp;</td><td valign=bottom><a class="el" href="classZE_1_1ZMusic.html#n0">rEngine</a></td></tr>
<tr><td>&nbsp;</td><td><font size=-1><em>Pointer to <a class="el" href="classZE_1_1ZEngine.html">ZEngine</a> Object.</em></font><br><br></td></tr>
<tr><td nowrap align=right valign=top><a name="n1" doxytag="ZE::ZMusic::rMusic"></a>
Mix_Music *&nbsp;</td><td valign=bottom><a class="el" href="classZE_1_1ZMusic.html#n1">rMusic</a></td></tr>
<tr><td>&nbsp;</td><td><font size=-1><em>Pointer to music data.</em></font><br><br></td></tr>
</table>
<hr><h2>Constructor &amp; Destructor Documentation</h2>
<a name="a0" doxytag="ZE::ZMusic::ZMusic"></a><p>
<table width="100%" cellpadding="2" cellspacing="0" border="0">
<tr>
<td class="md">
<table cellpadding="0" cellspacing="0" border="0">
<tr>
<td class="md" nowrap valign="top"> ZE::ZMusic::ZMusic </td>
<td class="md" valign="top">(&nbsp;</td>
<td class="mdname1" valign="top" nowrap>&nbsp; </td>
<td class="md" valign="top">)&nbsp;</td>
<td class="md" nowrap></td>
</tr>
</table>
</td>
</tr>
</table>
<table cellspacing=5 cellpadding=0 border=0>
<tr>
<td>
&nbsp;
</td>
<td>
<p>
Default Constructor, does nothing. </td>
</tr>
</table>
<a name="a1" doxytag="ZE::ZMusic::ZMusic"></a><p>
<table width="100%" cellpadding="2" cellspacing="0" border="0">
<tr>
<td class="md">
<table cellpadding="0" cellspacing="0" border="0">
<tr>
<td class="md" nowrap valign="top"> ZE::ZMusic::ZMusic </td>
<td class="md" valign="top">(&nbsp;</td>
<td class="md" nowrap valign="top">string&nbsp;</td>
<td class="mdname1" valign="top" nowrap>&nbsp; <em>filename</em> </td>
<td class="md" valign="top">)&nbsp;</td>
<td class="md" nowrap></td>
</tr>
</table>
</td>
</tr>
</table>
<table cellspacing=5 cellpadding=0 border=0>
<tr>
<td>
&nbsp;
</td>
<td>
<p>
Constructor simply calls <a class="el" href="classZE_1_1ZMusic.html#a3">ZMusic::Open()</a> with same filename. (WAV,MOD,MID,OGG) <dl compact><dt><b>Parameters:</b></dt><dd>
<table border="0" cellspacing="2" cellpadding="0">
<tr><td valign=top><em>filename</em>&nbsp;</td><td>Music to open. </td></tr>
</table>
</dl>
</td>
</tr>
</table>
<a name="a2" doxytag="ZE::ZMusic::~ZMusic"></a><p>
<table width="100%" cellpadding="2" cellspacing="0" border="0">
<tr>
<td class="md">
<table cellpadding="0" cellspacing="0" border="0">
<tr>
<td class="md" nowrap valign="top"> virtual ZE::ZMusic::~ZMusic </td>
<td class="md" valign="top">(&nbsp;</td>
<td class="mdname1" valign="top" nowrap>&nbsp; </td>
<td class="md" valign="top">)&nbsp;</td>
<td class="md" nowrap><code> [virtual]</code></td>
</tr>
</table>
</td>
</tr>
</table>
<table cellspacing=5 cellpadding=0 border=0>
<tr>
<td>
&nbsp;
</td>
<td>
<p>
Destructor calls <a class="el" href="classZE_1_1ZMusic.html#a4">ZMusic::Release()</a>. </td>
</tr>
</table>
<hr><h2>Member Function Documentation</h2>
<a name="a3" doxytag="ZE::ZMusic::Open"></a><p>
<table width="100%" cellpadding="2" cellspacing="0" border="0">
<tr>
<td class="md">
<table cellpadding="0" cellspacing="0" border="0">
<tr>
<td class="md" nowrap valign="top"> void ZE::ZMusic::Open </td>
<td class="md" valign="top">(&nbsp;</td>
<td class="md" nowrap valign="top">string&nbsp;</td>
<td class="mdname1" valign="top" nowrap>&nbsp; <em>filename</em> </td>
<td class="md" valign="top">)&nbsp;</td>
<td class="md" nowrap></td>
</tr>
</table>
</td>
</tr>
</table>
<table cellspacing=5 cellpadding=0 border=0>
<tr>
<td>
&nbsp;
</td>
<td>
<p>
Open a music file to be used. <dl compact><dt><b>Parameters:</b></dt><dd>
<table border="0" cellspacing="2" cellpadding="0">
<tr><td valign=top><em>filename</em>&nbsp;</td><td>Music to open. </td></tr>
</table>
</dl>
</td>
</tr>
</table>
<a name="a4" doxytag="ZE::ZMusic::Release"></a><p>
<table width="100%" cellpadding="2" cellspacing="0" border="0">
<tr>
<td class="md">
<table cellpadding="0" cellspacing="0" border="0">
<tr>
<td class="md" nowrap valign="top"> void ZE::ZMusic::Release </td>
<td class="md" valign="top">(&nbsp;</td>
<td class="mdname1" valign="top" nowrap>&nbsp; </td>
<td class="md" valign="top">)&nbsp;</td>
<td class="md" nowrap></td>
</tr>
</table>
</td>
</tr>
</table>
<table cellspacing=5 cellpadding=0 border=0>
<tr>
<td>
&nbsp;
</td>
<td>
<p>
Release memory held by music data. </td>
</tr>
</table>
<a name="a5" doxytag="ZE::ZMusic::Play"></a><p>
<table width="100%" cellpadding="2" cellspacing="0" border="0">
<tr>
<td class="md">
<table cellpadding="0" cellspacing="0" border="0">
<tr>
<td class="md" nowrap valign="top"> void ZE::ZMusic::Play </td>
<td class="md" valign="top">(&nbsp;</td>
<td class="md" nowrap valign="top">int&nbsp;</td>
<td class="mdname" nowrap>&nbsp; <em>loopNum</em> = 0, </td>
</tr>
<tr>
<td></td>
<td></td>
<td class="md" nowrap>int&nbsp;</td>
<td class="mdname" nowrap>&nbsp; <em>fadeTime</em> = 0</td>
</tr>
<tr>
<td></td>
<td class="md">)&nbsp;</td>
<td class="md" colspan="2"> const</td>
</tr>
</table>
</td>
</tr>
</table>
<table cellspacing=5 cellpadding=0 border=0>
<tr>
<td>
&nbsp;
</td>
<td>
<p>
Play music currently loaded in <a class="el" href="classZE_1_1ZMusic.html">ZMusic</a>, looping loopNum times. (use <a class="el" href="classZE_1_1ZMusic.html#p0">ZMusic::LoopInfinite</a> to loop forever.) If fade is not zero (which it defaults to) music will fade in over specified number of milliseconds. <dl compact><dt><b>Parameters:</b></dt><dd>
<table border="0" cellspacing="2" cellpadding="0">
<tr><td valign=top><em>loopNum</em>&nbsp;</td><td>Number of times to loop song, defaults to zero. </td></tr>
<tr><td valign=top><em>fadeTime</em>&nbsp;</td><td>Milliseconds to fade to full volume, defaults to zero for no fade. </td></tr>
</table>
</dl>
</td>
</tr>
</table>
<a name="a6" doxytag="ZE::ZMusic::Pause"></a><p>
<table width="100%" cellpadding="2" cellspacing="0" border="0">
<tr>
<td class="md">
<table cellpadding="0" cellspacing="0" border="0">
<tr>
<td class="md" nowrap valign="top"> void ZE::ZMusic::Pause </td>
<td class="md" valign="top">(&nbsp;</td>
<td class="mdname1" valign="top" nowrap>&nbsp; </td>
<td class="md" valign="top">)&nbsp;</td>
<td class="md" nowrap> const</td>
</tr>
</table>
</td>
</tr>
</table>
<table cellspacing=5 cellpadding=0 border=0>
<tr>
<td>
&nbsp;
</td>
<td>
<p>
Pause currently playing music. </td>
</tr>
</table>
<a name="a7" doxytag="ZE::ZMusic::Unpause"></a><p>
<table width="100%" cellpadding="2" cellspacing="0" border="0">
<tr>
<td class="md">
<table cellpadding="0" cellspacing="0" border="0">
<tr>
<td class="md" nowrap valign="top"> void ZE::ZMusic::Unpause </td>
<td class="md" valign="top">(&nbsp;</td>
<td class="mdname1" valign="top" nowrap>&nbsp; </td>
<td class="md" valign="top">)&nbsp;</td>
<td class="md" nowrap> const</td>
</tr>
</table>
</td>
</tr>
</table>
<table cellspacing=5 cellpadding=0 border=0>
<tr>
<td>
&nbsp;
</td>
<td>
<p>
Unpause currently paused music. </td>
</tr>
</table>
<a name="a8" doxytag="ZE::ZMusic::Rewind"></a><p>
<table width="100%" cellpadding="2" cellspacing="0" border="0">
<tr>
<td class="md">
<table cellpadding="0" cellspacing="0" border="0">
<tr>
<td class="md" nowrap valign="top"> void ZE::ZMusic::Rewind </td>
<td class="md" valign="top">(&nbsp;</td>
<td class="mdname1" valign="top" nowrap>&nbsp; </td>
<td class="md" valign="top">)&nbsp;</td>
<td class="md" nowrap> const</td>
</tr>
</table>
</td>
</tr>
</table>
<table cellspacing=5 cellpadding=0 border=0>
<tr>
<td>
&nbsp;
</td>
<td>
<p>
Rewind music to beginning. </td>
</tr>
</table>
<a name="a9" doxytag="ZE::ZMusic::Stop"></a><p>
<table width="100%" cellpadding="2" cellspacing="0" border="0">
<tr>
<td class="md">
<table cellpadding="0" cellspacing="0" border="0">
<tr>
<td class="md" nowrap valign="top"> void ZE::ZMusic::Stop </td>
<td class="md" valign="top">(&nbsp;</td>
<td class="md" nowrap valign="top">int&nbsp;</td>
<td class="mdname1" valign="top" nowrap>&nbsp; <em>fadeTime</em> = 0 </td>
<td class="md" valign="top">)&nbsp;</td>
<td class="md" nowrap> const</td>
</tr>
</table>
</td>
</tr>
</table>
<table cellspacing=5 cellpadding=0 border=0>
<tr>
<td>
&nbsp;
</td>
<td>
<p>
Stop currently playing music, if fadeTime is not zero, fade out over specified time. <dl compact><dt><b>Parameters:</b></dt><dd>
<table border="0" cellspacing="2" cellpadding="0">
<tr><td valign=top><em>fadeTime</em>&nbsp;</td><td>Milliseconds to fade out over, defaults to zero for immediate stop. </td></tr>
</table>
</dl>
</td>
</tr>
</table>
<a name="a10" doxytag="ZE::ZMusic::SetVolume"></a><p>
<table width="100%" cellpadding="2" cellspacing="0" border="0">
<tr>
<td class="md">
<table cellpadding="0" cellspacing="0" border="0">
<tr>
<td class="md" nowrap valign="top"> void ZE::ZMusic::SetVolume </td>
<td class="md" valign="top">(&nbsp;</td>
<td class="md" nowrap valign="top">int&nbsp;</td>
<td class="mdname1" valign="top" nowrap>&nbsp; <em>volume</em> </td>
<td class="md" valign="top">)&nbsp;</td>
<td class="md" nowrap></td>
</tr>
</table>
</td>
</tr>
</table>
<table cellspacing=5 cellpadding=0 border=0>
<tr>
<td>
&nbsp;
</td>
<td>
<p>
Change volume of currently playing music. <dl compact><dt><b>Parameters:</b></dt><dd>
<table border="0" cellspacing="2" cellpadding="0">
<tr><td valign=top><em>volume</em>&nbsp;</td><td>Volume to change to, can be in a range from 0 to 128 </td></tr>
</table>
</dl>
</td>
</tr>
</table>
<a name="a11" doxytag="ZE::ZMusic::IsLoaded"></a><p>
<table width="100%" cellpadding="2" cellspacing="0" border="0">
<tr>
<td class="md">
<table cellpadding="0" cellspacing="0" border="0">
<tr>
<td class="md" nowrap valign="top"> bool ZE::ZMusic::IsLoaded </td>
<td class="md" valign="top">(&nbsp;</td>
<td class="mdname1" valign="top" nowrap>&nbsp; </td>
<td class="md" valign="top">)&nbsp;</td>
<td class="md" nowrap> const</td>
</tr>
</table>
</td>
</tr>
</table>
<table cellspacing=5 cellpadding=0 border=0>
<tr>
<td>
&nbsp;
</td>
<td>
<p>
Check if file is loaded and pointer to data is non-NULL. <dl compact><dt><b>Returns:</b></dt><dd>Loaded or Unloaded state of data. </dd></dl>
</td>
</tr>
</table>
<a name="a12" doxytag="ZE::ZMusic::IsPlaying"></a><p>
<table width="100%" cellpadding="2" cellspacing="0" border="0">
<tr>
<td class="md">
<table cellpadding="0" cellspacing="0" border="0">
<tr>
<td class="md" nowrap valign="top"> bool ZE::ZMusic::IsPlaying </td>
<td class="md" valign="top">(&nbsp;</td>
<td class="mdname1" valign="top" nowrap>&nbsp; </td>
<td class="md" valign="top">)&nbsp;</td>
<td class="md" nowrap> const</td>
</tr>
</table>
</td>
</tr>
</table>
<table cellspacing=5 cellpadding=0 border=0>
<tr>
<td>
&nbsp;
</td>
<td>
<p>
Check if music is playing, specifically if it is not stopped. (Paused state should be checked for by IsPaused) <dl compact><dt><b>Returns:</b></dt><dd>Playing / Not Playing State of Music. </dd></dl>
</td>
</tr>
</table>
<a name="a13" doxytag="ZE::ZMusic::IsPaused"></a><p>
<table width="100%" cellpadding="2" cellspacing="0" border="0">
<tr>
<td class="md">
<table cellpadding="0" cellspacing="0" border="0">
<tr>
<td class="md" nowrap valign="top"> bool ZE::ZMusic::IsPaused </td>
<td class="md" valign="top">(&nbsp;</td>
<td class="mdname1" valign="top" nowrap>&nbsp; </td>
<td class="md" valign="top">)&nbsp;</td>
<td class="md" nowrap> const</td>
</tr>
</table>
</td>
</tr>
</table>
<table cellspacing=5 cellpadding=0 border=0>
<tr>
<td>
&nbsp;
</td>
<td>
<p>
Check if music is "playing" but currently paused. <dl compact><dt><b>Returns:</b></dt><dd>Paused / Not Paused State of Music. </dd></dl>
</td>
</tr>
</table>
<a name="a14" doxytag="ZE::ZMusic::Volume"></a><p>
<table width="100%" cellpadding="2" cellspacing="0" border="0">
<tr>
<td class="md">
<table cellpadding="0" cellspacing="0" border="0">
<tr>
<td class="md" nowrap valign="top"> int ZE::ZMusic::Volume </td>
<td class="md" valign="top">(&nbsp;</td>
<td class="mdname1" valign="top" nowrap>&nbsp; </td>
<td class="md" valign="top">)&nbsp;</td>
<td class="md" nowrap> const</td>
</tr>
</table>
</td>
</tr>
</table>
<table cellspacing=5 cellpadding=0 border=0>
<tr>
<td>
&nbsp;
</td>
<td>
<p>
Get current volume of music represented as a value from 0-128. <dl compact><dt><b>Returns:</b></dt><dd>Volume of music, 0-128. </dd></dl>
</td>
</tr>
</table>
<hr>The documentation for this class was generated from the following file:<ul>
<li>/include/<a class="el" href="ZE__ZMusic_8h-source.html">ZE_ZMusic.h</a></ul>
<hr><address style="align: right;"><small>Generated on Sun Apr 27 14:53:40 2003 for ZEngine 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.3-rc2 </small></address>
</body>
</html>