diff options
Diffstat (limited to 'docs/doxygen/nel/a03413.html')
-rw-r--r-- | docs/doxygen/nel/a03413.html | 951 |
1 files changed, 951 insertions, 0 deletions
diff --git a/docs/doxygen/nel/a03413.html b/docs/doxygen/nel/a03413.html new file mode 100644 index 00000000..81625f1f --- /dev/null +++ b/docs/doxygen/nel/a03413.html @@ -0,0 +1,951 @@ +<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"> +<html><head><meta http-equiv="Content-Type" content="text/html;charset=iso-8859-1"> +<title>NeL: NLSOUND::CSoundAnimation class Reference</title> +<link href="doxygen.css" rel="stylesheet" type="text/css"> +</head><body> +<!-- Generated by Doxygen 1.3.6 --> +<div class="qindex"> <form class="search" action="search.php" method="get"> +<a class="qindex" href="main.html">Main Page</a> | <a class="qindex" href="namespaces.html">Namespace List</a> | <a class="qindex" href="hierarchy.html">Class Hierarchy</a> | <a class="qindex" href="classes.html">Alphabetical List</a> | <a class="qindex" href="annotated.html">Data Structures</a> | <a class="qindex" href="files.html">File List</a> | <a class="qindex" href="namespacemembers.html">Namespace Members</a> | <a class="qindex" href="functions.html">Data Fields</a> | <a class="qindex" href="globals.html">Globals</a> | <a class="qindex" href="pages.html">Related Pages</a> | <span class="search"><u>S</u>earch for <input class="search" type="text" name="query" value="" size="20" accesskey="s"/></span></form></div> +<h1>NLSOUND::CSoundAnimation Class Reference</h1><code>#include <<a class="el" href="a06413.html">sound_animation.h</a>></code> +<p> +<table border=0 cellpadding=0 cellspacing=0> +<tr><td></td></tr> +<tr><td colspan=2><br><h2>Public Types</h2></td></tr> +<tr><td class="memItemLeft" nowrap align=right valign=top>enum </td><td class="memItemRight" valign=bottom>{ <a class="el" href="a03413.html#NLSOUND_1_1CSoundAnimationw0NLSOUND_1_1CSoundAnimationw1">NoId</a> = -1 + }</td></tr> + +<tr><td colspan=2><br><h2>Public Member Functions</h2></td></tr> +<tr><td class="memItemLeft" nowrap align=right valign=top>virtual void </td><td class="memItemRight" valign=bottom><a class="el" href="a03413.html#NLSOUND_1_1CSoundAnimationa0">addMarker</a> (<a class="el" href="a03415.html">CSoundAnimMarker</a> *marker)</td></tr> + +<tr><td class="memItemLeft" nowrap align=right valign=top>virtual <a class="el" href="a04558.html#a11">uint32</a> </td><td class="memItemRight" valign=bottom><a class="el" href="a03413.html#NLSOUND_1_1CSoundAnimationa1">countMarkers</a> ()</td></tr> + +<tr><td class="memItemLeft" nowrap align=right valign=top> </td><td class="memItemRight" valign=bottom><a class="el" href="a03413.html#NLSOUND_1_1CSoundAnimationa2">CSoundAnimation</a> (std::string &name, <a class="el" href="a05381.html#a54">TSoundAnimId</a> <a class="el" href="a04223.html#a564">id</a>)</td></tr> + +<tr><td class="memItemLeft" nowrap align=right valign=top>virtual std::string & </td><td class="memItemRight" valign=bottom><a class="el" href="a03413.html#NLSOUND_1_1CSoundAnimationa3">getFilename</a> ()</td></tr> + +<tr><td class="memItemLeft" nowrap align=right valign=top>virtual <a class="el" href="a03415.html">CSoundAnimMarker</a> * </td><td class="memItemRight" valign=bottom><a class="el" href="a03413.html#NLSOUND_1_1CSoundAnimationa4">getMarker</a> (<a class="el" href="a04558.html#a11">uint32</a> i)</td></tr> + +<tr><td class="memItemLeft" nowrap align=right valign=top>virtual std::string & </td><td class="memItemRight" valign=bottom><a class="el" href="a03413.html#NLSOUND_1_1CSoundAnimationa5">getName</a> ()</td></tr> + +<tr><td class="memItemLeft" nowrap align=right valign=top>virtual bool </td><td class="memItemRight" valign=bottom><a class="el" href="a03413.html#NLSOUND_1_1CSoundAnimationa6">isDirty</a> ()</td></tr> + +<tr><td class="memItemLeft" nowrap align=right valign=top>virtual void </td><td class="memItemRight" valign=bottom><a class="el" href="a03413.html#NLSOUND_1_1CSoundAnimationa7">load</a> ()</td></tr> + +<tr><td class="memItemLeft" nowrap align=right valign=top>virtual void </td><td class="memItemRight" valign=bottom><a class="el" href="a03413.html#NLSOUND_1_1CSoundAnimationa8">play</a> (<a class="el" href="a02236.html">UAudioMixer</a> *mixer, float lastTime, float curTime, <a class="el" href="a02362.html">NL3D::CCluster</a> *cluster, <a class="el" href="a03417.html">CSoundContext</a> &context)</td></tr> + +<tr><td class="memItemLeft" nowrap align=right valign=top>virtual void </td><td class="memItemRight" valign=bottom><a class="el" href="a03413.html#NLSOUND_1_1CSoundAnimationa9">removeMarker</a> (<a class="el" href="a03415.html">CSoundAnimMarker</a> *marker)</td></tr> + +<tr><td class="memItemLeft" nowrap align=right valign=top>virtual void </td><td class="memItemRight" valign=bottom><a class="el" href="a03413.html#NLSOUND_1_1CSoundAnimationa10">save</a> ()</td></tr> + +<tr><td class="memItemLeft" nowrap align=right valign=top>virtual void </td><td class="memItemRight" valign=bottom><a class="el" href="a03413.html#NLSOUND_1_1CSoundAnimationa11">setDirty</a> (bool b)</td></tr> + +<tr><td class="memItemLeft" nowrap align=right valign=top>virtual void </td><td class="memItemRight" valign=bottom><a class="el" href="a03413.html#NLSOUND_1_1CSoundAnimationa12">setFilename</a> (std::string &name)</td></tr> + +<tr><td class="memItemLeft" nowrap align=right valign=top>virtual </td><td class="memItemRight" valign=bottom><a class="el" href="a03413.html#NLSOUND_1_1CSoundAnimationa13">~CSoundAnimation</a> ()</td></tr> + +<tr><td colspan=2><br><h2>Protected Member Functions</h2></td></tr> +<tr><td class="memItemLeft" nowrap align=right valign=top>virtual void </td><td class="memItemRight" valign=bottom><a class="el" href="a03413.html#NLSOUND_1_1CSoundAnimationb0">sort</a> ()</td></tr> + +<tr><td class="mdescLeft"> </td><td class="mdescRight">Sort all the markers according to their time. <a href="#NLSOUND_1_1CSoundAnimationb0"></a><br><br></td></tr> +<tr><td colspan=2><br><h2>Protected Attributes</h2></td></tr> +<tr><td class="memItemLeft" nowrap align=right valign=top>bool </td><td class="memItemRight" valign=bottom><a class="el" href="a03413.html#NLSOUND_1_1CSoundAnimationp0">_Dirty</a></td></tr> + +<tr><td class="memItemLeft" nowrap align=right valign=top>std::string </td><td class="memItemRight" valign=bottom><a class="el" href="a03413.html#NLSOUND_1_1CSoundAnimationp1">_Filename</a></td></tr> + +<tr><td class="memItemLeft" nowrap align=right valign=top><a class="el" href="a05381.html#a54">TSoundAnimId</a> </td><td class="memItemRight" valign=bottom><a class="el" href="a03413.html#NLSOUND_1_1CSoundAnimationp2">_Id</a></td></tr> + +<tr><td class="memItemLeft" nowrap align=right valign=top><a class="el" href="a05381.html#a60">TMarkerVector</a> </td><td class="memItemRight" valign=bottom><a class="el" href="a03413.html#NLSOUND_1_1CSoundAnimationp3">_Markers</a></td></tr> + +<tr><td class="memItemLeft" nowrap align=right valign=top>std::string </td><td class="memItemRight" valign=bottom><a class="el" href="a03413.html#NLSOUND_1_1CSoundAnimationp4">_Name</a></td></tr> + +</table> +<hr><h2>Member Enumeration Documentation</h2> +<a class="anchor" name="NLSOUND_1_1CSoundAnimationw0" doxytag="NLSOUND::CSoundAnimation::@138" ></a><p> +<table class="mdTable" width="100%" cellpadding="2" cellspacing="0"> + <tr> + <td class="mdRow"> + <table cellpadding="0" cellspacing="0" border="0"> + <tr> + <td class="md" nowrap valign="top"> anonymous enum + </table> + </td> + </tr> +</table> +<table cellspacing=5 cellpadding=0 border=0> + <tr> + <td> + + </td> + <td> + +<p> +<dl compact><dt><b>Enumeration values: </b></dt><dd> +<table border=0 cellspacing=2 cellpadding=0> +<tr><td valign=top><em><a class="anchor" name="NLSOUND_1_1CSoundAnimationw0NLSOUND_1_1CSoundAnimationw1" doxytag="NoId" ></a>NoId</em> </td><td> +</td></tr> +</table> +</dl> + +<p> +Definition at line <a class="el" href="a06413.html#l00049">49</a> of file <a class="el" href="a06413.html">sound_animation.h</a>. +<p> +<div class="fragment"><pre>00050 { +00051 <a class="code" href="a03413.html#NLSOUND_1_1CSoundAnimationw0NLSOUND_1_1CSoundAnimationw1">NoId</a> = -1 +00052 }; +</pre></div> </td> + </tr> +</table> +<hr><h2>Constructor & Destructor Documentation</h2> +<a class="anchor" name="NLSOUND_1_1CSoundAnimationa2" doxytag="NLSOUND::CSoundAnimation::CSoundAnimation" ></a><p> +<table class="mdTable" width="100%" cellpadding="2" cellspacing="0"> + <tr> + <td class="mdRow"> + <table cellpadding="0" cellspacing="0" border="0"> + <tr> + <td class="md" nowrap valign="top"> NLSOUND::CSoundAnimation::CSoundAnimation </td> + <td class="md" valign="top">( </td> + <td class="md" nowrap valign="top">std::string & </td> + <td class="mdname" nowrap> <em>name</em>, </td> + </tr> + <tr> + <td class="md" nowrap align="right"></td> + <td></td> + <td class="md" nowrap><a class="el" href="a05381.html#a54">TSoundAnimId</a> </td> + <td class="mdname" nowrap> <em>id</em></td> + </tr> + <tr> + <td></td> + <td class="md">) </td> + <td class="md" colspan="2"><code> [inline]</code></td> + </tr> + + </table> + </td> + </tr> +</table> +<table cellspacing=5 cellpadding=0 border=0> + <tr> + <td> + + </td> + <td> + +<p> + +<p> +Definition at line <a class="el" href="a06413.html#l00054">54</a> of file <a class="el" href="a06413.html">sound_animation.h</a>. +<p> +References <a class="el" href="a05646.html#l00221">id</a>, and <a class="el" href="a06409.html#l00058">NLSOUND::TSoundAnimId</a>. +<p> +<div class="fragment"><pre>00054 : <a class="code" href="a03413.html#NLSOUND_1_1CSoundAnimationp4">_Name</a>(name), <a class="code" href="a03413.html#NLSOUND_1_1CSoundAnimationp2">_Id</a>(<span class="keywordtype">id</span>), <a class="code" href="a03413.html#NLSOUND_1_1CSoundAnimationp0">_Dirty</a>(<span class="keyword">false</span>) {} +</pre></div> </td> + </tr> +</table> +<a class="anchor" name="NLSOUND_1_1CSoundAnimationa13" doxytag="NLSOUND::CSoundAnimation::~CSoundAnimation" ></a><p> +<table class="mdTable" width="100%" cellpadding="2" cellspacing="0"> + <tr> + <td class="mdRow"> + <table cellpadding="0" cellspacing="0" border="0"> + <tr> + <td class="md" nowrap valign="top"> virtual NLSOUND::CSoundAnimation::~<a class="el" href="a03413.html">CSoundAnimation</a> </td> + <td class="md" valign="top">( </td> + <td class="mdname1" valign="top" nowrap> </td> + <td class="md" valign="top"> ) </td> + <td class="md" nowrap><code> [inline, virtual]</code></td> + </tr> + + </table> + </td> + </tr> +</table> +<table cellspacing=5 cellpadding=0 border=0> + <tr> + <td> + + </td> + <td> + +<p> + +<p> +Definition at line <a class="el" href="a06413.html#l00056">56</a> of file <a class="el" href="a06413.html">sound_animation.h</a>. +<p> +<div class="fragment"><pre>00056 {} +</pre></div> </td> + </tr> +</table> +<hr><h2>Member Function Documentation</h2> +<a class="anchor" name="NLSOUND_1_1CSoundAnimationa0" doxytag="NLSOUND::CSoundAnimation::addMarker" ></a><p> +<table class="mdTable" width="100%" cellpadding="2" cellspacing="0"> + <tr> + <td class="mdRow"> + <table cellpadding="0" cellspacing="0" border="0"> + <tr> + <td class="md" nowrap valign="top"> void NLSOUND::CSoundAnimation::addMarker </td> + <td class="md" valign="top">( </td> + <td class="md" nowrap valign="top"><a class="el" href="a03415.html">CSoundAnimMarker</a> * </td> + <td class="mdname1" valign="top" nowrap> <em>marker</em> </td> + <td class="md" valign="top"> ) </td> + <td class="md" nowrap><code> [virtual]</code></td> + </tr> + + </table> + </td> + </tr> +</table> +<table cellspacing=5 cellpadding=0 border=0> + <tr> + <td> + + </td> + <td> + +<p> +Add a new marker +<p> +Definition at line <a class="el" href="a06412.html#l00043">43</a> of file <a class="el" href="a06412.html">sound_animation.cpp</a>. +<p> +References <a class="el" href="a06413.html#l00109">_Markers</a>, and <a class="el" href="a06412.html#l00074">sort()</a>. +<p> +Referenced by <a class="el" href="a06412.html#l00159">load()</a>. +<p> +<div class="fragment"><pre>00044 { +00045 <span class="keywordflow">if</span> (marker == NULL) +00046 <span class="keywordflow">return</span>; +00047 +00048 <a class="code" href="a03413.html#NLSOUND_1_1CSoundAnimationp0">_Dirty</a> = <span class="keyword">true</span>; +00049 <a class="code" href="a03413.html#NLSOUND_1_1CSoundAnimationp3">_Markers</a>.push_back(marker); +00050 <a class="code" href="a03413.html#NLSOUND_1_1CSoundAnimationb0">sort</a>(); +00051 } +</pre></div> </td> + </tr> +</table> +<a class="anchor" name="NLSOUND_1_1CSoundAnimationa1" doxytag="NLSOUND::CSoundAnimation::countMarkers" ></a><p> +<table class="mdTable" width="100%" cellpadding="2" cellspacing="0"> + <tr> + <td class="mdRow"> + <table cellpadding="0" cellspacing="0" border="0"> + <tr> + <td class="md" nowrap valign="top"> virtual <a class="el" href="a04558.html#a11">uint32</a> NLSOUND::CSoundAnimation::countMarkers </td> + <td class="md" valign="top">( </td> + <td class="mdname1" valign="top" nowrap> </td> + <td class="md" valign="top"> ) </td> + <td class="md" nowrap><code> [inline, virtual]</code></td> + </tr> + + </table> + </td> + </tr> +</table> +<table cellspacing=5 cellpadding=0 border=0> + <tr> + <td> + + </td> + <td> + +<p> +Return the number of markers in this track +<p> +Definition at line <a class="el" href="a06413.html#l00066">66</a> of file <a class="el" href="a06413.html">sound_animation.h</a>. +<p> +References <a class="el" href="a06413.html#l00109">_Markers</a>, and <a class="el" href="a05981.html#l00100">uint32</a>. +<p> +<div class="fragment"><pre>00066 { <span class="keywordflow">return</span> <a class="code" href="a03413.html#NLSOUND_1_1CSoundAnimationp3">_Markers</a>.size(); } +</pre></div> </td> + </tr> +</table> +<a class="anchor" name="NLSOUND_1_1CSoundAnimationa3" doxytag="NLSOUND::CSoundAnimation::getFilename" ></a><p> +<table class="mdTable" width="100%" cellpadding="2" cellspacing="0"> + <tr> + <td class="mdRow"> + <table cellpadding="0" cellspacing="0" border="0"> + <tr> + <td class="md" nowrap valign="top"> virtual std::string& NLSOUND::CSoundAnimation::getFilename </td> + <td class="md" valign="top">( </td> + <td class="mdname1" valign="top" nowrap> </td> + <td class="md" valign="top"> ) </td> + <td class="md" nowrap><code> [inline, virtual]</code></td> + </tr> + + </table> + </td> + </tr> +</table> +<table cellspacing=5 cellpadding=0 border=0> + <tr> + <td> + + </td> + <td> + +<p> +Return the filename of the animation +<p> +Definition at line <a class="el" href="a06413.html#l00082">82</a> of file <a class="el" href="a06413.html">sound_animation.h</a>. +<p> +<div class="fragment"><pre>00082 { <span class="keywordflow">return</span> <a class="code" href="a03413.html#NLSOUND_1_1CSoundAnimationp1">_Filename</a>; } +</pre></div> </td> + </tr> +</table> +<a class="anchor" name="NLSOUND_1_1CSoundAnimationa4" doxytag="NLSOUND::CSoundAnimation::getMarker" ></a><p> +<table class="mdTable" width="100%" cellpadding="2" cellspacing="0"> + <tr> + <td class="mdRow"> + <table cellpadding="0" cellspacing="0" border="0"> + <tr> + <td class="md" nowrap valign="top"> virtual <a class="el" href="a03415.html">CSoundAnimMarker</a>* NLSOUND::CSoundAnimation::getMarker </td> + <td class="md" valign="top">( </td> + <td class="md" nowrap valign="top"><a class="el" href="a04558.html#a11">uint32</a> </td> + <td class="mdname1" valign="top" nowrap> <em>i</em> </td> + <td class="md" valign="top"> ) </td> + <td class="md" nowrap><code> [inline, virtual]</code></td> + </tr> + + </table> + </td> + </tr> +</table> +<table cellspacing=5 cellpadding=0 border=0> + <tr> + <td> + + </td> + <td> + +<p> +Return a marker of this track given its index +<p> +Definition at line <a class="el" href="a06413.html#l00069">69</a> of file <a class="el" href="a06413.html">sound_animation.h</a>. +<p> +References <a class="el" href="a06413.html#l00109">_Markers</a>, and <a class="el" href="a05981.html#l00100">uint32</a>. +<p> +<div class="fragment"><pre>00069 { <span class="keywordflow">return</span> <a class="code" href="a03413.html#NLSOUND_1_1CSoundAnimationp3">_Markers</a>[i]; } +</pre></div> </td> + </tr> +</table> +<a class="anchor" name="NLSOUND_1_1CSoundAnimationa5" doxytag="NLSOUND::CSoundAnimation::getName" ></a><p> +<table class="mdTable" width="100%" cellpadding="2" cellspacing="0"> + <tr> + <td class="mdRow"> + <table cellpadding="0" cellspacing="0" border="0"> + <tr> + <td class="md" nowrap valign="top"> virtual std::string& NLSOUND::CSoundAnimation::getName </td> + <td class="md" valign="top">( </td> + <td class="md" nowrap valign="top">void </td> + <td class="mdname1" valign="top" nowrap> </td> + <td class="md" valign="top"> ) </td> + <td class="md" nowrap><code> [inline, virtual]</code></td> + </tr> + + </table> + </td> + </tr> +</table> +<table cellspacing=5 cellpadding=0 border=0> + <tr> + <td> + + </td> + <td> + +<p> +Return the name of the animation +<p> +Definition at line <a class="el" href="a06413.html#l00072">72</a> of file <a class="el" href="a06413.html">sound_animation.h</a>. +<p> +Referenced by <a class="el" href="a06408.html#l00120">NLSOUND::CSoundAnimManager::createAnimation()</a>. +<p> +<div class="fragment"><pre>00072 { <span class="keywordflow">return</span> <a class="code" href="a03413.html#NLSOUND_1_1CSoundAnimationp4">_Name</a>; } +</pre></div> </td> + </tr> +</table> +<a class="anchor" name="NLSOUND_1_1CSoundAnimationa6" doxytag="NLSOUND::CSoundAnimation::isDirty" ></a><p> +<table class="mdTable" width="100%" cellpadding="2" cellspacing="0"> + <tr> + <td class="mdRow"> + <table cellpadding="0" cellspacing="0" border="0"> + <tr> + <td class="md" nowrap valign="top"> virtual bool NLSOUND::CSoundAnimation::isDirty </td> + <td class="md" valign="top">( </td> + <td class="mdname1" valign="top" nowrap> </td> + <td class="md" valign="top"> ) </td> + <td class="md" nowrap><code> [inline, virtual]</code></td> + </tr> + + </table> + </td> + </tr> +</table> +<table cellspacing=5 cellpadding=0 border=0> + <tr> + <td> + + </td> + <td> + +<p> +Returns whether the sound animation changed since the last save. (Editing support) +<p> +Definition at line <a class="el" href="a06413.html#l00089">89</a> of file <a class="el" href="a06413.html">sound_animation.h</a>. +<p> +<div class="fragment"><pre>00089 { <span class="keywordflow">return</span> <a class="code" href="a03413.html#NLSOUND_1_1CSoundAnimationp0">_Dirty</a>; } +</pre></div> </td> + </tr> +</table> +<a class="anchor" name="NLSOUND_1_1CSoundAnimationa7" doxytag="NLSOUND::CSoundAnimation::load" ></a><p> +<table class="mdTable" width="100%" cellpadding="2" cellspacing="0"> + <tr> + <td class="mdRow"> + <table cellpadding="0" cellspacing="0" border="0"> + <tr> + <td class="md" nowrap valign="top"> void NLSOUND::CSoundAnimation::load </td> + <td class="md" valign="top">( </td> + <td class="mdname1" valign="top" nowrap> </td> + <td class="md" valign="top"> ) </td> + <td class="md" nowrap><code> [virtual]</code></td> + </tr> + + </table> + </td> + </tr> +</table> +<table cellspacing=5 cellpadding=0 border=0> + <tr> + <td> + + </td> + <td> + +<p> +Load from an xml file +<p> +Definition at line <a class="el" href="a06412.html#l00159">159</a> of file <a class="el" href="a06412.html">sound_animation.cpp</a>. +<p> +References <a class="el" href="a06412.html#l00043">addMarker()</a>, <a class="el" href="a06410.html#l00065">NLSOUND::CSoundAnimMarker::addSound()</a>, <a class="el" href="a05538.html#l02654">file</a>, and <a class="el" href="a06411.html#l00056">NLSOUND::CSoundAnimMarker::setTime()</a>. +<p> +Referenced by <a class="el" href="a06408.html#l00078">NLSOUND::CSoundAnimManager::loadAnimation()</a>. +<p> +<div class="fragment"><pre>00160 { +00161 NL_ALLOC_CONTEXT(NLSOUND_CSoundAnimation); +00162 <a class="code" href="a02653.html">CIFile</a> <a class="code" href="a04115.html#a95">file</a>; +00163 +00164 <span class="comment">// Open the file</span> +00165 <span class="keywordflow">if</span> (!<a class="code" href="a04115.html#a95">file</a>.open(<a class="code" href="a03413.html#NLSOUND_1_1CSoundAnimationp1">_Filename</a>.c_str())) +00166 { +00167 <span class="keywordflow">throw</span> exception(<span class="stringliteral">"Can't open the file for reading"</span>); +00168 } +00169 +00170 <span class="comment">// Create the XML stream</span> +00171 CIXml input; +00172 +00173 <span class="comment">// Init</span> +00174 <span class="keywordflow">if</span> (input.init (file)) +00175 { +00176 xmlNodePtr animNode = input.getRootNode (); +00177 xmlNodePtr markerNode = input.getFirstChildNode(animNode, <span class="stringliteral">"MARKER"</span>); +00178 +00179 <span class="keywordflow">while</span> (markerNode != 0) +00180 { +00181 CSoundAnimMarker* marker = <span class="keyword">new</span> CSoundAnimMarker(); +00182 +00183 <span class="keyword">const</span> <span class="keywordtype">char</span> *time = (<span class="keyword">const</span> <span class="keywordtype">char</span>*) xmlGetProp(markerNode, (xmlChar*) <span class="stringliteral">"time"</span>); +00184 <span class="keywordflow">if</span> (time == 0) +00185 { +00186 <span class="keywordflow">throw</span> exception(<span class="stringliteral">"Invalid sound animation marker"</span>); +00187 } +00188 +00189 marker->setTime((<span class="keywordtype">float</span>) atof(time)); +00190 xmlFree ((<span class="keywordtype">void</span>*)time); +00191 +00192 +00193 xmlNodePtr soundNode = input.getFirstChildNode(markerNode, <span class="stringliteral">"SOUND"</span>); +00194 +00195 <span class="keywordflow">while</span> (soundNode != 0) +00196 { +00197 <span class="keywordtype">char</span> *name = (<span class="keywordtype">char</span>*) xmlGetProp(soundNode, (xmlChar*) <span class="stringliteral">"name"</span>); +00198 <span class="keywordflow">if</span> (name == 0) +00199 { +00200 <span class="keywordflow">throw</span> exception(<span class="stringliteral">"Invalid sound animation marker"</span>); +00201 } +00202 +00203 marker->addSound(CStringMapper::map(string(name))); +00204 +00205 xmlFree ((<span class="keywordtype">void</span>*)name); +00206 +00207 soundNode = input.getNextChildNode(soundNode, <span class="stringliteral">"SOUND"</span>); +00208 } +00209 +00210 <a class="code" href="a03413.html#NLSOUND_1_1CSoundAnimationa0">addMarker</a>(marker); +00211 +00212 markerNode = input.getNextChildNode(markerNode, <span class="stringliteral">"MARKER"</span>); +00213 } +00214 } +00215 +00216 <span class="comment">// Close the file</span> +00217 <a class="code" href="a04115.html#a95">file</a>.close (); +00218 <a class="code" href="a03413.html#NLSOUND_1_1CSoundAnimationp0">_Dirty</a> = <span class="keyword">false</span>; +00219 } +</pre></div> </td> + </tr> +</table> +<a class="anchor" name="NLSOUND_1_1CSoundAnimationa8" doxytag="NLSOUND::CSoundAnimation::play" ></a><p> +<table class="mdTable" width="100%" cellpadding="2" cellspacing="0"> + <tr> + <td class="mdRow"> + <table cellpadding="0" cellspacing="0" border="0"> + <tr> + <td class="md" nowrap valign="top"> void NLSOUND::CSoundAnimation::play </td> + <td class="md" valign="top">( </td> + <td class="md" nowrap valign="top"><a class="el" href="a02236.html">UAudioMixer</a> * </td> + <td class="mdname" nowrap> <em>mixer</em>, </td> + </tr> + <tr> + <td class="md" nowrap align="right"></td> + <td></td> + <td class="md" nowrap>float </td> + <td class="mdname" nowrap> <em>lastTime</em>, </td> + </tr> + <tr> + <td class="md" nowrap align="right"></td> + <td></td> + <td class="md" nowrap>float </td> + <td class="mdname" nowrap> <em>curTime</em>, </td> + </tr> + <tr> + <td class="md" nowrap align="right"></td> + <td></td> + <td class="md" nowrap><a class="el" href="a02362.html">NL3D::CCluster</a> * </td> + <td class="mdname" nowrap> <em>cluster</em>, </td> + </tr> + <tr> + <td class="md" nowrap align="right"></td> + <td></td> + <td class="md" nowrap><a class="el" href="a03417.html">CSoundContext</a> & </td> + <td class="mdname" nowrap> <em>context</em></td> + </tr> + <tr> + <td></td> + <td class="md">) </td> + <td class="md" colspan="2"><code> [virtual]</code></td> + </tr> + + </table> + </td> + </tr> +</table> +<table cellspacing=5 cellpadding=0 border=0> + <tr> + <td> + + </td> + <td> + +<p> +Play the sounds of the markers that fall within the specified time interval. +<p> +Definition at line <a class="el" href="a06412.html#l00142">142</a> of file <a class="el" href="a06412.html">sound_animation.cpp</a>. +<p> +References <a class="el" href="a06413.html#l00109">_Markers</a>, <a class="el" href="a06411.html#l00059">NLSOUND::CSoundAnimMarker::getTime()</a>, <a class="el" href="a05622.html#l00290">nlassert</a>, and <a class="el" href="a06410.html#l00047">NLSOUND::CSoundAnimMarker::play()</a>. +<p> +Referenced by <a class="el" href="a06408.html#l00218">NLSOUND::CSoundAnimManager::playAnimation()</a>. +<p> +<div class="fragment"><pre>00143 { +00144 vector<CSoundAnimMarker*>::iterator iter; +00145 <span class="keywordflow">for</span> (iter = <a class="code" href="a03413.html#NLSOUND_1_1CSoundAnimationp3">_Markers</a>.begin(); iter != <a class="code" href="a03413.html#NLSOUND_1_1CSoundAnimationp3">_Markers</a>.end(); iter++) +00146 { +00147 CSoundAnimMarker* marker = *iter; +00148 <a class="code" href="a04199.html#a6">nlassert</a>(marker); +00149 +00150 <span class="keywordflow">if</span> ((lastTime <= marker->getTime()) && (marker->getTime() < curTime)) +00151 { +00152 marker->play(mixer, cluster, context); +00153 } +00154 } +00155 } +</pre></div> </td> + </tr> +</table> +<a class="anchor" name="NLSOUND_1_1CSoundAnimationa9" doxytag="NLSOUND::CSoundAnimation::removeMarker" ></a><p> +<table class="mdTable" width="100%" cellpadding="2" cellspacing="0"> + <tr> + <td class="mdRow"> + <table cellpadding="0" cellspacing="0" border="0"> + <tr> + <td class="md" nowrap valign="top"> void NLSOUND::CSoundAnimation::removeMarker </td> + <td class="md" valign="top">( </td> + <td class="md" nowrap valign="top"><a class="el" href="a03415.html">CSoundAnimMarker</a> * </td> + <td class="mdname1" valign="top" nowrap> <em>marker</em> </td> + <td class="md" valign="top"> ) </td> + <td class="md" nowrap><code> [virtual]</code></td> + </tr> + + </table> + </td> + </tr> +</table> +<table cellspacing=5 cellpadding=0 border=0> + <tr> + <td> + + </td> + <td> + +<p> +Remove a marker +<p> +Definition at line <a class="el" href="a06412.html#l00055">55</a> of file <a class="el" href="a06412.html">sound_animation.cpp</a>. +<p> +References <a class="el" href="a06413.html#l00109">_Markers</a>. +<p> +<div class="fragment"><pre>00056 { +00057 <span class="keywordflow">if</span> (marker == NULL) +00058 <span class="keywordflow">return</span>; +00059 +00060 <a class="code" href="a03413.html#NLSOUND_1_1CSoundAnimationp0">_Dirty</a> = <span class="keyword">true</span>; +00061 vector<CSoundAnimMarker*>::iterator iter; +00062 <span class="keywordflow">for</span> (iter = <a class="code" href="a03413.html#NLSOUND_1_1CSoundAnimationp3">_Markers</a>.begin(); iter != <a class="code" href="a03413.html#NLSOUND_1_1CSoundAnimationp3">_Markers</a>.end(); iter++) +00063 { +00064 <span class="keywordflow">if</span> (*iter == marker) +00065 { +00066 <a class="code" href="a03413.html#NLSOUND_1_1CSoundAnimationp3">_Markers</a>.erase(iter); +00067 <span class="keywordflow">break</span>; +00068 } +00069 } +00070 } +</pre></div> </td> + </tr> +</table> +<a class="anchor" name="NLSOUND_1_1CSoundAnimationa10" doxytag="NLSOUND::CSoundAnimation::save" ></a><p> +<table class="mdTable" width="100%" cellpadding="2" cellspacing="0"> + <tr> + <td class="mdRow"> + <table cellpadding="0" cellspacing="0" border="0"> + <tr> + <td class="md" nowrap valign="top"> void NLSOUND::CSoundAnimation::save </td> + <td class="md" valign="top">( </td> + <td class="mdname1" valign="top" nowrap> </td> + <td class="md" valign="top"> ) </td> + <td class="md" nowrap><code> [virtual]</code></td> + </tr> + + </table> + </td> + </tr> +</table> +<table cellspacing=5 cellpadding=0 border=0> + <tr> + <td> + + </td> + <td> + +<p> +Save to an xml document +<p> +Definition at line <a class="el" href="a06412.html#l00081">81</a> of file <a class="el" href="a06412.html">sound_animation.cpp</a>. +<p> +References <a class="el" href="a06413.html#l00109">_Markers</a>, <a class="el" href="a05538.html#l02654">file</a>, <a class="el" href="a06107.html#l00620">NLMISC::COXml::flush()</a>, <a class="el" href="a06107.html#l00673">NLMISC::COXml::getDocument()</a>, <a class="el" href="a06410.html#l00092">NLSOUND::CSoundAnimMarker::getSounds()</a>, <a class="el" href="a06411.html#l00059">NLSOUND::CSoundAnimMarker::getTime()</a>, <a class="el" href="a06107.html#l00111">NLMISC::COXml::init()</a>, <a class="el" href="a05646.html#l00977">s</a>, and <a class="el" href="a05586.html#l00161">NLMISC::smprintf()</a>. +<p> +Referenced by <a class="el" href="a06408.html#l00161">NLSOUND::CSoundAnimManager::saveAnimation()</a>. +<p> +<div class="fragment"><pre>00082 { +00083 <span class="comment">// File stream</span> +00084 <a class="code" href="a03011.html">COFile</a> <a class="code" href="a04115.html#a95">file</a>; +00085 vector<NLMISC::TStringId> sounds; +00086 +00087 <span class="comment">// Open the file</span> +00088 <span class="keywordflow">if</span> (!<a class="code" href="a04115.html#a95">file</a>.open(<a class="code" href="a03413.html#NLSOUND_1_1CSoundAnimationp1">_Filename</a>.c_str())) +00089 { +00090 <span class="keywordflow">throw</span> exception(<span class="stringliteral">"Can't open the file for writing"</span>); +00091 } +00092 +00093 <span class="comment">// Create the XML stream</span> +00094 <a class="code" href="a03032.html">COXml</a> output; +00095 +00096 <span class="comment">// Init</span> +00097 <span class="keywordflow">if</span> (output.<a class="code" href="a03032.html#NLMISC_1_1COXmla4">init</a> (&file, <span class="stringliteral">"1.0"</span>)) +00098 { +00099 xmlDocPtr xmlDoc = output.<a class="code" href="a03032.html#NLMISC_1_1COXmla2">getDocument</a>(); +00100 +00101 <span class="comment">// Create the first node</span> +00102 xmlNodePtr root = xmlNewDocNode (xmlDoc, NULL, (<span class="keyword">const</span> xmlChar*)<span class="stringliteral">"SOUNDANIMATION"</span>, NULL); +00103 xmlDocSetRootElement (xmlDoc, root); +00104 +00105 vector<CSoundAnimMarker*>::iterator iter; +00106 <span class="keywordflow">for</span> (iter = <a class="code" href="a03413.html#NLSOUND_1_1CSoundAnimationp3">_Markers</a>.begin(); iter != <a class="code" href="a03413.html#NLSOUND_1_1CSoundAnimationp3">_Markers</a>.end(); iter++) +00107 { +00108 CSoundAnimMarker* marker = (*iter); +00109 +00110 set<string>::iterator iter; +00111 +00112 <span class="keywordtype">char</span> <a class="code" href="a04223.html#a626">s</a>[64]; +00113 <a class="code" href="a05378.html#a259">smprintf</a>(s, 64, <span class="stringliteral">"%f"</span>, marker->getTime()); +00114 +00115 xmlNodePtr markerNode = xmlNewChild (root, NULL, (<span class="keyword">const</span> xmlChar*)<span class="stringliteral">"MARKER"</span>, NULL); +00116 xmlSetProp (markerNode, (<span class="keyword">const</span> xmlChar*) <span class="stringliteral">"time"</span>, (<span class="keyword">const</span> xmlChar*) s); +00117 +00118 marker->getSounds(sounds); +00119 +00120 vector<NLMISC::TStringId>::iterator iter2; +00121 <span class="keywordflow">for</span> (iter2 = sounds.begin(); iter2 != sounds.end(); iter2++) +00122 { +00123 xmlNodePtr soundNode = xmlNewChild ( markerNode, NULL, (<span class="keyword">const</span> xmlChar*)<span class="stringliteral">"SOUND"</span>, NULL ); +00124 xmlSetProp (soundNode, (<span class="keyword">const</span> xmlChar*)<span class="stringliteral">"name"</span>, (<span class="keyword">const</span> xmlChar*) CStringMapper::unmap(*iter2).c_str()); +00125 } +00126 +00127 sounds.clear(); +00128 } +00129 +00130 <span class="comment">// Flush the stream, write all the output file</span> +00131 output.<a class="code" href="a03032.html#NLMISC_1_1COXmla1">flush</a> (); +00132 } +00133 +00134 <span class="comment">// Close the file</span> +00135 <a class="code" href="a04115.html#a95">file</a>.close (); +00136 +00137 <a class="code" href="a03413.html#NLSOUND_1_1CSoundAnimationp0">_Dirty</a> = <span class="keyword">false</span>; +00138 } +</pre></div> </td> + </tr> +</table> +<a class="anchor" name="NLSOUND_1_1CSoundAnimationa11" doxytag="NLSOUND::CSoundAnimation::setDirty" ></a><p> +<table class="mdTable" width="100%" cellpadding="2" cellspacing="0"> + <tr> + <td class="mdRow"> + <table cellpadding="0" cellspacing="0" border="0"> + <tr> + <td class="md" nowrap valign="top"> virtual void NLSOUND::CSoundAnimation::setDirty </td> + <td class="md" valign="top">( </td> + <td class="md" nowrap valign="top">bool </td> + <td class="mdname1" valign="top" nowrap> <em>b</em> </td> + <td class="md" valign="top"> ) </td> + <td class="md" nowrap><code> [inline, virtual]</code></td> + </tr> + + </table> + </td> + </tr> +</table> +<table cellspacing=5 cellpadding=0 border=0> + <tr> + <td> + + </td> + <td> + +<p> +Set the dirty flag (Editing support) +<p> +Definition at line <a class="el" href="a06413.html#l00092">92</a> of file <a class="el" href="a06413.html">sound_animation.h</a>. +<p> +<div class="fragment"><pre>00092 { <a class="code" href="a03413.html#NLSOUND_1_1CSoundAnimationp0">_Dirty</a> = b; } +</pre></div> </td> + </tr> +</table> +<a class="anchor" name="NLSOUND_1_1CSoundAnimationa12" doxytag="NLSOUND::CSoundAnimation::setFilename" ></a><p> +<table class="mdTable" width="100%" cellpadding="2" cellspacing="0"> + <tr> + <td class="mdRow"> + <table cellpadding="0" cellspacing="0" border="0"> + <tr> + <td class="md" nowrap valign="top"> virtual void NLSOUND::CSoundAnimation::setFilename </td> + <td class="md" valign="top">( </td> + <td class="md" nowrap valign="top">std::string & </td> + <td class="mdname1" valign="top" nowrap> <em>name</em> </td> + <td class="md" valign="top"> ) </td> + <td class="md" nowrap><code> [inline, virtual]</code></td> + </tr> + + </table> + </td> + </tr> +</table> +<table cellspacing=5 cellpadding=0 border=0> + <tr> + <td> + + </td> + <td> + +<p> +Set the filename of the animation +<p> +Definition at line <a class="el" href="a06413.html#l00086">86</a> of file <a class="el" href="a06413.html">sound_animation.h</a>. +<p> +Referenced by <a class="el" href="a06408.html#l00078">NLSOUND::CSoundAnimManager::loadAnimation()</a>, and <a class="el" href="a06408.html#l00161">NLSOUND::CSoundAnimManager::saveAnimation()</a>. +<p> +<div class="fragment"><pre>00086 { <a class="code" href="a03413.html#NLSOUND_1_1CSoundAnimationp1">_Filename</a> = name; } +</pre></div> </td> + </tr> +</table> +<a class="anchor" name="NLSOUND_1_1CSoundAnimationb0" doxytag="NLSOUND::CSoundAnimation::sort" ></a><p> +<table class="mdTable" width="100%" cellpadding="2" cellspacing="0"> + <tr> + <td class="mdRow"> + <table cellpadding="0" cellspacing="0" border="0"> + <tr> + <td class="md" nowrap valign="top"> void NLSOUND::CSoundAnimation::sort </td> + <td class="md" valign="top">( </td> + <td class="mdname1" valign="top" nowrap> </td> + <td class="md" valign="top"> ) </td> + <td class="md" nowrap><code> [protected, virtual]</code></td> + </tr> + + </table> + </td> + </tr> +</table> +<table cellspacing=5 cellpadding=0 border=0> + <tr> + <td> + + </td> + <td> + +<p> +Sort all the markers according to their time. +<p> + +<p> +Definition at line <a class="el" href="a06412.html#l00074">74</a> of file <a class="el" href="a06412.html">sound_animation.cpp</a>. +<p> +Referenced by <a class="el" href="a06412.html#l00043">addMarker()</a>. +<p> +<div class="fragment"><pre>00075 { +00076 <span class="comment">//std::sort<CSoundAnimMarker*, eqmarker>(_Markers.begin(), _Markers.end(), eqmarker());</span> +00077 } +</pre></div> </td> + </tr> +</table> +<hr><h2>Field Documentation</h2> +<a class="anchor" name="NLSOUND_1_1CSoundAnimationp0" doxytag="NLSOUND::CSoundAnimation::_Dirty" ></a><p> +<table class="mdTable" width="100%" cellpadding="2" cellspacing="0"> + <tr> + <td class="mdRow"> + <table cellpadding="0" cellspacing="0" border="0"> + <tr> + <td class="md" nowrap valign="top"> bool <a class="el" href="a03413.html#NLSOUND_1_1CSoundAnimationp0">NLSOUND::CSoundAnimation::_Dirty</a><code> [protected]</code> + </table> + </td> + </tr> +</table> +<table cellspacing=5 cellpadding=0 border=0> + <tr> + <td> + + </td> + <td> + +<p> +Has the sound animation changed since the last save? (Editing support) +<p> +Definition at line <a class="el" href="a06413.html#l00115">115</a> of file <a class="el" href="a06413.html">sound_animation.h</a>. </td> + </tr> +</table> +<a class="anchor" name="NLSOUND_1_1CSoundAnimationp1" doxytag="NLSOUND::CSoundAnimation::_Filename" ></a><p> +<table class="mdTable" width="100%" cellpadding="2" cellspacing="0"> + <tr> + <td class="mdRow"> + <table cellpadding="0" cellspacing="0" border="0"> + <tr> + <td class="md" nowrap valign="top"> std::string <a class="el" href="a03413.html#NLSOUND_1_1CSoundAnimationp1">NLSOUND::CSoundAnimation::_Filename</a><code> [protected]</code> + </table> + </td> + </tr> +</table> +<table cellspacing=5 cellpadding=0 border=0> + <tr> + <td> + + </td> + <td> + +<p> +The filename +<p> +Definition at line <a class="el" href="a06413.html#l00112">112</a> of file <a class="el" href="a06413.html">sound_animation.h</a>. </td> + </tr> +</table> +<a class="anchor" name="NLSOUND_1_1CSoundAnimationp2" doxytag="NLSOUND::CSoundAnimation::_Id" ></a><p> +<table class="mdTable" width="100%" cellpadding="2" cellspacing="0"> + <tr> + <td class="mdRow"> + <table cellpadding="0" cellspacing="0" border="0"> + <tr> + <td class="md" nowrap valign="top"> <a class="el" href="a05381.html#a54">TSoundAnimId</a> <a class="el" href="a03413.html#NLSOUND_1_1CSoundAnimationp2">NLSOUND::CSoundAnimation::_Id</a><code> [protected]</code> + </table> + </td> + </tr> +</table> +<table cellspacing=5 cellpadding=0 border=0> + <tr> + <td> + + </td> + <td> + +<p> +The unique ID of the animation +<p> +Definition at line <a class="el" href="a06413.html#l00103">103</a> of file <a class="el" href="a06413.html">sound_animation.h</a>. </td> + </tr> +</table> +<a class="anchor" name="NLSOUND_1_1CSoundAnimationp3" doxytag="NLSOUND::CSoundAnimation::_Markers" ></a><p> +<table class="mdTable" width="100%" cellpadding="2" cellspacing="0"> + <tr> + <td class="mdRow"> + <table cellpadding="0" cellspacing="0" border="0"> + <tr> + <td class="md" nowrap valign="top"> <a class="el" href="a05381.html#a60">TMarkerVector</a> <a class="el" href="a03413.html#NLSOUND_1_1CSoundAnimationp3">NLSOUND::CSoundAnimation::_Markers</a><code> [protected]</code> + </table> + </td> + </tr> +</table> +<table cellspacing=5 cellpadding=0 border=0> + <tr> + <td> + + </td> + <td> + +<p> +The set of markers +<p> +Definition at line <a class="el" href="a06413.html#l00109">109</a> of file <a class="el" href="a06413.html">sound_animation.h</a>. +<p> +Referenced by <a class="el" href="a06412.html#l00043">addMarker()</a>, <a class="el" href="a06413.html#l00066">countMarkers()</a>, <a class="el" href="a06413.html#l00069">getMarker()</a>, <a class="el" href="a06412.html#l00142">play()</a>, <a class="el" href="a06412.html#l00055">removeMarker()</a>, and <a class="el" href="a06412.html#l00081">save()</a>. </td> + </tr> +</table> +<a class="anchor" name="NLSOUND_1_1CSoundAnimationp4" doxytag="NLSOUND::CSoundAnimation::_Name" ></a><p> +<table class="mdTable" width="100%" cellpadding="2" cellspacing="0"> + <tr> + <td class="mdRow"> + <table cellpadding="0" cellspacing="0" border="0"> + <tr> + <td class="md" nowrap valign="top"> std::string <a class="el" href="a03413.html#NLSOUND_1_1CSoundAnimationp4">NLSOUND::CSoundAnimation::_Name</a><code> [protected]</code> + </table> + </td> + </tr> +</table> +<table cellspacing=5 cellpadding=0 border=0> + <tr> + <td> + + </td> + <td> + +<p> +The name of the animation +<p> +Definition at line <a class="el" href="a06413.html#l00106">106</a> of file <a class="el" href="a06413.html">sound_animation.h</a>. </td> + </tr> +</table> +<hr>The documentation for this class was generated from the following files:<ul> +<li><a class="el" href="a06413.html">sound_animation.h</a><li><a class="el" href="a06412.html">sound_animation.cpp</a></ul> +<hr size="1"><address style="align: right;"><small>Generated on Tue Mar 16 14:42:31 2004 for NeL by +<a href="http://www.doxygen.org/index.html"> +<img src="doxygen.png" alt="doxygen" align="middle" border=0 > +</a>1.3.6 </small></address> +</body> +</html> |