aboutsummaryrefslogtreecommitdiff
path: root/docs/doxygen/nel/a02248.html
diff options
context:
space:
mode:
authorneodarz <neodarz@neodarz.net>2018-08-11 20:21:34 +0200
committerneodarz <neodarz@neodarz.net>2018-08-11 20:21:34 +0200
commit0ea5fc66924303d1bf73ba283a383e2aadee02f2 (patch)
tree2568e71a7ccc44ec23b8bb3f0ff97fb6bf2ed709 /docs/doxygen/nel/a02248.html
downloadnevrax-website-self-hostable-0ea5fc66924303d1bf73ba283a383e2aadee02f2.tar.xz
nevrax-website-self-hostable-0ea5fc66924303d1bf73ba283a383e2aadee02f2.zip
Initial commit
Diffstat (limited to 'docs/doxygen/nel/a02248.html')
-rw-r--r--docs/doxygen/nel/a02248.html2896
1 files changed, 2896 insertions, 0 deletions
diff --git a/docs/doxygen/nel/a02248.html b/docs/doxygen/nel/a02248.html
new file mode 100644
index 00000000..397f2558
--- /dev/null
+++ b/docs/doxygen/nel/a02248.html
@@ -0,0 +1,2896 @@
+<!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::CBackgroundSoundManager 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&nbsp;Page</a> | <a class="qindex" href="namespaces.html">Namespace List</a> | <a class="qindex" href="hierarchy.html">Class&nbsp;Hierarchy</a> | <a class="qindex" href="classes.html">Alphabetical&nbsp;List</a> | <a class="qindex" href="annotated.html">Data&nbsp;Structures</a> | <a class="qindex" href="files.html">File&nbsp;List</a> | <a class="qindex" href="namespacemembers.html">Namespace&nbsp;Members</a> | <a class="qindex" href="functions.html">Data&nbsp;Fields</a> | <a class="qindex" href="globals.html">Globals</a> | <a class="qindex" href="pages.html">Related&nbsp;Pages</a> | <span class="search"><u>S</u>earch&nbsp;for&nbsp;<input class="search" type="text" name="query" value="" size="20" accesskey="s"/></span></form></div>
+<h1>NLSOUND::CBackgroundSoundManager Class Reference</h1><code>#include &lt;<a class="el" href="a05472.html">background_sound_manager.h</a>&gt;</code>
+<p>
+<p>Inheritance diagram for NLSOUND::CBackgroundSoundManager:
+<p><center><img src="a02248.png" usemap="#NLSOUND::CBackgroundSoundManager_map" border="0" alt=""></center>
+<map name="NLSOUND::CBackgroundSoundManager_map">
+<area href="a02239.html" alt="NLSOUND::CAudioMixerUser::IMixerUpdate" shape="rect" coords="0,0,258,24">
+</map>
+<hr><a name="_details"></a><h2>Detailed Description</h2>
+This manager handle the background sound :<ul>
+<li>primitive positioned sound (point, path and patatoid supported)</li><li>primitive positioned effect (patatoid only)</li><li>primitive positioned sample bank (patatoid only)</li><li>A set of 32 application definable flag that can be used in background sound to filter the sub sounds of a background sound. Each filter can be assigned at run time a fade in and fade out delay that is used when sound are muted/unmuted according to filter status.</li></ul>
+<p>
+Sounds can be put in three separate layer (named a, b and c). In each layer, sounds patatoid are concurent and the smaller in surface muffle the other sounds.<p>
+Effets are managed according to the EAX capacity of the driver.<p>
+Sample bank patatoid are used to dynamicaly load/unload the sample banks will the player walk the univers.<p>
+<dl compact><dt><b>Author:</b></dt><dd>Boris Boucher <p>
+Nevrax France </dd></dl>
+<dl compact><dt><b>Date:</b></dt><dd>2002 </dd></dl>
+
+<p>
+
+<p>
+Definition at line <a class="el" href="a05472.html#l00079">79</a> of file <a class="el" href="a05472.html">background_sound_manager.h</a>.<table border=0 cellpadding=0 cellspacing=0>
+<tr><td></td></tr>
+<tr><td colspan=2><br><h2>Public Member Functions</h2></td></tr>
+<tr><td class="memItemLeft" nowrap align=right valign=top>const <a class="el" href="a03920.html">UAudioMixer::TBackgroundFilterFades</a> &amp;&nbsp;</td><td class="memItemRight" valign=bottom><a class="el" href="a02248.html#NLSOUND_1_1CBackgroundSoundManagera0">getBackgroundFilterFades</a> ()</td></tr>
+
+<tr><td class="memItemLeft" nowrap align=right valign=top>const <a class="el" href="a03921.html">UAudioMixer::TBackgroundFlags</a> &amp;&nbsp;</td><td class="memItemRight" valign=bottom><a class="el" href="a02248.html#NLSOUND_1_1CBackgroundSoundManagera1">getBackgroundFlags</a> ()</td></tr>
+
+<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Get the background flags. <a href="#NLSOUND_1_1CBackgroundSoundManagera1"></a><br><br></td></tr>
+<tr><td class="memItemLeft" nowrap align=right valign=top>const float *&nbsp;</td><td class="memItemRight" valign=bottom><a class="el" href="a02248.html#NLSOUND_1_1CBackgroundSoundManagera2">getFilterValues</a> ()</td></tr>
+
+<tr><td class="memItemLeft" nowrap align=right valign=top>const std::vector&lt; <a class="el" href="a03128.html">NLMISC::CVector</a> &gt; &amp;&nbsp;</td><td class="memItemRight" valign=bottom><a class="el" href="a02248.html#NLSOUND_1_1CBackgroundSoundManagera3">getZone</a> (<a class="el" href="a04558.html#a11">uint32</a> zone, bool *isPath=0)</td></tr>
+
+<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Return a patatoid. If isPath is not null, set it. <a href="#NLSOUND_1_1CBackgroundSoundManagera3"></a><br><br></td></tr>
+<tr><td class="memItemLeft" nowrap align=right valign=top><a class="el" href="a03128.html">NLMISC::CVector</a>&nbsp;</td><td class="memItemRight" valign=bottom><a class="el" href="a02248.html#NLSOUND_1_1CBackgroundSoundManagera4">getZoneSourcePos</a> (<a class="el" href="a04558.html#a11">uint32</a> zone)</td></tr>
+
+<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Return the position of the 3d source for a zone. <a href="#NLSOUND_1_1CBackgroundSoundManagera4"></a><br><br></td></tr>
+<tr><td class="memItemLeft" nowrap align=right valign=top>void&nbsp;</td><td class="memItemRight" valign=bottom><a class="el" href="a02248.html#NLSOUND_1_1CBackgroundSoundManagera5">load</a> (const std::string &amp;continent, <a class="el" href="a02756.html">NLLIGO::CLigoConfig</a> &amp;config)</td></tr>
+
+<tr><td class="memItemLeft" nowrap align=right valign=top>void&nbsp;</td><td class="memItemRight" valign=bottom><a class="el" href="a02248.html#NLSOUND_1_1CBackgroundSoundManagera6">loadAudioFromPrimitives</a> (const <a class="el" href="a03123.html">NLLIGO::IPrimitive</a> &amp;audioRoot)</td></tr>
+
+<tr><td class="memItemLeft" nowrap align=right valign=top>void&nbsp;</td><td class="memItemRight" valign=bottom><a class="el" href="a02248.html#NLSOUND_1_1CBackgroundSoundManagera7">loadEffecsFromRegion</a> (const <a class="el" href="a03126.html">NLLIGO::CPrimRegion</a> &amp;region)</td></tr>
+
+<tr><td class="memItemLeft" nowrap align=right valign=top>void&nbsp;</td><td class="memItemRight" valign=bottom><a class="el" href="a02248.html#NLSOUND_1_1CBackgroundSoundManagera8">loadSamplesFromRegion</a> (const <a class="el" href="a03126.html">NLLIGO::CPrimRegion</a> &amp;region)</td></tr>
+
+<tr><td class="memItemLeft" nowrap align=right valign=top>void&nbsp;</td><td class="memItemRight" valign=bottom><a class="el" href="a02248.html#NLSOUND_1_1CBackgroundSoundManagera9">loadSoundsFromRegion</a> (const <a class="el" href="a03126.html">NLLIGO::CPrimRegion</a> &amp;region)</td></tr>
+
+<tr><td class="memItemLeft" nowrap align=right valign=top>void&nbsp;</td><td class="memItemRight" valign=bottom><a class="el" href="a02248.html#NLSOUND_1_1CBackgroundSoundManagera10">play</a> ()</td></tr>
+
+<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Start to play the background sound. <a href="#NLSOUND_1_1CBackgroundSoundManagera10"></a><br><br></td></tr>
+<tr><td class="memItemLeft" nowrap align=right valign=top>void&nbsp;</td><td class="memItemRight" valign=bottom><a class="el" href="a02248.html#NLSOUND_1_1CBackgroundSoundManagera11">setBackgroundFilterFades</a> (const <a class="el" href="a03920.html">UAudioMixer::TBackgroundFilterFades</a> &amp;backgroundFilterFades)</td></tr>
+
+<tr><td class="memItemLeft" nowrap align=right valign=top>void&nbsp;</td><td class="memItemRight" valign=bottom><a class="el" href="a02248.html#NLSOUND_1_1CBackgroundSoundManagera12">setBackgroundFlags</a> (const <a class="el" href="a03921.html">UAudioMixer::TBackgroundFlags</a> &amp;backgroundFlags)</td></tr>
+
+<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Set the background flags. <a href="#NLSOUND_1_1CBackgroundSoundManagera12"></a><br><br></td></tr>
+<tr><td class="memItemLeft" nowrap align=right valign=top>void&nbsp;</td><td class="memItemRight" valign=bottom><a class="el" href="a02248.html#NLSOUND_1_1CBackgroundSoundManagera13">setListenerPosition</a> (const <a class="el" href="a03128.html">NLMISC::CVector</a> &amp;listenerPosition)</td></tr>
+
+<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Call this method when the listener position change. <a href="#NLSOUND_1_1CBackgroundSoundManagera13"></a><br><br></td></tr>
+<tr><td class="memItemLeft" nowrap align=right valign=top>void&nbsp;</td><td class="memItemRight" valign=bottom><a class="el" href="a02248.html#NLSOUND_1_1CBackgroundSoundManagera14">stop</a> ()</td></tr>
+
+<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Stop the background sound. <a href="#NLSOUND_1_1CBackgroundSoundManagera14"></a><br><br></td></tr>
+<tr><td class="memItemLeft" nowrap align=right valign=top>void&nbsp;</td><td class="memItemRight" valign=bottom><a class="el" href="a02248.html#NLSOUND_1_1CBackgroundSoundManagera15">unload</a> ()</td></tr>
+
+<tr><td class="memItemLeft" nowrap align=right valign=top>void&nbsp;</td><td class="memItemRight" valign=bottom><a class="el" href="a02248.html#NLSOUND_1_1CBackgroundSoundManagera16">updateBackgroundStatus</a> ()</td></tr>
+
+<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Call this method to update the background sound (sub method of setListenerPosition). <a href="#NLSOUND_1_1CBackgroundSoundManagera16"></a><br><br></td></tr>
+<tr><td colspan=2><br><h2>Private Member Functions</h2></td></tr>
+<tr><td class="memItemLeft" nowrap align=right valign=top>void&nbsp;</td><td class="memItemRight" valign=bottom><a class="el" href="a02248.html#NLSOUND_1_1CBackgroundSoundManagerd0">addFxZone</a> (const std::string &amp;fxName, const std::vector&lt; <a class="el" href="a03127.html">NLLIGO::CPrimVector</a> &gt; &amp;points)</td></tr>
+
+<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">add a fx zone <a href="#NLSOUND_1_1CBackgroundSoundManagerd0"></a><br><br></td></tr>
+<tr><td class="memItemLeft" nowrap align=right valign=top>void&nbsp;</td><td class="memItemRight" valign=bottom><a class="el" href="a02248.html#NLSOUND_1_1CBackgroundSoundManagerd1">addSampleBank</a> (const std::vector&lt; std::string &gt; &amp;bankNames, const std::vector&lt; <a class="el" href="a03127.html">NLLIGO::CPrimVector</a> &gt; &amp;points)</td></tr>
+
+<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">add a sample bank zone <a href="#NLSOUND_1_1CBackgroundSoundManagerd1"></a><br><br></td></tr>
+<tr><td class="memItemLeft" nowrap align=right valign=top>void&nbsp;</td><td class="memItemRight" valign=bottom><a class="el" href="a02248.html#NLSOUND_1_1CBackgroundSoundManagerd2">addSound</a> (const std::string &amp;rawSoundName, const std::vector&lt; <a class="el" href="a03127.html">NLLIGO::CPrimVector</a> &gt; &amp;points, bool isPath)</td></tr>
+
+<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">deprecated, Internal use only for loading. <a href="#NLSOUND_1_1CBackgroundSoundManagerd2"></a><br><br></td></tr>
+<tr><td class="memItemLeft" nowrap align=right valign=top>void&nbsp;</td><td class="memItemRight" valign=bottom><a class="el" href="a02248.html#NLSOUND_1_1CBackgroundSoundManagerd3">addSound</a> (const std::string &amp;soundName, <a class="el" href="a04558.html#a15">uint</a> layerId, const std::vector&lt; <a class="el" href="a03127.html">NLLIGO::CPrimVector</a> &gt; &amp;points, bool isPath)</td></tr>
+
+<tr><td class="memItemLeft" nowrap align=right valign=top>&nbsp;</td><td class="memItemRight" valign=bottom><a class="el" href="a02248.html#NLSOUND_1_1CBackgroundSoundManagerd4">CBackgroundSoundManager</a> ()</td></tr>
+
+<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Constructor. <a href="#NLSOUND_1_1CBackgroundSoundManagerd4"></a><br><br></td></tr>
+<tr><td class="memItemLeft" nowrap align=right valign=top>void&nbsp;</td><td class="memItemRight" valign=bottom><a class="el" href="a02248.html#NLSOUND_1_1CBackgroundSoundManagerd5">loadEffectsFromPrimitives</a> (const <a class="el" href="a03123.html">NLLIGO::IPrimitive</a> &amp;fxRoot)</td></tr>
+
+<tr><td class="memItemLeft" nowrap align=right valign=top>void&nbsp;</td><td class="memItemRight" valign=bottom><a class="el" href="a02248.html#NLSOUND_1_1CBackgroundSoundManagerd6">loadSamplesFromPrimitives</a> (const <a class="el" href="a03123.html">NLLIGO::IPrimitive</a> &amp;sampleRoot)</td></tr>
+
+<tr><td class="memItemLeft" nowrap align=right valign=top>void&nbsp;</td><td class="memItemRight" valign=bottom><a class="el" href="a02248.html#NLSOUND_1_1CBackgroundSoundManagerd7">loadSoundsFromPrimitives</a> (const <a class="el" href="a03123.html">NLLIGO::IPrimitive</a> &amp;soundRoot)</td></tr>
+
+<tr><td class="memItemLeft" nowrap align=right valign=top>void&nbsp;</td><td class="memItemRight" valign=bottom><a class="el" href="a02248.html#NLSOUND_1_1CBackgroundSoundManagerd8">onUpdate</a> ()</td></tr>
+
+<tr><td class="memItemLeft" nowrap align=right valign=top>template&lt;class CharType&gt; std::vector&lt; std::basic_string&lt;<br>
+ CharType &gt; &gt;&nbsp;</td><td class="memItemRight" valign=bottom><a class="el" href="a02248.html#NLSOUND_1_1CBackgroundSoundManagerd9">split</a> (const std::basic_string&lt; CharType &gt; &amp;str, CharType splitTag)</td></tr>
+
+<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">TODO : Utility... should be in <a class="el" href="a05378.html">NLMISC</a> ? <a href="#NLSOUND_1_1CBackgroundSoundManagerd9"></a><br><br></td></tr>
+<tr><td class="memItemLeft" nowrap align=right valign=top>virtual&nbsp;</td><td class="memItemRight" valign=bottom><a class="el" href="a02248.html#NLSOUND_1_1CBackgroundSoundManagerd10">~CBackgroundSoundManager</a> ()</td></tr>
+
+<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Destructor. <a href="#NLSOUND_1_1CBackgroundSoundManagerd10"></a><br><br></td></tr>
+<tr><td colspan=2><br><h2>Private Attributes</h2></td></tr>
+<tr><td class="memItemLeft" nowrap align=right valign=top><a class="el" href="a03920.html">UAudioMixer::TBackgroundFilterFades</a>&nbsp;</td><td class="memItemRight" valign=bottom><a class="el" href="a02248.html#NLSOUND_1_1CBackgroundSoundManagerr0">_BackgroundFilterFades</a></td></tr>
+
+<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Background filters fades. <a href="#NLSOUND_1_1CBackgroundSoundManagerr0"></a><br><br></td></tr>
+<tr><td class="memItemLeft" nowrap align=right valign=top><a class="el" href="a03921.html">UAudioMixer::TBackgroundFlags</a>&nbsp;</td><td class="memItemRight" valign=bottom><a class="el" href="a02248.html#NLSOUND_1_1CBackgroundSoundManagerr1">_BackgroundFlags</a></td></tr>
+
+<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Background flags. <a href="#NLSOUND_1_1CBackgroundSoundManagerr1"></a><br><br></td></tr>
+<tr><td class="memItemLeft" nowrap align=right valign=top>bool&nbsp;</td><td class="memItemRight" valign=bottom><a class="el" href="a02248.html#NLSOUND_1_1CBackgroundSoundManagerr2">_DoFade</a></td></tr>
+
+<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Is some fade in/out running? <a href="#NLSOUND_1_1CBackgroundSoundManagerr2"></a><br><br></td></tr>
+<tr><td class="memItemLeft" nowrap align=right valign=top><a class="el" href="a05378.html#a242">NLMISC::TTime</a>&nbsp;</td><td class="memItemRight" valign=bottom><a class="el" href="a02248.html#NLSOUND_1_1CBackgroundSoundManagerr3">_FilterFadesStart</a> [UAudioMixer::TBackgroundFlags::NB_BACKGROUND_FLAGS]</td></tr>
+
+<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">The date of last fade in or out started for each filter. <a href="#NLSOUND_1_1CBackgroundSoundManagerr3"></a><br><br></td></tr>
+<tr><td class="memItemLeft" nowrap align=right valign=top>float&nbsp;</td><td class="memItemRight" valign=bottom><a class="el" href="a02248.html#NLSOUND_1_1CBackgroundSoundManagerr4">_FilterFadeValues</a> [UAudioMixer::TBackgroundFlags::NB_BACKGROUND_FLAGS]</td></tr>
+
+<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">The filter fade values. <a href="#NLSOUND_1_1CBackgroundSoundManagerr4"></a><br><br></td></tr>
+<tr><td class="memItemLeft" nowrap align=right valign=top>std::vector&lt; <a class="el" href="a02250.html">TFxZone</a> &gt;&nbsp;</td><td class="memItemRight" valign=bottom><a class="el" href="a02248.html#NLSOUND_1_1CBackgroundSoundManagerr5">_FxZones</a></td></tr>
+
+<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Container for the fx primitive. <a href="#NLSOUND_1_1CBackgroundSoundManagerr5"></a><br><br></td></tr>
+<tr><td class="memItemLeft" nowrap align=right valign=top><a class="el" href="a05378.html#a236">NLMISC::TStringId</a>&nbsp;</td><td class="memItemRight" valign=bottom><a class="el" href="a02248.html#NLSOUND_1_1CBackgroundSoundManagerr6">_LastEnv</a></td></tr>
+
+<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Last setted env fx. Used when clustered sound is not active. <a href="#NLSOUND_1_1CBackgroundSoundManagerr6"></a><br><br></td></tr>
+<tr><td class="memItemLeft" nowrap align=right valign=top><a class="el" href="a03128.html">NLMISC::CVector</a>&nbsp;</td><td class="memItemRight" valign=bottom><a class="el" href="a02248.html#NLSOUND_1_1CBackgroundSoundManagerr7">_LastPosition</a></td></tr>
+
+<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">The last position of the listener. <a href="#NLSOUND_1_1CBackgroundSoundManagerr7"></a><br><br></td></tr>
+<tr><td class="memItemLeft" nowrap align=right valign=top>bool&nbsp;</td><td class="memItemRight" valign=bottom><a class="el" href="a02248.html#NLSOUND_1_1CBackgroundSoundManagerr8">_Playing</a></td></tr>
+
+<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Flag for playing background sounds. <a href="#NLSOUND_1_1CBackgroundSoundManagerr8"></a><br><br></td></tr>
+<tr><td colspan="2"><div class="groupHeader"></div></td></tr>
+<tr><td class="memItemLeft" nowrap align=right valign=top>std::vector&lt; <a class="el" href="a02249.html">TBanksData</a> &gt;&nbsp;</td><td class="memItemRight" valign=bottom><a class="el" href="a02248.html#NLSOUND_1_1CBackgroundSoundManagerz1295_0">_Banks</a></td></tr>
+
+<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Container for the banks primitive. <a href="#NLSOUND_1_1CBackgroundSoundManagerz1295_0"></a><br><br></td></tr>
+<tr><td class="memItemLeft" nowrap align=right valign=top>std::set&lt; std::string &gt;&nbsp;</td><td class="memItemRight" valign=bottom><a class="el" href="a02248.html#NLSOUND_1_1CBackgroundSoundManagerz1295_1">_LoadedBanks</a></td></tr>
+
+<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Container for the list of currently loaded banks. <a href="#NLSOUND_1_1CBackgroundSoundManagerz1295_1"></a><br><br></td></tr>
+<tr><td colspan="2"><div class="groupHeader"></div></td></tr>
+<tr><td class="memItemLeft" nowrap align=right valign=top>std::vector&lt; <a class="el" href="a02251.html">TSoundData</a> &gt;&nbsp;</td><td class="memItemRight" valign=bottom><a class="el" href="a02248.html#NLSOUND_1_1CBackgroundSoundManagerz1296_0">_Layers</a> [<a class="el" href="a05381.html#a4">BACKGROUND_LAYER</a>]</td></tr>
+
+<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Array of vector of sound data. <a href="#NLSOUND_1_1CBackgroundSoundManagerz1296_0"></a><br><br></td></tr>
+<tr><td colspan=2><br><h2>Friends</h2></td></tr>
+<tr><td class="memItemLeft" nowrap align=right valign=top>class&nbsp;</td><td class="memItemRight" valign=bottom><a class="el" href="a02248.html#NLSOUND_1_1CBackgroundSoundManagern0">CAudioMixerUser</a></td></tr>
+
+</table>
+<hr><h2>Constructor &amp; Destructor Documentation</h2>
+<a class="anchor" name="NLSOUND_1_1CBackgroundSoundManagerd4" doxytag="NLSOUND::CBackgroundSoundManager::CBackgroundSoundManager" ></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::CBackgroundSoundManager::CBackgroundSoundManager </td>
+ <td class="md" valign="top">(&nbsp;</td>
+ <td class="mdname1" valign="top" nowrap> </td>
+ <td class="md" valign="top">&nbsp;)&nbsp;</td>
+ <td class="md" nowrap><code> [private]</code></td>
+ </tr>
+
+ </table>
+ </td>
+ </tr>
+</table>
+<table cellspacing=5 cellpadding=0 border=0>
+ <tr>
+ <td>
+ &nbsp;
+ </td>
+ <td>
+
+<p>
+Constructor.
+<p>
+
+<p>
+Definition at line <a class="el" href="a05471.html#l00060">60</a> of file <a class="el" href="a05471.html">background_sound_manager.cpp</a>.
+<p>
+References <a class="el" href="a05472.html#l00198">_BackgroundFlags</a>, <a class="el" href="a05472.html#l00202">_FilterFadesStart</a>, <a class="el" href="a05472.html#l00204">_FilterFadeValues</a>, <a class="el" href="a06594.html#l00097">NLSOUND::UAudioMixer::TBackgroundFlags::Flags</a>, and <a class="el" href="a05981.html#l00105">uint</a>.
+<p>
+<div class="fragment"><pre>00061 : <a class="code" href="a02248.html#NLSOUND_1_1CBackgroundSoundManagerr7">_LastPosition</a>(0,0,0), <a class="code" href="a02248.html#NLSOUND_1_1CBackgroundSoundManagerr8">_Playing</a>(<span class="keyword">false</span>), <a class="code" href="a02248.html#NLSOUND_1_1CBackgroundSoundManagerr2">_DoFade</a>(<span class="keyword">false</span>)
+00062 {
+00063 <span class="keywordflow">for</span> (<a class="code" href="a04558.html#a15">uint</a> i=0; i&lt;UAudioMixer::TBackgroundFlags::NB_BACKGROUND_FLAGS; ++i)
+00064 {
+00065 <a class="code" href="a02248.html#NLSOUND_1_1CBackgroundSoundManagerr1">_BackgroundFlags</a>.Flags[i] = <span class="keyword">false</span>;
+00066 <a class="code" href="a02248.html#NLSOUND_1_1CBackgroundSoundManagerr3">_FilterFadesStart</a>[i] = 0;
+00067 <a class="code" href="a02248.html#NLSOUND_1_1CBackgroundSoundManagerr4">_FilterFadeValues</a>[i] = 1.0f;
+00068 }
+00069 }
+</pre></div> </td>
+ </tr>
+</table>
+<a class="anchor" name="NLSOUND_1_1CBackgroundSoundManagerd10" doxytag="NLSOUND::CBackgroundSoundManager::~CBackgroundSoundManager" ></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::CBackgroundSoundManager::~<a class="el" href="a02248.html">CBackgroundSoundManager</a> </td>
+ <td class="md" valign="top">(&nbsp;</td>
+ <td class="mdname1" valign="top" nowrap> </td>
+ <td class="md" valign="top">&nbsp;)&nbsp;</td>
+ <td class="md" nowrap><code> [private, virtual]</code></td>
+ </tr>
+
+ </table>
+ </td>
+ </tr>
+</table>
+<table cellspacing=5 cellpadding=0 border=0>
+ <tr>
+ <td>
+ &nbsp;
+ </td>
+ <td>
+
+<p>
+Destructor.
+<p>
+
+<p>
+Definition at line <a class="el" href="a05471.html#l00071">71</a> of file <a class="el" href="a05471.html">background_sound_manager.cpp</a>.
+<p>
+References <a class="el" href="a05471.html#l00823">unload()</a>.
+<p>
+<div class="fragment"><pre>00072 {
+00073 <a class="code" href="a02248.html#NLSOUND_1_1CBackgroundSoundManagera15">unload</a>();
+00074 }
+</pre></div> </td>
+ </tr>
+</table>
+<hr><h2>Member Function Documentation</h2>
+<a class="anchor" name="NLSOUND_1_1CBackgroundSoundManagerd0" doxytag="NLSOUND::CBackgroundSoundManager::addFxZone" ></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::CBackgroundSoundManager::addFxZone </td>
+ <td class="md" valign="top">(&nbsp;</td>
+ <td class="md" nowrap valign="top">const std::string &amp;&nbsp;</td>
+ <td class="mdname" nowrap> <em>fxName</em>, </td>
+ </tr>
+ <tr>
+ <td class="md" nowrap align="right"></td>
+ <td></td>
+ <td class="md" nowrap>const std::vector&lt; <a class="el" href="a03127.html">NLLIGO::CPrimVector</a> &gt; &amp;&nbsp;</td>
+ <td class="mdname" nowrap> <em>points</em></td>
+ </tr>
+ <tr>
+ <td></td>
+ <td class="md">)&nbsp;</td>
+ <td class="md" colspan="2"><code> [private]</code></td>
+ </tr>
+
+ </table>
+ </td>
+ </tr>
+</table>
+<table cellspacing=5 cellpadding=0 border=0>
+ <tr>
+ <td>
+ &nbsp;
+ </td>
+ <td>
+
+<p>
+add a fx zone
+<p>
+
+<p>
+Definition at line <a class="el" href="a05471.html#l00473">473</a> of file <a class="el" href="a05471.html">background_sound_manager.cpp</a>.
+<p>
+References <a class="el" href="a05472.html#l00305">_FxZones</a>, <a class="el" href="a05472.html#l00294">NLSOUND::CBackgroundSoundManager::TFxZone::FxName</a>, <a class="el" href="a05472.html#l00300">NLSOUND::CBackgroundSoundManager::TFxZone::MaxBox</a>, <a class="el" href="a05484.html#l00038">min</a>, <a class="el" href="a05472.html#l00298">NLSOUND::CBackgroundSoundManager::TFxZone::MinBox</a>, <a class="el" href="a05472.html#l00296">NLSOUND::CBackgroundSoundManager::TFxZone::Points</a>, <a class="el" href="a05981.html#l00105">uint</a>, <a class="el" href="a06673.html#l00051">NLMISC::CVector::x</a>, and <a class="el" href="a06673.html#l00051">NLMISC::CVector::y</a>.
+<p>
+Referenced by <a class="el" href="a05471.html#l00441">loadEffectsFromPrimitives()</a>.
+<p>
+<div class="fragment"><pre>00474 {
+00475 TFxZone fxZone;
+00476
+00477 fxZone.FxName = CStringMapper::map(fxName);
+00478 fxZone.Points.resize (points.size());
+00479 <span class="keywordflow">for</span> (<a class="code" href="a04558.html#a15">uint</a> j=0; j&lt;points.size(); j++)
+00480 {
+00481 fxZone.Points[j] = points[j];
+00482 }
+00483
+00484 <span class="comment">// compute bouding box.</span>
+00485 CVector vmin(FLT_MAX, FLT_MAX, 0), vmax(-FLT_MAX, -FLT_MAX, 0);
+00486
+00487 vector&lt;CVector&gt;::iterator first(fxZone.Points.begin()), last(fxZone.Points.end());
+00488 <span class="keywordflow">for</span> (; first != last; ++first)
+00489 {
+00490 vmin.x = <a class="code" href="a04061.html#a0">min</a>(first-&gt;x, vmin.x);
+00491 vmin.y = <a class="code" href="a04061.html#a0">min</a>(first-&gt;y, vmin.y);
+00492 vmax.x = max(first-&gt;x, vmax.x);
+00493 vmax.y = max(first-&gt;y, vmax.y);
+00494 }
+00495 fxZone.MaxBox = vmax;
+00496 fxZone.MinBox = vmin;
+00497
+00498 <a class="code" href="a02248.html#NLSOUND_1_1CBackgroundSoundManagerr5">_FxZones</a>.push_back(fxZone);
+00499 }
+</pre></div> </td>
+ </tr>
+</table>
+<a class="anchor" name="NLSOUND_1_1CBackgroundSoundManagerd1" doxytag="NLSOUND::CBackgroundSoundManager::addSampleBank" ></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::CBackgroundSoundManager::addSampleBank </td>
+ <td class="md" valign="top">(&nbsp;</td>
+ <td class="md" nowrap valign="top">const std::vector&lt; std::string &gt; &amp;&nbsp;</td>
+ <td class="mdname" nowrap> <em>bankNames</em>, </td>
+ </tr>
+ <tr>
+ <td class="md" nowrap align="right"></td>
+ <td></td>
+ <td class="md" nowrap>const std::vector&lt; <a class="el" href="a03127.html">NLLIGO::CPrimVector</a> &gt; &amp;&nbsp;</td>
+ <td class="mdname" nowrap> <em>points</em></td>
+ </tr>
+ <tr>
+ <td></td>
+ <td class="md">)&nbsp;</td>
+ <td class="md" colspan="2"><code> [private]</code></td>
+ </tr>
+
+ </table>
+ </td>
+ </tr>
+</table>
+<table cellspacing=5 cellpadding=0 border=0>
+ <tr>
+ <td>
+ &nbsp;
+ </td>
+ <td>
+
+<p>
+add a sample bank zone
+<p>
+
+<p>
+Definition at line <a class="el" href="a05471.html#l00502">502</a> of file <a class="el" href="a05471.html">background_sound_manager.cpp</a>.
+<p>
+References <a class="el" href="a05472.html#l00218">NLSOUND::CBackgroundSoundManager::TBanksData::Banks</a>, <a class="el" href="a05472.html#l00222">NLSOUND::CBackgroundSoundManager::TBanksData::MaxBox</a>, <a class="el" href="a05484.html#l00038">min</a>, <a class="el" href="a05472.html#l00220">NLSOUND::CBackgroundSoundManager::TBanksData::MinBox</a>, <a class="el" href="a05472.html#l00224">NLSOUND::CBackgroundSoundManager::TBanksData::Points</a>, <a class="el" href="a05981.html#l00105">uint</a>, <a class="el" href="a06673.html#l00051">NLMISC::CVector::x</a>, and <a class="el" href="a06673.html#l00051">NLMISC::CVector::y</a>.
+<p>
+Referenced by <a class="el" href="a05471.html#l00410">loadSamplesFromPrimitives()</a>, and <a class="el" href="a05471.html#l00537">loadSamplesFromRegion()</a>.
+<p>
+<div class="fragment"><pre>00503 {
+00504 TBanksData bd;
+00505 <span class="comment">// uint pointCount = points.size ();</span>
+00506 bd.Points.resize (points.size());
+00507 <span class="keywordflow">for</span> (<a class="code" href="a04558.html#a15">uint</a> j=0; j&lt;points.size(); j++)
+00508 {
+00509 bd.Points[j] = points[j];
+00510 }
+00511
+00512 <span class="comment">// compute bouding box.</span>
+00513 CVector vmin(FLT_MAX, FLT_MAX, 0), vmax(-FLT_MAX, -FLT_MAX, 0);
+00514
+00515 vector&lt;CVector&gt;::iterator first(bd.Points.begin()), last(bd.Points.end());
+00516 <span class="keywordflow">for</span> (; first != last; ++first)
+00517 {
+00518 vmin.x = <a class="code" href="a04061.html#a0">min</a>(first-&gt;x, vmin.x);
+00519 vmin.y = <a class="code" href="a04061.html#a0">min</a>(first-&gt;y, vmin.y);
+00520 vmax.x = max(first-&gt;x, vmax.x);
+00521 vmax.y = max(first-&gt;y, vmax.y);
+00522 }
+00523 bd.MaxBox = vmax;
+00524 bd.MinBox = vmin;
+00525
+00526 <span class="keywordflow">for</span>(<a class="code" href="a04558.html#a15">uint</a> i=0; i&lt;bankNames.size(); ++i)
+00527 {
+00528 <span class="keywordflow">if</span> (!bankNames[i].empty())
+00529 bd.Banks.push_back(bankNames[i]);
+00530 }
+00531
+00532 <span class="comment">// ok, store it in the container.</span>
+00533 <a class="code" href="a02248.html#NLSOUND_1_1CBackgroundSoundManagerz1295_0">_Banks</a>.push_back(bd);
+00534 }
+</pre></div> </td>
+ </tr>
+</table>
+<a class="anchor" name="NLSOUND_1_1CBackgroundSoundManagerd2" doxytag="NLSOUND::CBackgroundSoundManager::addSound" ></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::CBackgroundSoundManager::addSound </td>
+ <td class="md" valign="top">(&nbsp;</td>
+ <td class="md" nowrap valign="top">const std::string &amp;&nbsp;</td>
+ <td class="mdname" nowrap> <em>rawSoundName</em>, </td>
+ </tr>
+ <tr>
+ <td class="md" nowrap align="right"></td>
+ <td></td>
+ <td class="md" nowrap>const std::vector&lt; <a class="el" href="a03127.html">NLLIGO::CPrimVector</a> &gt; &amp;&nbsp;</td>
+ <td class="mdname" nowrap> <em>points</em>, </td>
+ </tr>
+ <tr>
+ <td class="md" nowrap align="right"></td>
+ <td></td>
+ <td class="md" nowrap>bool&nbsp;</td>
+ <td class="mdname" nowrap> <em>isPath</em></td>
+ </tr>
+ <tr>
+ <td></td>
+ <td class="md">)&nbsp;</td>
+ <td class="md" colspan="2"><code> [private]</code></td>
+ </tr>
+
+ </table>
+ </td>
+ </tr>
+</table>
+<table cellspacing=5 cellpadding=0 border=0>
+ <tr>
+ <td>
+ &nbsp;
+ </td>
+ <td>
+
+<p>
+deprecated, Internal use only for loading.
+<p>
+
+<p>
+Definition at line <a class="el" href="a05471.html#l00149">149</a> of file <a class="el" href="a05471.html">background_sound_manager.cpp</a>.
+<p>
+References <a class="el" href="a05471.html#l00093">addSound()</a>, <a class="el" href="a05472.html#l00051">NLSOUND::BACKGROUND_LAYER</a>, <a class="el" href="a05587.html#l00115">NLMISC::clamp()</a>, <a class="el" href="a05536.html#l00448">count</a>, <a class="el" href="a05622.html#l00135">nlwarning</a>, <a class="el" href="a05981.html#l00105">uint</a>, and <a class="el" href="a05981.html#l00100">uint32</a>.
+<p>
+<div class="fragment"><pre>00150 {
+00151 <a class="code" href="a04558.html#a15">uint</a> layerId = 0;
+00152 <a class="code" href="a04558.html#a15">uint</a> n = 0;
+00153 string name;
+00154 <span class="comment">// count the number of '-' in the string.</span>
+00155 n = <a class="code" href="a04113.html#a71">std::count</a>(rawSoundName.begin(), rawSoundName.end(), <span class="charliteral">'-'</span>);
+00156
+00157 <span class="keywordflow">if</span> (n == 2)
+00158 {
+00159 <span class="comment">// no layer spec, default to layer A</span>
+00160 <a class="code" href="a04558.html#a11">uint32</a> pos1 = rawSoundName.find (<span class="stringliteral">"-"</span>);
+00161 <span class="keywordflow">if</span>(pos1 == string::npos)
+00162 {
+00163 <a class="code" href="a04199.html#a2">nlwarning</a> (<span class="stringliteral">"zone have the malformated name '%s' missing -name-"</span>, rawSoundName.c_str());
+00164 <span class="keywordflow">return</span>;
+00165 }
+00166 pos1++;
+00167
+00168 <a class="code" href="a04558.html#a11">uint32</a> pos2 = rawSoundName.find (<span class="stringliteral">"-"</span>, pos1);
+00169 <span class="keywordflow">if</span>(pos2 == string::npos)
+00170 {
+00171 <a class="code" href="a04199.html#a2">nlwarning</a> (<span class="stringliteral">"zone have the malformated name '%s' missing -name-"</span>, rawSoundName.c_str());
+00172 <span class="keywordflow">return</span>;
+00173 }
+00174
+00175 name = rawSoundName.substr(pos1, pos2-pos1);
+00176 }
+00177 <span class="keywordflow">else</span> <span class="keywordflow">if</span> (n == 3)
+00178 {
+00179 <span class="comment">// layer spec !</span>
+00180 <a class="code" href="a04558.html#a11">uint32</a> pos1 = rawSoundName.find (<span class="stringliteral">"-"</span>);
+00181 <a class="code" href="a04558.html#a11">uint32</a> pos2 = rawSoundName.find (<span class="stringliteral">"-"</span>, pos1+1);
+00182 <span class="keywordflow">if</span>(pos1 == string::npos || pos2 == string::npos)
+00183 {
+00184 <a class="code" href="a04199.html#a2">nlwarning</a> (<span class="stringliteral">"zone have the malformated name '%s' missing -layerId- or -name-"</span>, rawSoundName.c_str());
+00185 <span class="keywordflow">return</span>;
+00186 }
+00187 pos1++;
+00188
+00189 <a class="code" href="a04558.html#a11">uint32</a> pos3 = rawSoundName.find (<span class="stringliteral">"-"</span>, pos2+1);
+00190 <span class="keywordflow">if</span>(pos3 == string::npos)
+00191 {
+00192 <a class="code" href="a04199.html#a2">nlwarning</a> (<span class="stringliteral">"zone have the malformated name '%s' missing -name-"</span>, rawSoundName.c_str());
+00193 <span class="keywordflow">return</span>;
+00194 }
+00195
+00196 <span class="keywordtype">char</span> <span class="keywordtype">id</span> = rawSoundName[pos1];
+00197
+00198 <span class="comment">// check caps</span>
+00199 <span class="keywordflow">if</span> (<span class="keywordtype">id</span> &lt; <span class="charliteral">'a'</span>)
+00200 <span class="keywordtype">id</span> = <span class="keywordtype">id</span> + (<span class="charliteral">'a'</span> - <span class="charliteral">'A'</span>);
+00201
+00202 layerId = <span class="keywordtype">id</span> - <span class="charliteral">'a'</span>;
+00203
+00204 <a class="code" href="a05378.html#a374">NLMISC::clamp</a>(layerId, 0u, BACKGROUND_LAYER-1);
+00205 pos2++;
+00206
+00207 name = rawSoundName.substr(pos2, pos3-pos2);
+00208 }
+00209 <span class="keywordflow">else</span>
+00210 {
+00211 <a class="code" href="a04199.html#a2">nlwarning</a> (<span class="stringliteral">"zone have the malformated name '%s"</span>, rawSoundName.c_str());
+00212 <span class="keywordflow">return</span>;
+00213 }
+00214
+00215 <a class="code" href="a02248.html#NLSOUND_1_1CBackgroundSoundManagerd3">addSound</a>(name, layerId, points, isPath);
+00216 <span class="comment">/*</span>
+00217 <span class="comment"> TSoundData sd;</span>
+00218 <span class="comment"></span>
+00219 <span class="comment"> sd.SoundName = name;</span>
+00220 <span class="comment"> sd.Sound = mixer-&gt;getSoundId(sd.SoundName);</span>
+00221 <span class="comment"> sd.Source = 0;</span>
+00222 <span class="comment"></span>
+00223 <span class="comment"> // Copy the points</span>
+00224 <span class="comment"> sd.Points.resize (points.size ());</span>
+00225 <span class="comment"> for (uint i=0; i&lt;points.size (); i++)</span>
+00226 <span class="comment"> sd.Points[i] = points[i];</span>
+00227 <span class="comment"></span>
+00228 <span class="comment"> sd.Selected = false;</span>
+00229 <span class="comment"> sd.IsPath = isPath;</span>
+00230 <span class="comment"></span>
+00231 <span class="comment"> if (sd.Sound != 0)</span>
+00232 <span class="comment"> {</span>
+00233 <span class="comment"> // the sound is available !</span>
+00234 <span class="comment"> // compute bouding box/</span>
+00235 <span class="comment"> CVector vmin(FLT_MAX, FLT_MAX, 0), vmax(-FLT_MAX, -FLT_MAX, 0);</span>
+00236 <span class="comment"></span>
+00237 <span class="comment"> vector&lt;CVector&gt;::iterator first(sd.Points.begin()), last(sd.Points.end());</span>
+00238 <span class="comment"> for (; first != last; ++first)</span>
+00239 <span class="comment"> {</span>
+00240 <span class="comment"> vmin.x = min(first-&gt;x, vmin.x);</span>
+00241 <span class="comment"> vmin.y = min(first-&gt;y, vmin.y);</span>
+00242 <span class="comment"> vmax.x = max(first-&gt;x, vmax.x);</span>
+00243 <span class="comment"> vmax.y = max(first-&gt;y, vmax.y);</span>
+00244 <span class="comment"> }</span>
+00245 <span class="comment"> sd.MaxBox = vmax;</span>
+00246 <span class="comment"> sd.MinBox = vmin;</span>
+00247 <span class="comment"></span>
+00248 <span class="comment"> // compute the surface without the sound distance</span>
+00249 <span class="comment"> sd.Surface = (vmax.x - vmin.x) * (vmax.y - vmin.y);</span>
+00250 <span class="comment"></span>
+00251 <span class="comment"> // add the eard distance of the sound.</span>
+00252 <span class="comment"> float dist = sd.Sound-&gt;getMaxDistance();</span>
+00253 <span class="comment"> sd.MaxBox.x += dist;</span>
+00254 <span class="comment"> sd.MaxBox.y += dist;</span>
+00255 <span class="comment"> sd.MinBox.x -= dist;</span>
+00256 <span class="comment"> sd.MinBox.y -= dist;</span>
+00257 <span class="comment"></span>
+00258 <span class="comment"> sd.MaxDist = dist;</span>
+00259 <span class="comment"></span>
+00260 <span class="comment"> // store the sound. </span>
+00261 <span class="comment"> // TODO : handle the three layer.</span>
+00262 <span class="comment"> _Layers[layerId].push_back(sd);</span>
+00263 <span class="comment"> }</span>
+00264 <span class="comment"> else</span>
+00265 <span class="comment"> {</span>
+00266 <span class="comment"> nlwarning ("The sound '%s' can't be loaded", sd.SoundName.c_str());</span>
+00267 <span class="comment"> }</span>
+00268 <span class="comment">*/</span>
+00269 }
+</pre></div> </td>
+ </tr>
+</table>
+<a class="anchor" name="NLSOUND_1_1CBackgroundSoundManagerd3" doxytag="NLSOUND::CBackgroundSoundManager::addSound" ></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::CBackgroundSoundManager::addSound </td>
+ <td class="md" valign="top">(&nbsp;</td>
+ <td class="md" nowrap valign="top">const std::string &amp;&nbsp;</td>
+ <td class="mdname" nowrap> <em>soundName</em>, </td>
+ </tr>
+ <tr>
+ <td class="md" nowrap align="right"></td>
+ <td></td>
+ <td class="md" nowrap><a class="el" href="a04558.html#a15">uint</a>&nbsp;</td>
+ <td class="mdname" nowrap> <em>layerId</em>, </td>
+ </tr>
+ <tr>
+ <td class="md" nowrap align="right"></td>
+ <td></td>
+ <td class="md" nowrap>const std::vector&lt; <a class="el" href="a03127.html">NLLIGO::CPrimVector</a> &gt; &amp;&nbsp;</td>
+ <td class="mdname" nowrap> <em>points</em>, </td>
+ </tr>
+ <tr>
+ <td class="md" nowrap align="right"></td>
+ <td></td>
+ <td class="md" nowrap>bool&nbsp;</td>
+ <td class="mdname" nowrap> <em>isPath</em></td>
+ </tr>
+ <tr>
+ <td></td>
+ <td class="md">)&nbsp;</td>
+ <td class="md" colspan="2"><code> [private]</code></td>
+ </tr>
+
+ </table>
+ </td>
+ </tr>
+</table>
+<table cellspacing=5 cellpadding=0 border=0>
+ <tr>
+ <td>
+ &nbsp;
+ </td>
+ <td>
+
+<p>
+
+<p>
+Definition at line <a class="el" href="a05471.html#l00093">93</a> of file <a class="el" href="a05471.html">background_sound_manager.cpp</a>.
+<p>
+References <a class="el" href="a05472.html#l00265">_Layers</a>, <a class="el" href="a06407.html#l00110">NLSOUND::CSound::getMaxDistance()</a>, <a class="el" href="a05465.html#l01510">NLSOUND::CAudioMixerUser::getSoundId()</a>, <a class="el" href="a05472.html#l00256">NLSOUND::CBackgroundSoundManager::TSoundData::IsPath</a>, <a class="el" href="a05472.html#l00250">NLSOUND::CBackgroundSoundManager::TSoundData::MaxBox</a>, <a class="el" href="a05472.html#l00254">NLSOUND::CBackgroundSoundManager::TSoundData::MaxDist</a>, <a class="el" href="a05484.html#l00038">min</a>, <a class="el" href="a05472.html#l00248">NLSOUND::CBackgroundSoundManager::TSoundData::MinBox</a>, <a class="el" href="a05622.html#l00135">nlwarning</a>, <a class="el" href="a05472.html#l00258">NLSOUND::CBackgroundSoundManager::TSoundData::Points</a>, <a class="el" href="a05472.html#l00260">NLSOUND::CBackgroundSoundManager::TSoundData::Selected</a>, <a class="el" href="a05472.html#l00243">NLSOUND::CBackgroundSoundManager::TSoundData::Sound</a>, <a class="el" href="a05472.html#l00241">NLSOUND::CBackgroundSoundManager::TSoundData::SoundName</a>, <a class="el" href="a05472.html#l00245">NLSOUND::CBackgroundSoundManager::TSoundData::Source</a>, <a class="el" href="a05472.html#l00252">NLSOUND::CBackgroundSoundManager::TSoundData::Surface</a>, <a class="el" href="a05981.html#l00105">uint</a>, <a class="el" href="a06673.html#l00051">NLMISC::CVector::x</a>, and <a class="el" href="a06673.html#l00051">NLMISC::CVector::y</a>.
+<p>
+Referenced by <a class="el" href="a05471.html#l00149">addSound()</a>, <a class="el" href="a05471.html#l00334">loadSoundsFromPrimitives()</a>, and <a class="el" href="a05471.html#l00574">loadSoundsFromRegion()</a>.
+<p>
+<div class="fragment"><pre>00094 {
+00095 <a class="code" href="a02248.html#NLSOUND_1_1CBackgroundSoundManagern0">CAudioMixerUser</a> *mixer = CAudioMixerUser::instance();
+00096 TSoundData sd;
+00097
+00098 sd.SoundName = CStringMapper::map(soundName);
+00099 sd.Sound = mixer-&gt;getSoundId(sd.SoundName);
+00100 sd.Source = 0;
+00101
+00102 <span class="comment">// Copy the points</span>
+00103 sd.Points.resize (points.size ());
+00104 <span class="keywordflow">for</span> (<a class="code" href="a04558.html#a15">uint</a> i=0; i&lt;points.size (); i++)
+00105 sd.Points[i] = points[i];
+00106
+00107 sd.Selected = <span class="keyword">false</span>;
+00108 sd.IsPath = isPath;
+00109
+00110 <span class="keywordflow">if</span> (sd.Sound != 0)
+00111 {
+00112 <span class="comment">// the sound is available !</span>
+00113 <span class="comment">// compute bouding box/</span>
+00114 CVector vmin(FLT_MAX, FLT_MAX, 0), vmax(-FLT_MAX, -FLT_MAX, 0);
+00115
+00116 vector&lt;CVector&gt;::iterator first(sd.Points.begin()), last(sd.Points.end());
+00117 <span class="keywordflow">for</span> (; first != last; ++first)
+00118 {
+00119 vmin.x = <a class="code" href="a04061.html#a0">min</a>(first-&gt;x, vmin.x);
+00120 vmin.y = <a class="code" href="a04061.html#a0">min</a>(first-&gt;y, vmin.y);
+00121 vmax.x = max(first-&gt;x, vmax.x);
+00122 vmax.y = max(first-&gt;y, vmax.y);
+00123 }
+00124 sd.MaxBox = vmax;
+00125 sd.MinBox = vmin;
+00126
+00127 <span class="comment">// compute the surface without the sound distance</span>
+00128 sd.Surface = (vmax.x - vmin.x) * (vmax.y - vmin.y);
+00129
+00130 <span class="comment">// add the eard distance of the sound.</span>
+00131 <span class="keywordtype">float</span> dist = sd.Sound-&gt;getMaxDistance();
+00132 sd.MaxBox.x += dist;
+00133 sd.MaxBox.y += dist;
+00134 sd.MinBox.x -= dist;
+00135 sd.MinBox.y -= dist;
+00136
+00137 sd.MaxDist = dist;
+00138
+00139 <span class="comment">// store the sound. </span>
+00140 <span class="comment">// TODO : handle the three layer.</span>
+00141 <a class="code" href="a02248.html#NLSOUND_1_1CBackgroundSoundManagerz1296_0">_Layers</a>[layerId].push_back(sd);
+00142 }
+00143 <span class="keywordflow">else</span>
+00144 {
+00145 <a class="code" href="a04199.html#a2">nlwarning</a> (<span class="stringliteral">"The sound '%s' can't be loaded"</span>, CStringMapper::unmap(sd.SoundName).c_str());
+00146 }
+00147 }
+</pre></div> </td>
+ </tr>
+</table>
+<a class="anchor" name="NLSOUND_1_1CBackgroundSoundManagera0" doxytag="NLSOUND::CBackgroundSoundManager::getBackgroundFilterFades" ></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"> const <a class="el" href="a03920.html">UAudioMixer::TBackgroundFilterFades</a> &amp; NLSOUND::CBackgroundSoundManager::getBackgroundFilterFades </td>
+ <td class="md" valign="top">(&nbsp;</td>
+ <td class="mdname1" valign="top" nowrap> </td>
+ <td class="md" valign="top">&nbsp;)&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>
+
+<p>
+Definition at line <a class="el" href="a05471.html#l00087">87</a> of file <a class="el" href="a05471.html">background_sound_manager.cpp</a>.
+<p>
+References <a class="el" href="a05472.html#l00200">_BackgroundFilterFades</a>.
+<p>
+Referenced by <a class="el" href="a05465.html#l00829">NLSOUND::CAudioMixerUser::getBackgroundFilterFades()</a>.
+<p>
+<div class="fragment"><pre>00088 {
+00089 <span class="keywordflow">return</span> <a class="code" href="a02248.html#NLSOUND_1_1CBackgroundSoundManagerr0">_BackgroundFilterFades</a>;
+00090 }
+</pre></div> </td>
+ </tr>
+</table>
+<a class="anchor" name="NLSOUND_1_1CBackgroundSoundManagera1" doxytag="NLSOUND::CBackgroundSoundManager::getBackgroundFlags" ></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"> const <a class="el" href="a03921.html">UAudioMixer::TBackgroundFlags</a> &amp; NLSOUND::CBackgroundSoundManager::getBackgroundFlags </td>
+ <td class="md" valign="top">(&nbsp;</td>
+ <td class="mdname1" valign="top" nowrap> </td>
+ <td class="md" valign="top">&nbsp;)&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>
+Get the background flags.
+<p>
+
+<p>
+Definition at line <a class="el" href="a05471.html#l00076">76</a> of file <a class="el" href="a05471.html">background_sound_manager.cpp</a>.
+<p>
+References <a class="el" href="a05472.html#l00198">_BackgroundFlags</a>.
+<p>
+Referenced by <a class="el" href="a05465.html#l00825">NLSOUND::CAudioMixerUser::getBackgroundFlags()</a>.
+<p>
+<div class="fragment"><pre>00077 {
+00078 <span class="keywordflow">return</span> <a class="code" href="a02248.html#NLSOUND_1_1CBackgroundSoundManagerr1">_BackgroundFlags</a>;
+00079 }
+</pre></div> </td>
+ </tr>
+</table>
+<a class="anchor" name="NLSOUND_1_1CBackgroundSoundManagera2" doxytag="NLSOUND::CBackgroundSoundManager::getFilterValues" ></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"> const float* NLSOUND::CBackgroundSoundManager::getFilterValues </td>
+ <td class="md" valign="top">(&nbsp;</td>
+ <td class="mdname1" valign="top" nowrap> </td>
+ <td class="md" valign="top">&nbsp;)&nbsp;</td>
+ <td class="md" nowrap><code> [inline]</code></td>
+ </tr>
+
+ </table>
+ </td>
+ </tr>
+</table>
+<table cellspacing=5 cellpadding=0 border=0>
+ <tr>
+ <td>
+ &nbsp;
+ </td>
+ <td>
+
+<p>
+
+<p>
+Definition at line <a class="el" href="a05472.html#l00139">139</a> of file <a class="el" href="a05472.html">background_sound_manager.h</a>.
+<p>
+References <a class="el" href="a05472.html#l00204">_FilterFadeValues</a>.
+<p>
+Referenced by <a class="el" href="a05473.html#l00119">NLSOUND::CBackgroundSource::play()</a>.
+<p>
+<div class="fragment"><pre>00139 { <span class="keywordflow">return</span> <a class="code" href="a02248.html#NLSOUND_1_1CBackgroundSoundManagerr4">_FilterFadeValues</a>;}
+</pre></div> </td>
+ </tr>
+</table>
+<a class="anchor" name="NLSOUND_1_1CBackgroundSoundManagera3" doxytag="NLSOUND::CBackgroundSoundManager::getZone" ></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"> const std::vector&lt;<a class="el" href="a03128.html">NLMISC::CVector</a>&gt;&amp; NLSOUND::CBackgroundSoundManager::getZone </td>
+ <td class="md" valign="top">(&nbsp;</td>
+ <td class="md" nowrap valign="top"><a class="el" href="a04558.html#a11">uint32</a>&nbsp;</td>
+ <td class="mdname" nowrap> <em>zone</em>, </td>
+ </tr>
+ <tr>
+ <td class="md" nowrap align="right"></td>
+ <td></td>
+ <td class="md" nowrap>bool *&nbsp;</td>
+ <td class="mdname" nowrap> <em>isPath</em> = 0</td>
+ </tr>
+ <tr>
+ <td></td>
+ <td class="md">)&nbsp;</td>
+ <td class="md" colspan="2"></td>
+ </tr>
+
+ </table>
+ </td>
+ </tr>
+</table>
+<table cellspacing=5 cellpadding=0 border=0>
+ <tr>
+ <td>
+ &nbsp;
+ </td>
+ <td>
+
+<p>
+Return a patatoid. If isPath is not null, set it.
+<p>
+ </td>
+ </tr>
+</table>
+<a class="anchor" name="NLSOUND_1_1CBackgroundSoundManagera4" doxytag="NLSOUND::CBackgroundSoundManager::getZoneSourcePos" ></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"> CVector NLSOUND::CBackgroundSoundManager::getZoneSourcePos </td>
+ <td class="md" valign="top">(&nbsp;</td>
+ <td class="md" nowrap valign="top"><a class="el" href="a04558.html#a11">uint32</a>&nbsp;</td>
+ <td class="mdname1" valign="top" nowrap> <em>zone</em> </td>
+ <td class="md" valign="top">&nbsp;)&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>
+Return the position of the 3d source for a zone.
+<p>
+
+<p>
+Definition at line <a class="el" href="a05471.html#l01369">1369</a> of file <a class="el" href="a05471.html">background_sound_manager.cpp</a>.
+<p>
+References <a class="el" href="a05981.html#l00100">uint32</a>.
+<p>
+<div class="fragment"><pre>01370 {
+01371 <span class="comment">/* nlassert (zone&lt; BackgroundSounds.size());</span>
+01372 <span class="comment"> CVector pos;</span>
+01373 <span class="comment"> if (BackgroundSounds[zone].SourceDay != NULL)</span>
+01374 <span class="comment"> BackgroundSounds[zone].SourceDay-&gt;getPos(pos);</span>
+01375 <span class="comment"> return pos;</span>
+01376 <span class="comment">*/</span>
+01377 <span class="keywordflow">return</span> CVector();
+01378 }
+</pre></div> </td>
+ </tr>
+</table>
+<a class="anchor" name="NLSOUND_1_1CBackgroundSoundManagera5" doxytag="NLSOUND::CBackgroundSoundManager::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::CBackgroundSoundManager::load </td>
+ <td class="md" valign="top">(&nbsp;</td>
+ <td class="md" nowrap valign="top">const std::string &amp;&nbsp;</td>
+ <td class="mdname" nowrap> <em>continent</em>, </td>
+ </tr>
+ <tr>
+ <td class="md" nowrap align="right"></td>
+ <td></td>
+ <td class="md" nowrap><a class="el" href="a02756.html">NLLIGO::CLigoConfig</a> &amp;&nbsp;</td>
+ <td class="mdname" nowrap> <em>config</em></td>
+ </tr>
+ <tr>
+ <td></td>
+ <td class="md">)&nbsp;</td>
+ <td class="md" colspan="2"></td>
+ </tr>
+
+ </table>
+ </td>
+ </tr>
+</table>
+<table cellspacing=5 cellpadding=0 border=0>
+ <tr>
+ <td>
+ &nbsp;
+ </td>
+ <td>
+
+<p>
+Load background sound for a continent. It'll automatically unload the old continent before loading the new one. This method load the 'audio' regions (specifying the sounds), the 'effect' regions and the 'sample' regions. Continent is for example "matis" or "fyros". It'll add .prim to the continent name and lookup() to find zones. So, don't forget to add sound .prim in the CPath system for the lookup With the new primitive file, this method will try to load the .primitive file before attempting to load any .prim file. If the .primitive is found, then no .prim are loaded.
+<p>
+Definition at line <a class="el" href="a05471.html#l00618">618</a> of file <a class="el" href="a05471.html">background_sound_manager.cpp</a>.
+<p>
+References <a class="el" href="a05472.html#l00305">_FxZones</a>, <a class="el" href="a05472.html#l00265">_Layers</a>, <a class="el" href="a05472.html#l00051">NLSOUND::BACKGROUND_LAYER</a>, <a class="el" href="a05538.html#l02654">file</a>, <a class="el" href="a05466.html#l00275">NLSOUND::CAudioMixerUser::getPackedSheetPath()</a>, <a class="el" href="a05466.html#l00276">NLSOUND::CAudioMixerUser::getPackedSheetUpdate()</a>, <a class="el" href="a05788.html#l00056">H_AUTO</a>, <a class="el" href="a05471.html#l00272">loadAudioFromPrimitives()</a>, <a class="el" href="a05471.html#l00570">loadEffecsFromRegion()</a>, <a class="el" href="a05471.html#l00537">loadSamplesFromRegion()</a>, <a class="el" href="a05471.html#l00574">loadSoundsFromRegion()</a>, <a class="el" href="a05622.html#l00111">nlinfo</a>, <a class="el" href="a06195.html#l01759">NLLIGO::CPrimitives::read()</a>, <a class="el" href="a06196.html#l00535">NLLIGO::CPrimitives::RootNode</a>, <a class="el" href="a06195.html#l00928">NLLIGO::CPrimRegion::serial()</a>, <a class="el" href="a06462.html#l00232">NLMISC::IStream::serial()</a>, <a class="el" href="a06462.html#l00324">NLMISC::IStream::serialCont()</a>, <a class="el" href="a05981.html#l00105">uint</a>, <a class="el" href="a05981.html#l00100">uint32</a>, and <a class="el" href="a06196.html#l00503">NLLIGO::CPrimRegion::VZones</a>.
+<p>
+Referenced by <a class="el" href="a05465.html#l02131">NLSOUND::CAudioMixerUser::loadBackgroundSound()</a>.
+<p>
+<div class="fragment"><pre>00619 {
+00620 NL_ALLOC_CONTEXT(NLSOUND_CBackgroundSoundManager);
+00621 <a class="code" href="a04558.html#a11">uint32</a> PACKED_VERSION = 1;
+00622 <span class="comment">// First, try to load from a .primitive file (contain everythink)</span>
+00623 {
+00624 <a class="code" href="a02653.html">CIFile</a> <a class="code" href="a04115.html#a95">file</a>;
+00625 <span class="comment">// CPrimRegion region;</span>
+00626 <a class="code" href="a03117.html">CPrimitives</a> primitives;
+00627 primitives.<a class="code" href="a03117.html#NLLIGO_1_1CPrimitiveso0">RootNode</a> = <span class="keyword">new</span> <a class="code" href="a03122.html">CPrimNode</a>;
+00628 string fn = continent+<span class="stringliteral">"_audio.primitive"</span>;
+00629
+00630 string path = CPath::lookup(fn, <span class="keyword">false</span>);
+00631
+00632 <span class="keywordflow">if</span>(!path.empty() &amp;&amp; <a class="code" href="a04115.html#a95">file</a>.open (path))
+00633 {
+00634 <span class="comment">// first, try to load the binary version (if up to date)</span>
+00635 {
+00636 <a class="code" href="a04558.html#a11">uint32</a> version;
+00637 string <a class="code" href="a05377.html#a2">filename</a> = continent+<span class="stringliteral">".background_primitive"</span>;
+00638 string binPath = CPath::lookup(filename, <span class="keyword">false</span>, <span class="keyword">false</span>, <span class="keyword">false</span>);
+00639 <span class="keywordflow">if</span> (!binPath.empty()
+00640 &amp;&amp; (CFile::getFileModificationDate(binPath) &gt; CFile::getFileModificationDate(path)))
+00641 {
+00642 <a class="code" href="a02653.html">CIFile</a> binFile(binPath);
+00643 binFile.<a class="code" href="a02270.html#NLMISC_1_1IStreama5">serial</a>(version);
+00644
+00645 <span class="keywordflow">if</span> (version == PACKED_VERSION)
+00646 {
+00647 <a class="code" href="a04199.html#a1">nlinfo</a> (<span class="stringliteral">"loading '%s'"</span>, <a class="code" href="a05377.html#a2">filename</a>.c_str());
+00648 <a class="code" href="a02248.html#NLSOUND_1_1CBackgroundSoundManagerz1295_0">_Banks</a>.clear();
+00649 binFile.<a class="code" href="a02270.html#NLMISC_1_1IStreamz2033_9">serialCont</a>(_Banks);
+00650 <span class="keywordflow">for</span> (<a class="code" href="a04558.html#a15">uint</a> i=0; i&lt;<a class="code" href="a05381.html#a4">BACKGROUND_LAYER</a>; ++i)
+00651 {
+00652 <a class="code" href="a02248.html#NLSOUND_1_1CBackgroundSoundManagerz1296_0">_Layers</a>[i].clear();
+00653 binFile.<a class="code" href="a02270.html#NLMISC_1_1IStreamz2033_9">serialCont</a>(_Layers[i]);
+00654 }
+00655 <a class="code" href="a02248.html#NLSOUND_1_1CBackgroundSoundManagerr5">_FxZones</a>.clear();
+00656 binFile.<a class="code" href="a02270.html#NLMISC_1_1IStreamz2033_9">serialCont</a>(_FxZones);
+00657
+00658 <span class="comment">// jobs done !</span>
+00659 <span class="keywordflow">return</span>;
+00660 }
+00661 }
+00662 }
+00663
+00664 <a class="code" href="a04199.html#a1">nlinfo</a> (<span class="stringliteral">"loading '%s'"</span>, fn.c_str());
+00665
+00666 CIXml xml;
+00667 {
+00668 <a class="code" href="a04365.html#a4">H_AUTO</a>(BackgroundSoundMangerLoad_xml_init);
+00669 xml.init (file);
+00670 }
+00671
+00672 {
+00673 <a class="code" href="a04365.html#a4">H_AUTO</a>(BackgroundSoundMangerLoad_primitive_read);
+00674 primitives.<a class="code" href="a03117.html#NLLIGO_1_1CPrimitivesa4">read</a>(xml.getRootNode(), fn.c_str(), config);
+00675 }
+00676 <span class="comment">// region.serial(xml);</span>
+00677 <a class="code" href="a04115.html#a95">file</a>.close ();
+00678
+00679 {
+00680 <a class="code" href="a04365.html#a4">H_AUTO</a>(BackgroundSoundMangerLoad_loadAudioFromPrimitive);
+00681 <a class="code" href="a02248.html#NLSOUND_1_1CBackgroundSoundManagera6">loadAudioFromPrimitives</a>(*primitives.<a class="code" href="a03117.html#NLLIGO_1_1CPrimitiveso0">RootNode</a>);
+00682 }
+00683
+00684 <span class="comment">// store the binary version of the audio primitive for later use</span>
+00685 <a class="code" href="a02248.html#NLSOUND_1_1CBackgroundSoundManagern0">CAudioMixerUser</a> *mixer = CAudioMixerUser::instance();
+00686 <span class="keywordflow">if</span> (mixer-&gt;getPackedSheetUpdate())
+00687 {
+00688 <span class="comment">// need to update packed sheet, so write the binary primitive version</span>
+00689 string <a class="code" href="a05377.html#a2">filename</a> = mixer-&gt;getPackedSheetPath()+<span class="stringliteral">"/"</span>+continent+<span class="stringliteral">".background_primitive"</span>;
+00690 <a class="code" href="a03011.html">COFile</a> <a class="code" href="a04115.html#a95">file</a>(filename);
+00691
+00692 <a class="code" href="a04115.html#a95">file</a>.serial(PACKED_VERSION);
+00693 <a class="code" href="a04115.html#a95">file</a>.serialCont(_Banks);
+00694 <span class="keywordflow">for</span> (<a class="code" href="a04558.html#a15">uint</a> i=0; i&lt;<a class="code" href="a05381.html#a4">BACKGROUND_LAYER</a>; ++i)
+00695 <a class="code" href="a04115.html#a95">file</a>.serialCont(_Layers[i]);
+00696 <a class="code" href="a04115.html#a95">file</a>.serialCont(_FxZones);
+00697 }
+00698
+00700 <span class="comment">// Jobs done !</span>
+00701 <span class="keywordflow">return</span>;
+00702 }
+00703
+00704 }
+00705
+00706 <span class="comment">// We reach this only if the new .primitive file format is not found</span>
+00707 <span class="comment">// then, we try to load separate .prim file for sound, samples and fx</span>
+00708
+00709 <span class="comment">// load the sound.</span>
+00710 {
+00711 <a class="code" href="a02653.html">CIFile</a> <a class="code" href="a04115.html#a95">file</a>;
+00712 <a class="code" href="a03126.html">CPrimRegion</a> region;
+00713 string fn = continent+<span class="stringliteral">"_audio.prim"</span>;
+00714
+00715 <a class="code" href="a04199.html#a1">nlinfo</a> (<span class="stringliteral">"loading '%s'"</span>, fn.c_str());
+00716
+00717 string path = CPath::lookup(fn, <span class="keyword">false</span>);
+00718
+00719 <span class="keywordflow">if</span>(!path.empty() &amp;&amp; <a class="code" href="a04115.html#a95">file</a>.open (path))
+00720 {
+00721 CIXml xml;
+00722 xml.init (file);
+00723 region.<a class="code" href="a03126.html#NLLIGO_1_1CPrimRegiona0">serial</a>(xml);
+00724 <a class="code" href="a04115.html#a95">file</a>.close ();
+00725
+00726 <a class="code" href="a04199.html#a1">nlinfo</a> (<span class="stringliteral">"Region '%s' contains %d zones for the background sounds"</span>, continent.c_str(), region.<a class="code" href="a03126.html#NLLIGO_1_1CPrimRegiono6">VZones</a>.size());
+00727
+00728 <a class="code" href="a02248.html#NLSOUND_1_1CBackgroundSoundManagera9">loadSoundsFromRegion</a>(region);
+00729 }
+00730 }
+00731 <span class="comment">// load the effect.</span>
+00732 {
+00733 <a class="code" href="a02653.html">CIFile</a> <a class="code" href="a04115.html#a95">file</a>;
+00734 <a class="code" href="a03126.html">CPrimRegion</a> region;
+00735 string fn = continent+<span class="stringliteral">"_effects.prim"</span>;
+00736
+00737 <a class="code" href="a04199.html#a1">nlinfo</a> (<span class="stringliteral">"loading '%s'"</span>, fn.c_str());
+00738
+00739 string path = CPath::lookup(fn, <span class="keyword">false</span>);
+00740
+00741 <span class="keywordflow">if</span>(!path.empty() &amp;&amp; <a class="code" href="a04115.html#a95">file</a>.open (path))
+00742 {
+00743 CIXml xml;
+00744 xml.init (file);
+00745 region.<a class="code" href="a03126.html#NLLIGO_1_1CPrimRegiona0">serial</a>(xml);
+00746 <a class="code" href="a04115.html#a95">file</a>.close ();
+00747
+00748 <a class="code" href="a04199.html#a1">nlinfo</a> (<span class="stringliteral">"Region '%s' contains %d zones for the background effetcs"</span>, continent.c_str(), region.<a class="code" href="a03126.html#NLLIGO_1_1CPrimRegiono6">VZones</a>.size());
+00749
+00750 <a class="code" href="a02248.html#NLSOUND_1_1CBackgroundSoundManagera7">loadEffecsFromRegion</a>(region);
+00751 }
+00752 }
+00753 <span class="comment">// load the samples banks.</span>
+00754 {
+00755 <a class="code" href="a02653.html">CIFile</a> <a class="code" href="a04115.html#a95">file</a>;
+00756 <a class="code" href="a03126.html">CPrimRegion</a> region;
+00757 string fn = continent+<span class="stringliteral">"_samples.prim"</span>;
+00758
+00759 <a class="code" href="a04199.html#a1">nlinfo</a> (<span class="stringliteral">"loading '%s'"</span>, fn.c_str());
+00760
+00761 string path = CPath::lookup(fn, <span class="keyword">false</span>);
+00762
+00763 <span class="keywordflow">if</span>(!path.empty() &amp;&amp; <a class="code" href="a04115.html#a95">file</a>.open (path))
+00764 {
+00765 CIXml xml;
+00766 xml.init (file);
+00767 region.<a class="code" href="a03126.html#NLLIGO_1_1CPrimRegiona0">serial</a>(xml);
+00768 <a class="code" href="a04115.html#a95">file</a>.close ();
+00769
+00770 <a class="code" href="a04199.html#a1">nlinfo</a> (<span class="stringliteral">"Region '%s' contains %d zones for the background samples banks"</span>, continent.c_str(), region.<a class="code" href="a03126.html#NLLIGO_1_1CPrimRegiono6">VZones</a>.size());
+00771
+00772 <a class="code" href="a02248.html#NLSOUND_1_1CBackgroundSoundManagera8">loadSamplesFromRegion</a>(region);
+00773 }
+00774 }
+00775 }
+</pre></div> </td>
+ </tr>
+</table>
+<a class="anchor" name="NLSOUND_1_1CBackgroundSoundManagera6" doxytag="NLSOUND::CBackgroundSoundManager::loadAudioFromPrimitives" ></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::CBackgroundSoundManager::loadAudioFromPrimitives </td>
+ <td class="md" valign="top">(&nbsp;</td>
+ <td class="md" nowrap valign="top">const <a class="el" href="a03123.html">NLLIGO::IPrimitive</a> &amp;&nbsp;</td>
+ <td class="mdname1" valign="top" nowrap> <em>audioRoot</em> </td>
+ <td class="md" valign="top">&nbsp;)&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>
+Load the sounds, effects and sample banks from a region class.
+<p>
+Definition at line <a class="el" href="a05471.html#l00272">272</a> of file <a class="el" href="a05471.html">background_sound_manager.cpp</a>.
+<p>
+References <a class="el" href="a05472.html#l00195">_Playing</a>, <a class="el" href="a06195.html#l01287">NLLIGO::IPrimitive::getChild()</a>, <a class="el" href="a06196.html#l00183">NLLIGO::IPrimitive::getNumChildren()</a>, <a class="el" href="a06195.html#l01102">NLLIGO::IPrimitive::getPropertyByName()</a>, <a class="el" href="a05471.html#l00441">loadEffectsFromPrimitives()</a>, <a class="el" href="a05471.html#l00410">loadSamplesFromPrimitives()</a>, <a class="el" href="a05471.html#l00334">loadSoundsFromPrimitives()</a>, <a class="el" href="a05471.html#l00778">play()</a>, <a class="el" href="a05981.html#l00105">uint</a>, and <a class="el" href="a05471.html#l00823">unload()</a>.
+<p>
+Referenced by <a class="el" href="a05471.html#l00618">load()</a>, and <a class="el" href="a05465.html#l02116">NLSOUND::CAudioMixerUser::loadBackgroundAudioFromPrimitives()</a>.
+<p>
+<div class="fragment"><pre>00273 {
+00274 std::string className;
+00275 <span class="keywordflow">if</span>(audioRoot.<a class="code" href="a03123.html#NLLIGO_1_1IPrimitivez1900_14">getPropertyByName</a>(<span class="stringliteral">"class"</span>, className))
+00276 {
+00277 <span class="keywordflow">if</span> (className == <span class="stringliteral">"audio"</span>)
+00278 {
+00279 <span class="comment">// ok, it a root of the audio primitives</span>
+00280
+00281 <span class="comment">// remember playing state</span>
+00282 <span class="keywordtype">bool</span> oldState = <a class="code" href="a02248.html#NLSOUND_1_1CBackgroundSoundManagerr8">_Playing</a>;
+00283 <a class="code" href="a02248.html#NLSOUND_1_1CBackgroundSoundManagera15">unload</a>();
+00284
+00285 <span class="keywordflow">for</span> (<a class="code" href="a04558.html#a15">uint</a> i=0; i&lt;audioRoot.<a class="code" href="a03123.html#NLLIGO_1_1IPrimitivez1899_3">getNumChildren</a>(); ++i)
+00286 {
+00287 <span class="keyword">const</span> <a class="code" href="a03123.html">NLLIGO::IPrimitive</a> *child;
+00288
+00289 audioRoot.<a class="code" href="a03123.html#NLLIGO_1_1IPrimitivez1899_1">getChild</a>(child, i);
+00290
+00291 <span class="keywordflow">if</span> (child-&gt;<a class="code" href="a03123.html#NLLIGO_1_1IPrimitivez1900_14">getPropertyByName</a>(<span class="stringliteral">"class"</span>, className))
+00292 {
+00293 <span class="keywordflow">if</span> (className == <span class="stringliteral">"sounds"</span>)
+00294 {
+00295 <a class="code" href="a02248.html#NLSOUND_1_1CBackgroundSoundManagerd7">loadSoundsFromPrimitives</a>(*child);
+00296 }
+00297 <span class="keywordflow">else</span> <span class="keywordflow">if</span> (className == <span class="stringliteral">"sample_banks"</span>)
+00298 {
+00299 <a class="code" href="a02248.html#NLSOUND_1_1CBackgroundSoundManagerd6">loadSamplesFromPrimitives</a>(*child);
+00300 }
+00301 <span class="keywordflow">else</span> <span class="keywordflow">if</span> (className == <span class="stringliteral">"env_fx"</span>)
+00302 {
+00303 <a class="code" href="a02248.html#NLSOUND_1_1CBackgroundSoundManagerd5">loadEffectsFromPrimitives</a>(*child);
+00304 }
+00305 }
+00306 }
+00307
+00308 <span class="keywordflow">if</span> (oldState)
+00309 <a class="code" href="a02248.html#NLSOUND_1_1CBackgroundSoundManagera10">play</a>();
+00310 }
+00311 }
+00312 <span class="keywordflow">else</span>
+00313 {
+00314 <span class="comment">// try to look in the first child level</span>
+00315 <span class="keywordflow">for</span> (<a class="code" href="a04558.html#a15">uint</a> i=0; i&lt;audioRoot.<a class="code" href="a03123.html#NLLIGO_1_1IPrimitivez1899_3">getNumChildren</a>(); ++i)
+00316 {
+00317 <span class="keyword">const</span> <a class="code" href="a03123.html">NLLIGO::IPrimitive</a> *child;
+00318 audioRoot.<a class="code" href="a03123.html#NLLIGO_1_1IPrimitivez1899_1">getChild</a>(child, i);
+00319
+00320 <span class="keywordflow">if</span> (child-&gt;<a class="code" href="a03123.html#NLLIGO_1_1IPrimitivez1900_14">getPropertyByName</a>(<span class="stringliteral">"class"</span>, className))
+00321 {
+00322 <span class="keywordflow">if</span> (className == <span class="stringliteral">"audio"</span>)
+00323 {
+00324 <span class="comment">// recurse in this node</span>
+00325 <a class="code" href="a02248.html#NLSOUND_1_1CBackgroundSoundManagera6">loadAudioFromPrimitives</a>(*child);
+00326 <span class="comment">// don't look any other primitives</span>
+00327 <span class="keywordflow">break</span>;
+00328 }
+00329 }
+00330 }
+00331 }
+00332 }
+</pre></div> </td>
+ </tr>
+</table>
+<a class="anchor" name="NLSOUND_1_1CBackgroundSoundManagera7" doxytag="NLSOUND::CBackgroundSoundManager::loadEffecsFromRegion" ></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::CBackgroundSoundManager::loadEffecsFromRegion </td>
+ <td class="md" valign="top">(&nbsp;</td>
+ <td class="md" nowrap valign="top">const <a class="el" href="a03126.html">NLLIGO::CPrimRegion</a> &amp;&nbsp;</td>
+ <td class="mdname1" valign="top" nowrap> <em>region</em> </td>
+ <td class="md" valign="top">&nbsp;)&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>
+Load the effects from a CPrimRegion class. deprecated
+<p>
+Definition at line <a class="el" href="a05471.html#l00570">570</a> of file <a class="el" href="a05471.html">background_sound_manager.cpp</a>.
+<p>
+Referenced by <a class="el" href="a05471.html#l00618">load()</a>, and <a class="el" href="a05465.html#l02107">NLSOUND::CAudioMixerUser::loadBackgroundEffectsFromRegion()</a>.
+<p>
+<div class="fragment"><pre>00571 {
+00572 }
+</pre></div> </td>
+ </tr>
+</table>
+<a class="anchor" name="NLSOUND_1_1CBackgroundSoundManagerd5" doxytag="NLSOUND::CBackgroundSoundManager::loadEffectsFromPrimitives" ></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::CBackgroundSoundManager::loadEffectsFromPrimitives </td>
+ <td class="md" valign="top">(&nbsp;</td>
+ <td class="md" nowrap valign="top">const <a class="el" href="a03123.html">NLLIGO::IPrimitive</a> &amp;&nbsp;</td>
+ <td class="mdname1" valign="top" nowrap> <em>fxRoot</em> </td>
+ <td class="md" valign="top">&nbsp;)&nbsp;</td>
+ <td class="md" nowrap><code> [private]</code></td>
+ </tr>
+
+ </table>
+ </td>
+ </tr>
+</table>
+<table cellspacing=5 cellpadding=0 border=0>
+ <tr>
+ <td>
+ &nbsp;
+ </td>
+ <td>
+
+<p>
+Load the sounds from primitive
+<p>
+Definition at line <a class="el" href="a05471.html#l00441">441</a> of file <a class="el" href="a05471.html">background_sound_manager.cpp</a>.
+<p>
+References <a class="el" href="a05472.html#l00305">_FxZones</a>, <a class="el" href="a05471.html#l00473">addFxZone()</a>, <a class="el" href="a06195.html#l01287">NLLIGO::IPrimitive::getChild()</a>, <a class="el" href="a06196.html#l00183">NLLIGO::IPrimitive::getNumChildren()</a>, <a class="el" href="a06195.html#l01102">NLLIGO::IPrimitive::getPropertyByName()</a>, and <a class="el" href="a05981.html#l00105">uint</a>.
+<p>
+Referenced by <a class="el" href="a05471.html#l00272">loadAudioFromPrimitives()</a>.
+<p>
+<div class="fragment"><pre>00442 {
+00443 std::string className;
+00444 <a class="code" href="a02248.html#NLSOUND_1_1CBackgroundSoundManagerr5">_FxZones</a>.clear();
+00445
+00446 <span class="keywordflow">if</span> (fxRoot.<a class="code" href="a03123.html#NLLIGO_1_1IPrimitivez1900_14">getPropertyByName</a>(<span class="stringliteral">"class"</span>, className))
+00447 {
+00448 <span class="keywordflow">if</span> (className == <span class="stringliteral">"env_fx"</span>)
+00449 {
+00450 <span class="keywordflow">for</span> (<a class="code" href="a04558.html#a15">uint</a> i=0; i&lt;fxRoot.<a class="code" href="a03123.html#NLLIGO_1_1IPrimitivez1899_3">getNumChildren</a>(); ++i)
+00451 {
+00452 <span class="keyword">const</span> <a class="code" href="a03123.html">NLLIGO::IPrimitive</a> *child;
+00453 std::string primName;
+00454 fxRoot.<a class="code" href="a03123.html#NLLIGO_1_1IPrimitivez1899_1">getChild</a>(child, i);
+00455
+00456 <span class="keywordflow">if</span> (child-&gt;<a class="code" href="a03123.html#NLLIGO_1_1IPrimitivez1900_14">getPropertyByName</a>(<span class="stringliteral">"class"</span>, className))
+00457 {
+00458 child-&gt;<a class="code" href="a03123.html#NLLIGO_1_1IPrimitivez1900_14">getPropertyByName</a>(<span class="stringliteral">"name"</span>, primName);
+00459 <span class="keywordflow">if</span> (className == <span class="stringliteral">"env_fx_zone"</span>)
+00460 {
+00461 std::string fxName;
+00462 <span class="keywordflow">if</span> (child-&gt;<a class="code" href="a03123.html#NLLIGO_1_1IPrimitivez1900_14">getPropertyByName</a>(<span class="stringliteral">"fx_name"</span>, fxName))
+00463 {
+00464 <a class="code" href="a02248.html#NLSOUND_1_1CBackgroundSoundManagerd0">addFxZone</a>(fxName, static_cast&lt;const CPrimZone*&gt;(child)-&gt;VPoints);
+00465 }
+00466 }
+00467 }
+00468 }
+00469 }
+00470 }
+00471 }
+</pre></div> </td>
+ </tr>
+</table>
+<a class="anchor" name="NLSOUND_1_1CBackgroundSoundManagerd6" doxytag="NLSOUND::CBackgroundSoundManager::loadSamplesFromPrimitives" ></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::CBackgroundSoundManager::loadSamplesFromPrimitives </td>
+ <td class="md" valign="top">(&nbsp;</td>
+ <td class="md" nowrap valign="top">const <a class="el" href="a03123.html">NLLIGO::IPrimitive</a> &amp;&nbsp;</td>
+ <td class="mdname1" valign="top" nowrap> <em>sampleRoot</em> </td>
+ <td class="md" valign="top">&nbsp;)&nbsp;</td>
+ <td class="md" nowrap><code> [private]</code></td>
+ </tr>
+
+ </table>
+ </td>
+ </tr>
+</table>
+<table cellspacing=5 cellpadding=0 border=0>
+ <tr>
+ <td>
+ &nbsp;
+ </td>
+ <td>
+
+<p>
+Load the sample banks from primitive
+<p>
+Definition at line <a class="el" href="a05471.html#l00410">410</a> of file <a class="el" href="a05471.html">background_sound_manager.cpp</a>.
+<p>
+References <a class="el" href="a05471.html#l00502">addSampleBank()</a>, <a class="el" href="a06195.html#l01287">NLLIGO::IPrimitive::getChild()</a>, <a class="el" href="a06196.html#l00183">NLLIGO::IPrimitive::getNumChildren()</a>, <a class="el" href="a06195.html#l01102">NLLIGO::IPrimitive::getPropertyByName()</a>, and <a class="el" href="a05981.html#l00105">uint</a>.
+<p>
+Referenced by <a class="el" href="a05471.html#l00272">loadAudioFromPrimitives()</a>.
+<p>
+<div class="fragment"><pre>00411 {
+00412 std::string className;
+00413 <a class="code" href="a02248.html#NLSOUND_1_1CBackgroundSoundManagerz1295_0">_Banks</a>.clear();
+00414 <span class="keywordflow">if</span> (sampleRoot.<a class="code" href="a03123.html#NLLIGO_1_1IPrimitivez1900_14">getPropertyByName</a>(<span class="stringliteral">"class"</span>, className))
+00415 {
+00416 <span class="keywordflow">if</span> (className == <span class="stringliteral">"sample_banks"</span>)
+00417 {
+00418 <span class="keywordflow">for</span> (<a class="code" href="a04558.html#a15">uint</a> i=0; i&lt;sampleRoot.<a class="code" href="a03123.html#NLLIGO_1_1IPrimitivez1899_3">getNumChildren</a>(); ++i)
+00419 {
+00420 <span class="keyword">const</span> <a class="code" href="a03123.html">NLLIGO::IPrimitive</a> *child;
+00421 std::string primName;
+00422 sampleRoot.<a class="code" href="a03123.html#NLLIGO_1_1IPrimitivez1899_1">getChild</a>(child, i);
+00423
+00424 <span class="keywordflow">if</span> (child-&gt;<a class="code" href="a03123.html#NLLIGO_1_1IPrimitivez1900_14">getPropertyByName</a>(<span class="stringliteral">"class"</span>, className))
+00425 {
+00426 child-&gt;<a class="code" href="a03123.html#NLLIGO_1_1IPrimitivez1900_14">getPropertyByName</a>(<span class="stringliteral">"name"</span>, primName);
+00427 <span class="keywordflow">if</span> (className == <span class="stringliteral">"sample_bank_zone"</span>)
+00428 {
+00429 <span class="keyword">const</span> std::vector&lt;std::string&gt; *names;
+00430 <span class="keywordflow">if</span> (child-&gt;<a class="code" href="a03123.html#NLLIGO_1_1IPrimitivez1900_14">getPropertyByName</a>(<span class="stringliteral">"bank_names"</span>, names))
+00431 {
+00432 <a class="code" href="a02248.html#NLSOUND_1_1CBackgroundSoundManagerd1">addSampleBank</a>(*names, static_cast&lt;const CPrimZone*&gt;(child)-&gt;VPoints);
+00433 }
+00434 }
+00435 }
+00436 }
+00437 }
+00438 }
+00439 }
+</pre></div> </td>
+ </tr>
+</table>
+<a class="anchor" name="NLSOUND_1_1CBackgroundSoundManagera8" doxytag="NLSOUND::CBackgroundSoundManager::loadSamplesFromRegion" ></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::CBackgroundSoundManager::loadSamplesFromRegion </td>
+ <td class="md" valign="top">(&nbsp;</td>
+ <td class="md" nowrap valign="top">const <a class="el" href="a03126.html">NLLIGO::CPrimRegion</a> &amp;&nbsp;</td>
+ <td class="mdname1" valign="top" nowrap> <em>region</em> </td>
+ <td class="md" valign="top">&nbsp;)&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>
+Load the samples banks from a CPrimRegion class. deprecated
+<p>
+Definition at line <a class="el" href="a05471.html#l00537">537</a> of file <a class="el" href="a05471.html">background_sound_manager.cpp</a>.
+<p>
+References <a class="el" href="a05471.html#l00502">addSampleBank()</a>, <a class="el" href="a05622.html#l00135">nlwarning</a>, <a class="el" href="a05472.html#l00171">split()</a>, <a class="el" href="a05981.html#l00105">uint</a>, and <a class="el" href="a06196.html#l00503">NLLIGO::CPrimRegion::VZones</a>.
+<p>
+Referenced by <a class="el" href="a05471.html#l00618">load()</a>, and <a class="el" href="a05465.html#l02111">NLSOUND::CAudioMixerUser::loadBackgroundSamplesFromRegion()</a>.
+<p>
+<div class="fragment"><pre>00538 {
+00539 <a class="code" href="a02248.html#NLSOUND_1_1CBackgroundSoundManagerz1295_0">_Banks</a>.clear();
+00540
+00541 <span class="keywordflow">for</span> (<a class="code" href="a04558.html#a15">uint</a> i=0; i&lt; region.<a class="code" href="a03126.html#NLLIGO_1_1CPrimRegiono6">VZones</a>.size(); ++i)
+00542 {
+00543 <span class="keywordflow">if</span> (region.<a class="code" href="a03126.html#NLLIGO_1_1CPrimRegiono6">VZones</a>[i].VPoints.size() &gt; 2)
+00544 {
+00545 <span class="comment">// parse the zone name to find the samples name.</span>
+00546 std::vector&lt;std::string&gt; splitted = <a class="code" href="a02248.html#NLSOUND_1_1CBackgroundSoundManagerd9">split</a>(region.<a class="code" href="a03126.html#NLLIGO_1_1CPrimRegiono6">VZones</a>[i].Name, <span class="charliteral">'-'</span>);
+00547 std::vector&lt;std::string&gt; bankNames;
+00548
+00549 <span class="keywordflow">if</span> (splitted.size() &gt; 2)
+00550 {
+00551 <span class="keywordflow">for</span> (<a class="code" href="a04558.html#a15">uint</a> j=1; j&lt;splitted.size()-1; ++j)
+00552 {
+00553 bankNames.push_back(splitted[j]);
+00554 }
+00555
+00556 <a class="code" href="a02248.html#NLSOUND_1_1CBackgroundSoundManagerd1">addSampleBank</a>(bankNames, region.<a class="code" href="a03126.html#NLLIGO_1_1CPrimRegiono6">VZones</a>[i].VPoints);
+00557 }
+00558 <span class="keywordflow">else</span>
+00559 {
+00560 <a class="code" href="a04199.html#a2">nlwarning</a> (<span class="stringliteral">"A sample bank patatoid name did'nt contains banks name '%s'"</span>, region.<a class="code" href="a03126.html#NLLIGO_1_1CPrimRegiono6">VZones</a>[i].Name.c_str());
+00561 }
+00562 }
+00563 <span class="keywordflow">else</span>
+00564 {
+00565 <a class="code" href="a04199.html#a2">nlwarning</a> (<span class="stringliteral">"A sample bank patatoid have less than 3 points '%s'"</span>, region.<a class="code" href="a03126.html#NLLIGO_1_1CPrimRegiono6">VZones</a>[i].Name.c_str());
+00566 }
+00567 }
+00568 }
+</pre></div> </td>
+ </tr>
+</table>
+<a class="anchor" name="NLSOUND_1_1CBackgroundSoundManagerd7" doxytag="NLSOUND::CBackgroundSoundManager::loadSoundsFromPrimitives" ></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::CBackgroundSoundManager::loadSoundsFromPrimitives </td>
+ <td class="md" valign="top">(&nbsp;</td>
+ <td class="md" nowrap valign="top">const <a class="el" href="a03123.html">NLLIGO::IPrimitive</a> &amp;&nbsp;</td>
+ <td class="mdname1" valign="top" nowrap> <em>soundRoot</em> </td>
+ <td class="md" valign="top">&nbsp;)&nbsp;</td>
+ <td class="md" nowrap><code> [private]</code></td>
+ </tr>
+
+ </table>
+ </td>
+ </tr>
+</table>
+<table cellspacing=5 cellpadding=0 border=0>
+ <tr>
+ <td>
+ &nbsp;
+ </td>
+ <td>
+
+<p>
+Load the sounds from primitive
+<p>
+Definition at line <a class="el" href="a05471.html#l00334">334</a> of file <a class="el" href="a05471.html">background_sound_manager.cpp</a>.
+<p>
+References <a class="el" href="a05471.html#l00093">addSound()</a>, <a class="el" href="a05472.html#l00051">NLSOUND::BACKGROUND_LAYER</a>, <a class="el" href="a05587.html#l00115">NLMISC::clamp()</a>, <a class="el" href="a06195.html#l01287">NLLIGO::IPrimitive::getChild()</a>, <a class="el" href="a06196.html#l00183">NLLIGO::IPrimitive::getNumChildren()</a>, <a class="el" href="a03123.html#NLLIGO_1_1IPrimitivez1900_3">NLLIGO::IPrimitive::getNumVector()</a>, <a class="el" href="a06195.html#l01102">NLLIGO::IPrimitive::getPropertyByName()</a>, <a class="el" href="a05622.html#l00135">nlwarning</a>, and <a class="el" href="a05981.html#l00105">uint</a>.
+<p>
+Referenced by <a class="el" href="a05471.html#l00272">loadAudioFromPrimitives()</a>.
+<p>
+<div class="fragment"><pre>00335 {
+00336 std::string className;
+00337 <span class="keywordflow">if</span> (soundRoot.<a class="code" href="a03123.html#NLLIGO_1_1IPrimitivez1900_14">getPropertyByName</a>(<span class="stringliteral">"class"</span>, className))
+00338 {
+00339 <span class="keywordflow">if</span> (className == <span class="stringliteral">"sounds"</span> || className == <span class="stringliteral">"sound_folder"</span>)
+00340 {
+00341 <span class="comment">// ok, it sounds or a sounds foilder</span>
+00342 <span class="keywordflow">for</span> (<a class="code" href="a04558.html#a15">uint</a> i=0; i&lt;soundRoot.<a class="code" href="a03123.html#NLLIGO_1_1IPrimitivez1899_3">getNumChildren</a>(); ++i)
+00343 {
+00344 <span class="keyword">const</span> <a class="code" href="a03123.html">NLLIGO::IPrimitive</a> *child;
+00345 std::string primName;
+00346 soundRoot.<a class="code" href="a03123.html#NLLIGO_1_1IPrimitivez1899_1">getChild</a>(child, i);
+00347
+00348
+00349 <span class="keywordflow">if</span> (child-&gt;<a class="code" href="a03123.html#NLLIGO_1_1IPrimitivez1900_14">getPropertyByName</a>(<span class="stringliteral">"class"</span>, className))
+00350 {
+00351 <a class="code" href="a04558.html#a15">uint</a> layerId = 0;
+00352 std::string layerString;
+00353 std::string soundName;
+00354 <span class="keywordflow">if</span> (child-&gt;<a class="code" href="a03123.html#NLLIGO_1_1IPrimitivez1900_14">getPropertyByName</a>(<span class="stringliteral">"layer"</span>, layerString))
+00355 {
+00356 <span class="comment">// extract layer number.</span>
+00357 <span class="keywordflow">if</span> (!layerString.empty())
+00358 {
+00359 <span class="comment">// TODO : handle special case for weather layer</span>
+00360 layerId = layerString[layerString.size()-1] - <span class="charliteral">'0'</span>;
+00361 }
+00362 <a class="code" href="a05378.html#a374">clamp</a>(layerId, 0u, BACKGROUND_LAYER-1);
+00363 }
+00364
+00365 child-&gt;<a class="code" href="a03123.html#NLLIGO_1_1IPrimitivez1900_14">getPropertyByName</a>(<span class="stringliteral">"name"</span>, primName);
+00366 child-&gt;<a class="code" href="a03123.html#NLLIGO_1_1IPrimitivez1900_14">getPropertyByName</a>(<span class="stringliteral">"sound"</span>, soundName);
+00367 <span class="comment">// compatibility with older primitive</span>
+00368 <span class="keywordflow">if</span> (soundName.empty())
+00369 soundName = primName;
+00370
+00371 <span class="keywordflow">if</span> (className == <span class="stringliteral">"sound_zone"</span>)
+00372 {
+00373 <span class="keywordflow">if</span>(child-&gt;<a class="code" href="a03123.html#NLLIGO_1_1IPrimitivez1900_3">getNumVector</a>()&gt;2)
+00374 {
+00375 <a class="code" href="a02248.html#NLSOUND_1_1CBackgroundSoundManagerd3">addSound</a>(soundName, layerId, static_cast&lt;const CPrimZone*&gt;(child)-&gt;VPoints, <span class="keyword">false</span>);
+00376 }
+00377 <span class="keywordflow">else</span>
+00378 {
+00379 <a class="code" href="a04199.html#a2">nlwarning</a> (<span class="stringliteral">"A background sound patatoid have less than 3 points '%s'"</span>, primName.c_str());
+00380 }
+00381 }
+00382 <span class="keywordflow">else</span> <span class="keywordflow">if</span> (className == <span class="stringliteral">"sound_path"</span>)
+00383 {
+00384 <span class="keywordflow">if</span>(child-&gt;<a class="code" href="a03123.html#NLLIGO_1_1IPrimitivez1900_3">getNumVector</a>() &gt; 1)
+00385 {
+00386 <a class="code" href="a02248.html#NLSOUND_1_1CBackgroundSoundManagerd3">addSound</a>(soundName, layerId, static_cast&lt;const CPrimPath*&gt;(child)-&gt;VPoints, <span class="keyword">true</span>);
+00387 }
+00388 <span class="keywordflow">else</span>
+00389 {
+00390 <a class="code" href="a04199.html#a2">nlwarning</a> (<span class="stringliteral">"A background sound path have less than 2 points '%s'"</span>, primName.c_str());
+00391 }
+00392 }
+00393 <span class="keywordflow">else</span> <span class="keywordflow">if</span> (className == <span class="stringliteral">"sound_point"</span>)
+00394 {
+00395 std::vector&lt;NLLIGO::CPrimVector&gt; points;
+00396 points.push_back(static_cast&lt;const CPrimPoint*&gt;(child)-&gt;Point);
+00397
+00398 <a class="code" href="a02248.html#NLSOUND_1_1CBackgroundSoundManagerd3">addSound</a>(soundName, layerId, points, <span class="keyword">false</span>);
+00399 }
+00400 <span class="keywordflow">else</span> <span class="keywordflow">if</span> (className == <span class="stringliteral">"sound_folder"</span>)
+00401 {
+00402 <a class="code" href="a02248.html#NLSOUND_1_1CBackgroundSoundManagerd7">loadSoundsFromPrimitives</a>(*child);
+00403 }
+00404 }
+00405 }
+00406 }
+00407 }
+00408 }
+</pre></div> </td>
+ </tr>
+</table>
+<a class="anchor" name="NLSOUND_1_1CBackgroundSoundManagera9" doxytag="NLSOUND::CBackgroundSoundManager::loadSoundsFromRegion" ></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::CBackgroundSoundManager::loadSoundsFromRegion </td>
+ <td class="md" valign="top">(&nbsp;</td>
+ <td class="md" nowrap valign="top">const <a class="el" href="a03126.html">NLLIGO::CPrimRegion</a> &amp;&nbsp;</td>
+ <td class="mdname1" valign="top" nowrap> <em>region</em> </td>
+ <td class="md" valign="top">&nbsp;)&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>
+Load the background sounds from a CPrimRegion class. deprecated
+<p>
+Definition at line <a class="el" href="a05471.html#l00574">574</a> of file <a class="el" href="a05471.html">background_sound_manager.cpp</a>.
+<p>
+References <a class="el" href="a05472.html#l00195">_Playing</a>, <a class="el" href="a05471.html#l00093">addSound()</a>, <a class="el" href="a05622.html#l00135">nlwarning</a>, <a class="el" href="a05471.html#l00778">play()</a>, <a class="el" href="a05981.html#l00105">uint</a>, <a class="el" href="a05471.html#l00823">unload()</a>, <a class="el" href="a06196.html#l00504">NLLIGO::CPrimRegion::VPaths</a>, <a class="el" href="a06196.html#l00502">NLLIGO::CPrimRegion::VPoints</a>, and <a class="el" href="a06196.html#l00503">NLLIGO::CPrimRegion::VZones</a>.
+<p>
+Referenced by <a class="el" href="a05471.html#l00618">load()</a>, and <a class="el" href="a05465.html#l02102">NLSOUND::CAudioMixerUser::loadBackgroundSoundFromRegion()</a>.
+<p>
+<div class="fragment"><pre>00575 {
+00576 <a class="code" href="a04558.html#a15">uint</a> i;
+00577 <span class="comment">// remember playing state</span>
+00578 <span class="keywordtype">bool</span> oldState = <a class="code" href="a02248.html#NLSOUND_1_1CBackgroundSoundManagerr8">_Playing</a>;
+00579 <a class="code" href="a02248.html#NLSOUND_1_1CBackgroundSoundManagera15">unload</a>();
+00580
+00581 <span class="keywordflow">for</span> (i = 0; i &lt; region.<a class="code" href="a03126.html#NLLIGO_1_1CPrimRegiono6">VZones</a>.size(); i++)
+00582 {
+00583 <span class="keywordflow">if</span>(region.<a class="code" href="a03126.html#NLLIGO_1_1CPrimRegiono6">VZones</a>[i].VPoints.size()&gt;2)
+00584 {
+00585 <a class="code" href="a02248.html#NLSOUND_1_1CBackgroundSoundManagerd3">addSound</a>(region.<a class="code" href="a03126.html#NLLIGO_1_1CPrimRegiono6">VZones</a>[i].Name, region.<a class="code" href="a03126.html#NLLIGO_1_1CPrimRegiono6">VZones</a>[i].VPoints, <span class="keyword">false</span>);
+00586 }
+00587 <span class="keywordflow">else</span>
+00588 {
+00589 <a class="code" href="a04199.html#a2">nlwarning</a> (<span class="stringliteral">"A background sound patatoid have less than 3 points '%s'"</span>, region.<a class="code" href="a03126.html#NLLIGO_1_1CPrimRegiono6">VZones</a>[i].Name.c_str());
+00590 }
+00591 }
+00592
+00593 <span class="keywordflow">for</span> (i = 0; i &lt; region.<a class="code" href="a03126.html#NLLIGO_1_1CPrimRegiono4">VPaths</a>.size(); i++)
+00594 {
+00595 <span class="keywordflow">if</span>(region.<a class="code" href="a03126.html#NLLIGO_1_1CPrimRegiono4">VPaths</a>[i].VPoints.size() &gt; 1)
+00596 {
+00597 <a class="code" href="a02248.html#NLSOUND_1_1CBackgroundSoundManagerd3">addSound</a>(region.<a class="code" href="a03126.html#NLLIGO_1_1CPrimRegiono4">VPaths</a>[i].Name, region.<a class="code" href="a03126.html#NLLIGO_1_1CPrimRegiono4">VPaths</a>[i].VPoints, <span class="keyword">true</span>);
+00598 }
+00599 <span class="keywordflow">else</span>
+00600 {
+00601 <a class="code" href="a04199.html#a2">nlwarning</a> (<span class="stringliteral">"A background sound path have less than 2 points '%s'"</span>, region.<a class="code" href="a03126.html#NLLIGO_1_1CPrimRegiono4">VPaths</a>[i].Name.c_str());
+00602 }
+00603 }
+00604 <span class="keywordflow">for</span> (i = 0; i &lt; region.<a class="code" href="a03126.html#NLLIGO_1_1CPrimRegiono5">VPoints</a>.size(); i++)
+00605 {
+00606 std::vector&lt;CPrimVector&gt; points;
+00607 points.push_back(region.<a class="code" href="a03126.html#NLLIGO_1_1CPrimRegiono5">VPoints</a>[i].Point);
+00608
+00609 <a class="code" href="a02248.html#NLSOUND_1_1CBackgroundSoundManagerd3">addSound</a>(region.<a class="code" href="a03126.html#NLLIGO_1_1CPrimRegiono5">VPoints</a>[i].Name, points, <span class="keyword">false</span>);
+00610 }
+00611
+00612
+00613 <span class="comment">// restart playing ?</span>
+00614 <span class="keywordflow">if</span> (oldState)
+00615 <a class="code" href="a02248.html#NLSOUND_1_1CBackgroundSoundManagera10">play</a>();
+00616 }
+</pre></div> </td>
+ </tr>
+</table>
+<a class="anchor" name="NLSOUND_1_1CBackgroundSoundManagerd8" doxytag="NLSOUND::CBackgroundSoundManager::onUpdate" ></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::CBackgroundSoundManager::onUpdate </td>
+ <td class="md" valign="top">(&nbsp;</td>
+ <td class="mdname1" valign="top" nowrap> </td>
+ <td class="md" valign="top">&nbsp;)&nbsp;</td>
+ <td class="md" nowrap><code> [private, virtual]</code></td>
+ </tr>
+
+ </table>
+ </td>
+ </tr>
+</table>
+<table cellspacing=5 cellpadding=0 border=0>
+ <tr>
+ <td>
+ &nbsp;
+ </td>
+ <td>
+
+<p>
+
+<p>
+Implements <a class="el" href="a02239.html#NLSOUND_1_1CAudioMixerUser_1_1IMixerUpdatea0">NLSOUND::CAudioMixerUser::IMixerUpdate</a>.
+<p>
+Definition at line <a class="el" href="a05471.html#l01341">1341</a> of file <a class="el" href="a05471.html">background_sound_manager.cpp</a>.
+<p>
+References <a class="el" href="a05471.html#l00861">updateBackgroundStatus()</a>.
+<p>
+<div class="fragment"><pre>01342 {
+01343 <a class="code" href="a02248.html#NLSOUND_1_1CBackgroundSoundManagera16">updateBackgroundStatus</a>();
+01344 }
+</pre></div> </td>
+ </tr>
+</table>
+<a class="anchor" name="NLSOUND_1_1CBackgroundSoundManagera10" doxytag="NLSOUND::CBackgroundSoundManager::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::CBackgroundSoundManager::play </td>
+ <td class="md" valign="top">(&nbsp;</td>
+ <td class="mdname1" valign="top" nowrap> </td>
+ <td class="md" valign="top">&nbsp;)&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>
+Start to play the background sound.
+<p>
+
+<p>
+Definition at line <a class="el" href="a05471.html#l00778">778</a> of file <a class="el" href="a05471.html">background_sound_manager.cpp</a>.
+<p>
+References <a class="el" href="a05472.html#l00198">_BackgroundFlags</a>, <a class="el" href="a05472.html#l00206">_DoFade</a>, <a class="el" href="a05472.html#l00202">_FilterFadesStart</a>, <a class="el" href="a05472.html#l00204">_FilterFadeValues</a>, <a class="el" href="a05472.html#l00195">_Playing</a>, <a class="el" href="a06594.html#l00097">NLSOUND::UAudioMixer::TBackgroundFlags::Flags</a>, <a class="el" href="a05981.html#l00105">uint</a>, and <a class="el" href="a05471.html#l00861">updateBackgroundStatus()</a>.
+<p>
+Referenced by <a class="el" href="a05471.html#l00272">loadAudioFromPrimitives()</a>, <a class="el" href="a05471.html#l00574">loadSoundsFromRegion()</a>, and <a class="el" href="a05465.html#l02121">NLSOUND::CAudioMixerUser::playBackgroundSound()</a>.
+<p>
+<div class="fragment"><pre>00779 {
+00780 <span class="keywordflow">if</span> (<a class="code" href="a02248.html#NLSOUND_1_1CBackgroundSoundManagerr8">_Playing</a>)
+00781 <span class="keywordflow">return</span>;
+00782
+00783 <a class="code" href="a02248.html#NLSOUND_1_1CBackgroundSoundManagerr8">_Playing</a> = <span class="keyword">true</span>;
+00784
+00785 CAudioMixerUser::instance()-&gt;registerUpdate(<span class="keyword">this</span>);
+00786
+00787 <span class="comment">// init the filter value and filter start time</span>
+00788 <span class="keywordflow">for</span> (<a class="code" href="a04558.html#a15">uint</a> i =0; i&lt;UAudioMixer::TBackgroundFlags::NB_BACKGROUND_FLAGS; ++i)
+00789 {
+00790 <a class="code" href="a02248.html#NLSOUND_1_1CBackgroundSoundManagerr3">_FilterFadesStart</a>[i] = 0;
+00791 <a class="code" href="a02248.html#NLSOUND_1_1CBackgroundSoundManagerr4">_FilterFadeValues</a>[i] = 1.0f * !<a class="code" href="a02248.html#NLSOUND_1_1CBackgroundSoundManagerr1">_BackgroundFlags</a>.Flags[i];
+00792 }
+00793 <span class="comment">// force an initial filtering </span>
+00794 <a class="code" href="a02248.html#NLSOUND_1_1CBackgroundSoundManagerr2">_DoFade</a> = <span class="keyword">true</span>;
+00795 <a class="code" href="a02248.html#NLSOUND_1_1CBackgroundSoundManagera16">updateBackgroundStatus</a>();
+00796
+00797
+00798 }
+</pre></div> </td>
+ </tr>
+</table>
+<a class="anchor" name="NLSOUND_1_1CBackgroundSoundManagera11" doxytag="NLSOUND::CBackgroundSoundManager::setBackgroundFilterFades" ></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::CBackgroundSoundManager::setBackgroundFilterFades </td>
+ <td class="md" valign="top">(&nbsp;</td>
+ <td class="md" nowrap valign="top">const <a class="el" href="a03920.html">UAudioMixer::TBackgroundFilterFades</a> &amp;&nbsp;</td>
+ <td class="mdname1" valign="top" nowrap> <em>backgroundFilterFades</em> </td>
+ <td class="md" valign="top">&nbsp;)&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>
+
+<p>
+Definition at line <a class="el" href="a05471.html#l00082">82</a> of file <a class="el" href="a05471.html">background_sound_manager.cpp</a>.
+<p>
+References <a class="el" href="a05472.html#l00200">_BackgroundFilterFades</a>.
+<p>
+Referenced by <a class="el" href="a05465.html#l02096">NLSOUND::CAudioMixerUser::setBackgroundFilterFades()</a>.
+<p>
+<div class="fragment"><pre>00083 {
+00084 <a class="code" href="a02248.html#NLSOUND_1_1CBackgroundSoundManagerr0">_BackgroundFilterFades</a> = backgroundFilterFades;
+00085 }
+</pre></div> </td>
+ </tr>
+</table>
+<a class="anchor" name="NLSOUND_1_1CBackgroundSoundManagera12" doxytag="NLSOUND::CBackgroundSoundManager::setBackgroundFlags" ></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::CBackgroundSoundManager::setBackgroundFlags </td>
+ <td class="md" valign="top">(&nbsp;</td>
+ <td class="md" nowrap valign="top">const <a class="el" href="a03921.html">UAudioMixer::TBackgroundFlags</a> &amp;&nbsp;</td>
+ <td class="mdname1" valign="top" nowrap> <em>backgroundFlags</em> </td>
+ <td class="md" valign="top">&nbsp;)&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>
+Set the background flags.
+<p>
+
+<p>
+Definition at line <a class="el" href="a05471.html#l01312">1312</a> of file <a class="el" href="a05471.html">background_sound_manager.cpp</a>.
+<p>
+References <a class="el" href="a05472.html#l00200">_BackgroundFilterFades</a>, <a class="el" href="a05472.html#l00198">_BackgroundFlags</a>, <a class="el" href="a05472.html#l00206">_DoFade</a>, <a class="el" href="a05472.html#l00202">_FilterFadesStart</a>, <a class="el" href="a05472.html#l00204">_FilterFadeValues</a>, <a class="el" href="a06594.html#l00111">NLSOUND::UAudioMixer::TBackgroundFilterFades::FadeIns</a>, <a class="el" href="a06594.html#l00112">NLSOUND::UAudioMixer::TBackgroundFilterFades::FadeOuts</a>, <a class="el" href="a06594.html#l00097">NLSOUND::UAudioMixer::TBackgroundFlags::Flags</a>, <a class="el" href="a05981.html#l00105">uint</a>, and <a class="el" href="a06590.html#l00221">uint64</a>.
+<p>
+Referenced by <a class="el" href="a05465.html#l02091">NLSOUND::CAudioMixerUser::setBackgroundFlags()</a>.
+<p>
+<div class="fragment"><pre>01313 {
+01314 <span class="keywordflow">for</span> (<a class="code" href="a04558.html#a15">uint</a> i=0; i&lt;UAudioMixer::TBackgroundFlags::NB_BACKGROUND_FLAGS; ++i)
+01315 {
+01316 <span class="keywordflow">if</span> (<a class="code" href="a02248.html#NLSOUND_1_1CBackgroundSoundManagerr1">_BackgroundFlags</a>.Flags[i] != backgroundFlags.Flags[i])
+01317 {
+01318 <span class="comment">// the filter flags has changed ! </span>
+01319 <span class="keywordflow">if</span> (backgroundFlags.Flags[i])
+01320 {
+01321 <span class="comment">// the filter is activated, to a fade out</span>
+01322 <a class="code" href="a02248.html#NLSOUND_1_1CBackgroundSoundManagerr3">_FilterFadesStart</a>[i] = <a class="code" href="a05167.html#a15">uint64</a>(NLMISC::CTime::getLocalTime() - (1-_FilterFadeValues[i]) * <a class="code" href="a02248.html#NLSOUND_1_1CBackgroundSoundManagerr0">_BackgroundFilterFades</a>.FadeOuts[i]);
+01323 <a class="code" href="a02248.html#NLSOUND_1_1CBackgroundSoundManagerr2">_DoFade</a> = <span class="keyword">true</span>;
+01324 }
+01325 <span class="keywordflow">else</span>
+01326 {
+01327 <span class="comment">// the filter is cleared, do a fade in</span>
+01328 <a class="code" href="a02248.html#NLSOUND_1_1CBackgroundSoundManagerr3">_FilterFadesStart</a>[i] = <a class="code" href="a05167.html#a15">uint64</a>(NLMISC::CTime::getLocalTime() - (_FilterFadeValues[i]) * <a class="code" href="a02248.html#NLSOUND_1_1CBackgroundSoundManagerr0">_BackgroundFilterFades</a>.FadeIns[i]);
+01329 <a class="code" href="a02248.html#NLSOUND_1_1CBackgroundSoundManagerr2">_DoFade</a> = <span class="keyword">true</span>;
+01330 }
+01331 }
+01332
+01333 <a class="code" href="a02248.html#NLSOUND_1_1CBackgroundSoundManagerr1">_BackgroundFlags</a>.Flags[i] = backgroundFlags.Flags[i];
+01334 }
+01335
+01336 <span class="keywordflow">if</span> (<a class="code" href="a02248.html#NLSOUND_1_1CBackgroundSoundManagerr2">_DoFade</a>)
+01337 CAudioMixerUser::instance()-&gt;registerUpdate(<span class="keyword">this</span>);
+01338 }
+</pre></div> </td>
+ </tr>
+</table>
+<a class="anchor" name="NLSOUND_1_1CBackgroundSoundManagera13" doxytag="NLSOUND::CBackgroundSoundManager::setListenerPosition" ></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::CBackgroundSoundManager::setListenerPosition </td>
+ <td class="md" valign="top">(&nbsp;</td>
+ <td class="md" nowrap valign="top">const <a class="el" href="a03128.html">NLMISC::CVector</a> &amp;&nbsp;</td>
+ <td class="mdname1" valign="top" nowrap> <em>listenerPosition</em> </td>
+ <td class="md" valign="top">&nbsp;)&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>
+Call this method when the listener position change.
+<p>
+
+<p>
+Definition at line <a class="el" href="a05471.html#l00850">850</a> of file <a class="el" href="a05471.html">background_sound_manager.cpp</a>.
+<p>
+References <a class="el" href="a05472.html#l00209">_LastPosition</a>, and <a class="el" href="a05471.html#l00861">updateBackgroundStatus()</a>.
+<p>
+Referenced by <a class="el" href="a05465.html#l01983">NLSOUND::CAudioMixerUser::setListenerPos()</a>.
+<p>
+<div class="fragment"><pre>00851 {
+00852 <span class="keywordflow">if</span> (<a class="code" href="a02248.html#NLSOUND_1_1CBackgroundSoundManagerr7">_LastPosition</a> == listenerPosition)
+00853 {
+00854 <span class="keywordflow">return</span>;
+00855 }
+00856 <a class="code" href="a02248.html#NLSOUND_1_1CBackgroundSoundManagerr7">_LastPosition</a> = listenerPosition;
+00857
+00858 <a class="code" href="a02248.html#NLSOUND_1_1CBackgroundSoundManagera16">updateBackgroundStatus</a>();
+00859 }
+</pre></div> </td>
+ </tr>
+</table>
+<a class="anchor" name="NLSOUND_1_1CBackgroundSoundManagerd9" doxytag="NLSOUND::CBackgroundSoundManager::split" ></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" colspan="4">
+template&lt;class CharType&gt; </td>
+ </tr>
+ <tr>
+ <td class="md" nowrap valign="top"> std::vector&lt;std::basic_string&lt;CharType&gt; &gt; NLSOUND::CBackgroundSoundManager::split </td>
+ <td class="md" valign="top">(&nbsp;</td>
+ <td class="md" nowrap valign="top">const std::basic_string&lt; CharType &gt; &amp;&nbsp;</td>
+ <td class="mdname" nowrap> <em>str</em>, </td>
+ </tr>
+ <tr>
+ <td class="md" nowrap align="right"></td>
+ <td></td>
+ <td class="md" nowrap>CharType&nbsp;</td>
+ <td class="mdname" nowrap> <em>splitTag</em></td>
+ </tr>
+ <tr>
+ <td></td>
+ <td class="md">)&nbsp;</td>
+ <td class="md" colspan="2"><code> [inline, private]</code></td>
+ </tr>
+
+ </table>
+ </td>
+ </tr>
+</table>
+<table cellspacing=5 cellpadding=0 border=0>
+ <tr>
+ <td>
+ &nbsp;
+ </td>
+ <td>
+
+<p>
+TODO : Utility... should be in <a class="el" href="a05378.html">NLMISC</a> ?
+<p>
+
+<p>
+Definition at line <a class="el" href="a05472.html#l00171">171</a> of file <a class="el" href="a05472.html">background_sound_manager.h</a>.
+<p>
+References <a class="el" href="a05646.html#l00645">size</a>.
+<p>
+Referenced by <a class="el" href="a05471.html#l00537">loadSamplesFromRegion()</a>.
+<p>
+<div class="fragment"><pre>00172 {
+00173 std::vector&lt;std::basic_string&lt;CharType&gt; &gt; splitted;
+00174 std::basic_string&lt;CharType&gt;::size_type pos = 0, nextPos = 0, <a class="code" href="a04223.html#a587">size</a> = 0;
+00175
+00176 <span class="keywordflow">while</span> ((nextPos = str.find(splitTag, nextPos)) != std::basic_string&lt;CharType&gt;::npos)
+00177 {
+00178 <a class="code" href="a04223.html#a587">size</a> = nextPos - pos;
+00179 <span class="keywordflow">if</span> (<a class="code" href="a04223.html#a587">size</a> &gt; 0)
+00180 splitted.push_back(std::basic_string&lt;CharType&gt;(str, pos, nextPos - pos));
+00181 <span class="comment">// skip the tag</span>
+00182 nextPos += 1;
+00183 pos = nextPos;
+00184 }
+00185 <span class="comment">// is there a last part ?</span>
+00186 <a class="code" href="a04223.html#a587">size</a> = nextPos - pos;
+00187 <span class="keywordflow">if</span> (pos != str.size())
+00188 splitted.push_back(std::basic_string&lt;CharType&gt;(str, pos, str.size() - pos));
+00189
+00190 <span class="keywordflow">return</span> splitted;
+00191 }
+</pre></div> </td>
+ </tr>
+</table>
+<a class="anchor" name="NLSOUND_1_1CBackgroundSoundManagera14" doxytag="NLSOUND::CBackgroundSoundManager::stop" ></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::CBackgroundSoundManager::stop </td>
+ <td class="md" valign="top">(&nbsp;</td>
+ <td class="mdname1" valign="top" nowrap> </td>
+ <td class="md" valign="top">&nbsp;)&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>
+Stop the background sound.
+<p>
+
+<p>
+Definition at line <a class="el" href="a05471.html#l00801">801</a> of file <a class="el" href="a05471.html">background_sound_manager.cpp</a>.
+<p>
+References <a class="el" href="a05472.html#l00265">_Layers</a>, <a class="el" href="a05472.html#l00195">_Playing</a>, <a class="el" href="a05472.html#l00051">NLSOUND::BACKGROUND_LAYER</a>, <a class="el" href="a05981.html#l00105">uint</a>, and <a class="el" href="a05465.html#l02060">NLSOUND::CAudioMixerUser::unregisterUpdate()</a>.
+<p>
+Referenced by <a class="el" href="a05465.html#l02126">NLSOUND::CAudioMixerUser::stopBackgroundSound()</a>, and <a class="el" href="a05471.html#l00823">unload()</a>.
+<p>
+<div class="fragment"><pre>00802 {
+00803 <span class="keywordflow">if</span>(!<a class="code" href="a02248.html#NLSOUND_1_1CBackgroundSoundManagerr8">_Playing</a>)
+00804 <span class="keywordflow">return</span>;
+00805 <a class="code" href="a02248.html#NLSOUND_1_1CBackgroundSoundManagern0">CAudioMixerUser</a> *mixer = CAudioMixerUser::instance();
+00806
+00807 <span class="keywordflow">for</span> (<a class="code" href="a04558.html#a15">uint</a> i=0; i&lt;<a class="code" href="a05381.html#a4">BACKGROUND_LAYER</a>; ++i)
+00808 {
+00809 <span class="comment">// stop all playing source</span>
+00810 std::vector&lt;TSoundData&gt;::iterator first(_Layers[i].begin()), last(_Layers[i].end());
+00811 <span class="keywordflow">for</span> (; first != last; ++first)
+00812 {
+00813 <span class="keywordflow">if</span> (first-&gt;Source != 0 &amp;&amp; first-&gt;Source-&gt;isPlaying())
+00814 first-&gt;Source-&gt;stop();
+00815 }
+00816 }
+00817
+00818 CAudioMixerUser::instance()-&gt;unregisterUpdate(<span class="keyword">this</span>);
+00819
+00820 <a class="code" href="a02248.html#NLSOUND_1_1CBackgroundSoundManagerr8">_Playing</a> = <span class="keyword">false</span>;
+00821 }
+</pre></div> </td>
+ </tr>
+</table>
+<a class="anchor" name="NLSOUND_1_1CBackgroundSoundManagera15" doxytag="NLSOUND::CBackgroundSoundManager::unload" ></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::CBackgroundSoundManager::unload </td>
+ <td class="md" valign="top">(&nbsp;</td>
+ <td class="mdname1" valign="top" nowrap> </td>
+ <td class="md" valign="top">&nbsp;)&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>
+Remove all data about the current continents
+<p>
+Definition at line <a class="el" href="a05471.html#l00823">823</a> of file <a class="el" href="a05471.html">background_sound_manager.cpp</a>.
+<p>
+References <a class="el" href="a05472.html#l00265">_Layers</a>, <a class="el" href="a05472.html#l00051">NLSOUND::BACKGROUND_LAYER</a>, <a class="el" href="a05471.html#l00801">stop()</a>, and <a class="el" href="a05981.html#l00105">uint</a>.
+<p>
+Referenced by <a class="el" href="a05471.html#l00272">loadAudioFromPrimitives()</a>, <a class="el" href="a05471.html#l00574">loadSoundsFromRegion()</a>, and <a class="el" href="a05471.html#l00071">~CBackgroundSoundManager()</a>.
+<p>
+<div class="fragment"><pre>00824 {
+00825 <a class="code" href="a02248.html#NLSOUND_1_1CBackgroundSoundManagera14">stop</a>();
+00826
+00827 <a class="code" href="a02248.html#NLSOUND_1_1CBackgroundSoundManagern0">CAudioMixerUser</a> *mixer = CAudioMixerUser::instance();
+00828
+00829 <span class="keywordflow">for</span> (<a class="code" href="a04558.html#a15">uint</a> i=0; i&lt;<a class="code" href="a05381.html#a4">BACKGROUND_LAYER</a>; ++i)
+00830 {
+00831 <span class="comment">// delete all created source</span>
+00832 std::vector&lt;TSoundData&gt;::iterator first(_Layers[i].begin()), last(_Layers[i].end());
+00833 <span class="keywordflow">for</span> (; first != last; ++first)
+00834 {
+00835 <span class="keywordflow">if</span> (first-&gt;Source)
+00836 <span class="comment">// mixer-&gt;removeSource(first-&gt;Source);</span>
+00837 <span class="keyword">delete</span> first-&gt;Source;
+00838 }
+00839
+00840 <span class="comment">// and free the layer.</span>
+00841 <a class="code" href="a02248.html#NLSOUND_1_1CBackgroundSoundManagerz1296_0">_Layers</a>[i].clear();
+00842 }
+00843
+00844 <span class="comment">// erase the sample banks zone</span>
+00845 <a class="code" href="a02248.html#NLSOUND_1_1CBackgroundSoundManagerz1295_0">_Banks</a>.clear();
+00846
+00847 <span class="comment">// TODO : erase the fx zones</span>
+00848 }
+</pre></div> </td>
+ </tr>
+</table>
+<a class="anchor" name="NLSOUND_1_1CBackgroundSoundManagera16" doxytag="NLSOUND::CBackgroundSoundManager::updateBackgroundStatus" ></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::CBackgroundSoundManager::updateBackgroundStatus </td>
+ <td class="md" valign="top">(&nbsp;</td>
+ <td class="mdname1" valign="top" nowrap> </td>
+ <td class="md" valign="top">&nbsp;)&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>
+Call this method to update the background sound (sub method of setListenerPosition).
+<p>
+Status of all selected sound ordered by surface.
+<p>
+Definition at line <a class="el" href="a05471.html#l00861">861</a> of file <a class="el" href="a05471.html">background_sound_manager.cpp</a>.
+<p>
+References <a class="el" href="a05472.html#l00200">_BackgroundFilterFades</a>, <a class="el" href="a05472.html#l00198">_BackgroundFlags</a>, <a class="el" href="a05472.html#l00206">_DoFade</a>, <a class="el" href="a05472.html#l00202">_FilterFadesStart</a>, <a class="el" href="a05472.html#l00204">_FilterFadeValues</a>, <a class="el" href="a05472.html#l00305">_FxZones</a>, <a class="el" href="a05472.html#l00307">_LastEnv</a>, <a class="el" href="a05472.html#l00209">_LastPosition</a>, <a class="el" href="a05472.html#l00265">_Layers</a>, <a class="el" href="a05472.html#l00231">_LoadedBanks</a>, <a class="el" href="a05472.html#l00195">_Playing</a>, <a class="el" href="a05472.html#l00051">NLSOUND::BACKGROUND_LAYER</a>, <a class="el" href="a05471.html#l00056">NLSOUND::BACKGROUND_SOUND_ALTITUDE</a>, <a class="el" href="a06428.html#l00103">NLSOUND::CSourceCommon::checkup()</a>, <a class="el" href="a05587.html#l00115">NLMISC::clamp()</a>, <a class="el" href="a05646.html#l00240">count</a>, <a class="el" href="a05465.html#l01732">NLSOUND::CAudioMixerUser::createSource()</a>, <a class="el" href="a06594.html#l00111">NLSOUND::UAudioMixer::TBackgroundFilterFades::FadeIns</a>, <a class="el" href="a06594.html#l00112">NLSOUND::UAudioMixer::TBackgroundFilterFades::FadeOuts</a>, <a class="el" href="a06594.html#l00097">NLSOUND::UAudioMixer::TBackgroundFlags::Flags</a>, <a class="el" href="a05472.html#l00276">NLSOUND::CBackgroundSoundManager::TSoundStatus::Gain</a>, <a class="el" href="a05466.html#l00295">NLSOUND::CAudioMixerUser::getClusteredSound()</a>, <a class="el" href="a05565.html#l00459">NLSOUND::CClusteredSound::getClusterSoundStatus()</a>, <a class="el" href="a05466.html#l00229">NLSOUND::CAudioMixerUser::getListener()</a>, <a class="el" href="a06552.html#l00055">NLMISC::CTime::getLocalTime()</a>, <a class="el" href="a05565.html#l00472">NLSOUND::CClusteredSound::getRootCluster()</a>, <a class="el" href="a02254.html#NLSOUND_1_1CSourceCommona14">NLSOUND::CSourceCommon::getType()</a>, <a class="el" href="a05788.html#l00054">H_AFTER</a>, <a class="el" href="a05788.html#l00056">H_AUTO</a>, <a class="el" href="a05788.html#l00053">H_BEFORE</a>, <a class="el" href="a05472.html#l00280">NLSOUND::CBackgroundSoundManager::TSoundStatus::Inside</a>, <a class="el" href="a05471.html#l00055">NLSOUND::INSIDE_FALLOF</a>, <a class="el" href="a05472.html#l00256">NLSOUND::CBackgroundSoundManager::TSoundData::IsPath</a>, <a class="el" href="a06428.html#l00064">NLSOUND::CSourceCommon::isPlaying()</a>, <a class="el" href="a05465.html#l01803">NLSOUND::CAudioMixerUser::loadSampleBank()</a>, <a class="el" href="a05472.html#l00254">NLSOUND::CBackgroundSoundManager::TSoundData::MaxDist</a>, <a class="el" href="a06427.html#l00107">NLSOUND::CSourceCommon::play()</a>, <a class="el" href="a05472.html#l00258">NLSOUND::CBackgroundSoundManager::TSoundData::Points</a>, <a class="el" href="a05472.html#l00272">NLSOUND::CBackgroundSoundManager::TSoundStatus::Position</a>, <a class="el" href="a05566.html#l00071">NLSOUND::CClusteredSound::CClusterSoundStatus::Position</a>, <a class="el" href="a05472.html#l00260">NLSOUND::CBackgroundSoundManager::TSoundData::Selected</a>, <a class="el" href="a03861.html#NLSOUND_1_1IListenerz1318_2">NLSOUND::IListener::setEnvironment()</a>, <a class="el" href="a05563.html#l00093">NL3D::CCluster::setEnvironmentFx()</a>, <a class="el" href="a06427.html#l00133">NLSOUND::CSourceCommon::setPos()</a>, <a class="el" href="a06427.html#l00195">NLSOUND::CSourceCommon::setRelativeGain()</a>, <a class="el" href="a05472.html#l00243">NLSOUND::CBackgroundSoundManager::TSoundData::Sound</a>, <a class="el" href="a05472.html#l00270">NLSOUND::CBackgroundSoundManager::TSoundStatus::SoundData</a>, <a class="el" href="a05472.html#l00245">NLSOUND::CBackgroundSoundManager::TSoundData::Source</a>, <a class="el" href="a06427.html#l00120">NLSOUND::CSourceCommon::stop()</a>, <a class="el" href="a05472.html#l00252">NLSOUND::CBackgroundSoundManager::TSoundData::Surface</a>, <a class="el" href="a05981.html#l00105">uint</a>, <a class="el" href="a05465.html#l01838">NLSOUND::CAudioMixerUser::unloadSampleBank()</a>, <a class="el" href="a05465.html#l02060">NLSOUND::CAudioMixerUser::unregisterUpdate()</a>, <a class="el" href="a06673.html#l00051">NLMISC::CVector::x</a>, <a class="el" href="a06673.html#l00051">NLMISC::CVector::y</a>, and <a class="el" href="a06673.html#l00051">NLMISC::CVector::z</a>.
+<p>
+Referenced by <a class="el" href="a05465.html#l01122">NLSOUND::CAudioMixerUser::applyListenerMove()</a>, <a class="el" href="a05471.html#l01341">onUpdate()</a>, <a class="el" href="a05471.html#l00778">play()</a>, <a class="el" href="a05471.html#l00850">setListenerPosition()</a>, and <a class="el" href="a05465.html#l01268">NLSOUND::CAudioMixerUser::update()</a>.
+<p>
+<div class="fragment"><pre>00862 {
+00863 <a class="code" href="a04365.html#a4">H_AUTO</a>(NLSOUND_UpdateBackgroundSound)
+00864 <span class="keywordflow">if</span> (!<a class="code" href="a02248.html#NLSOUND_1_1CBackgroundSoundManagerr8">_Playing</a>)
+00865 <span class="keywordflow">return</span>;
+00866
+00867 <a class="code" href="a02248.html#NLSOUND_1_1CBackgroundSoundManagern0">CAudioMixerUser</a> *mixer = CAudioMixerUser::instance();
+00868
+00869
+00870 <span class="comment">// it s on 2d so we don't have z</span>
+00871 CVector listener = <a class="code" href="a02248.html#NLSOUND_1_1CBackgroundSoundManagerr7">_LastPosition</a>;
+00872 listener.<a class="code" href="a03128.html#NLMISC_1_1CVectoro2">z</a> = 0.0f;
+00873
+00874 <span class="comment">// special case for clustered sound management. If the listener is not</span>
+00875 <span class="comment">// in the global cluster, it's background listening place could be different</span>
+00876 CClusteredSound *clusteredSound = mixer-&gt;getClusteredSound();
+00877 <span class="keywordflow">if</span> (clusteredSound != 0)
+00878 {
+00879 <span class="keyword">const</span> CClusteredSound::CClusterSoundStatus *css = clusteredSound-&gt;getClusterSoundStatus(clusteredSound-&gt;getRootCluster());
+00880 <span class="keywordflow">if</span> (css != 0)
+00881 {
+00882 listener = css-&gt;Position;
+00883 listener.z = 0.0f;
+00884 }
+00885 }
+00886
+00887 <span class="comment">// evalutate the current env fx</span>
+00888 {
+00889 <a class="code" href="a04365.html#a4">H_AUTO</a>(NLSOUND_EvaluateEnvFx)
+00890 <a class="code" href="a02362.html">NL3D::CCluster</a> *rootCluster = 0;
+00891 <span class="keywordflow">if</span> (mixer-&gt;getClusteredSound())
+00892 rootCluster = mixer-&gt;getClusteredSound()-&gt;getRootCluster();
+00893
+00894 std::vector&lt;TFxZone&gt;::iterator first(<a class="code" href="a02248.html#NLSOUND_1_1CBackgroundSoundManagerr5">_FxZones</a>.begin()), last(<a class="code" href="a02248.html#NLSOUND_1_1CBackgroundSoundManagerr5">_FxZones</a>.end());
+00895 <span class="keywordflow">for</span> (; first != last; ++first)
+00896 {
+00897 <span class="keywordflow">if</span> (listener.x &gt;= first-&gt;MinBox.x &amp;&amp; listener.x &lt;= first-&gt;MaxBox.x
+00898 &amp;&amp; listener.y &gt;= first-&gt;MinBox.y &amp;&amp; listener.y &lt;= first-&gt;MaxBox.y
+00899 )
+00900 {
+00901 <span class="comment">// bounding box ok, </span>
+00902 <span class="keywordflow">if</span> (CPrimZone::contains(listener, first-&gt;Points))
+00903 {
+00904 <span class="comment">// stop at the first zone !</span>
+00905 <span class="keywordflow">if</span> (rootCluster)
+00906 {
+00907 <span class="comment">// use the cluster system</span>
+00908 rootCluster-&gt;<a class="code" href="a02362.html#NL3D_1_1CClusterz68_5">setEnvironmentFx</a>(first-&gt;FxName);
+00909 }
+00910 <span class="keywordflow">else</span>
+00911 {
+00912 <span class="comment">// no cluster system, set the env 'manualy'</span>
+00913 IListener *drvListener = static_cast&lt;CListenerUser*&gt;(mixer-&gt;getListener())-&gt;getListener();
+00914
+00915 <span class="keywordflow">if</span> (<a class="code" href="a02248.html#NLSOUND_1_1CBackgroundSoundManagerr6">_LastEnv</a> != first-&gt;FxName)
+00916 {
+00917 <a class="code" href="a02248.html#NLSOUND_1_1CBackgroundSoundManagerr6">_LastEnv</a> = first-&gt;FxName;
+00918 <a class="code" href="a04558.html#a15">uint</a> envNum;
+00919 <span class="keywordflow">if</span> (first-&gt;FxName == CStringMapper::map(<span class="stringliteral">"GENERIC"</span>))
+00920 envNum = 0;
+00921 <span class="keywordflow">else</span> <span class="keywordflow">if</span> (first-&gt;FxName == CStringMapper::map(<span class="stringliteral">"PADDEDCELL"</span>))
+00922 envNum = 1;
+00923 <span class="keywordflow">else</span> <span class="keywordflow">if</span> (first-&gt;FxName == CStringMapper::map(<span class="stringliteral">"ROOM"</span>))
+00924 envNum = 2;
+00925 <span class="keywordflow">else</span> <span class="keywordflow">if</span> (first-&gt;FxName == CStringMapper::map(<span class="stringliteral">"BATHROOM"</span>))
+00926 envNum = 3;
+00927 <span class="keywordflow">else</span> <span class="keywordflow">if</span> (first-&gt;FxName == CStringMapper::map(<span class="stringliteral">"LIVINGROOM"</span>))
+00928 envNum = 4;
+00929 <span class="keywordflow">else</span> <span class="keywordflow">if</span> (first-&gt;FxName == CStringMapper::map(<span class="stringliteral">"STONEROOM"</span>))
+00930 envNum = 5;
+00931 <span class="keywordflow">else</span> <span class="keywordflow">if</span> (first-&gt;FxName == CStringMapper::map(<span class="stringliteral">"AUDITORIUM"</span>))
+00932 envNum = 6;
+00933 <span class="keywordflow">else</span> <span class="keywordflow">if</span> (first-&gt;FxName == CStringMapper::map(<span class="stringliteral">"CONCERTHALL"</span>))
+00934 envNum = 7;
+00935 <span class="keywordflow">else</span> <span class="keywordflow">if</span> (first-&gt;FxName == CStringMapper::map(<span class="stringliteral">"CAVE"</span>))
+00936 envNum = 8;
+00937 <span class="keywordflow">else</span> <span class="keywordflow">if</span> (first-&gt;FxName == CStringMapper::map(<span class="stringliteral">"ARENA"</span>))
+00938 envNum = 9;
+00939 <span class="keywordflow">else</span> <span class="keywordflow">if</span> (first-&gt;FxName == CStringMapper::map(<span class="stringliteral">"HANGAR"</span>))
+00940 envNum = 10;
+00941 <span class="keywordflow">else</span> <span class="keywordflow">if</span> (first-&gt;FxName == CStringMapper::map(<span class="stringliteral">"CARPETEDHALLWAY"</span>))
+00942 envNum = 11;
+00943 <span class="keywordflow">else</span> <span class="keywordflow">if</span> (first-&gt;FxName == CStringMapper::map(<span class="stringliteral">"HALLWAY"</span>))
+00944 envNum = 12;
+00945 <span class="keywordflow">else</span> <span class="keywordflow">if</span> (first-&gt;FxName == CStringMapper::map(<span class="stringliteral">"STONECORRIDOR"</span>))
+00946 envNum = 13;
+00947 <span class="keywordflow">else</span> <span class="keywordflow">if</span> (first-&gt;FxName == CStringMapper::map(<span class="stringliteral">"ALLEY"</span>))
+00948 envNum = 14;
+00949 <span class="keywordflow">else</span> <span class="keywordflow">if</span> (first-&gt;FxName == CStringMapper::map(<span class="stringliteral">"FOREST"</span>))
+00950 envNum = 15;
+00951 <span class="keywordflow">else</span> <span class="keywordflow">if</span> (first-&gt;FxName == CStringMapper::map(<span class="stringliteral">"CITY"</span>))
+00952 envNum = 16;
+00953 <span class="keywordflow">else</span> <span class="keywordflow">if</span> (first-&gt;FxName == CStringMapper::map(<span class="stringliteral">"MOUNTAINS"</span>))
+00954 envNum = 16;
+00955 <span class="keywordflow">else</span> <span class="keywordflow">if</span> (first-&gt;FxName == CStringMapper::map(<span class="stringliteral">"QUARRY"</span>))
+00956 envNum = 17;
+00957 <span class="keywordflow">else</span> <span class="keywordflow">if</span> (first-&gt;FxName == CStringMapper::map(<span class="stringliteral">"PLAIN"</span>))
+00958 envNum = 18;
+00959 <span class="keywordflow">else</span> <span class="keywordflow">if</span> (first-&gt;FxName == CStringMapper::map(<span class="stringliteral">"PARKINGLOT"</span>))
+00960 envNum = 19;
+00961 <span class="keywordflow">else</span> <span class="keywordflow">if</span> (first-&gt;FxName == CStringMapper::map(<span class="stringliteral">"SEWERPIPE"</span>))
+00962 envNum = 20;
+00963 <span class="keywordflow">else</span> <span class="keywordflow">if</span> (first-&gt;FxName == CStringMapper::map(<span class="stringliteral">"UNDERWATER"</span>))
+00964 envNum = 21;
+00965 <span class="keywordflow">else</span> <span class="keywordflow">if</span> (first-&gt;FxName == CStringMapper::map(<span class="stringliteral">"DRUGGED"</span>))
+00966 envNum = 22;
+00967 <span class="keywordflow">else</span> <span class="keywordflow">if</span> (first-&gt;FxName == CStringMapper::map(<span class="stringliteral">"DIZZY"</span>))
+00968 envNum = 23;
+00969 <span class="keywordflow">else</span> <span class="keywordflow">if</span> (first-&gt;FxName == CStringMapper::map(<span class="stringliteral">"PSYCHOTIC"</span>))
+00970 envNum = 24;
+00971 <span class="keywordflow">else</span>
+00972 envNum = 18;
+00973
+00974 drvListener-&gt;setEnvironment(envNum, 10);
+00975 }
+00976 }
+00977 <span class="keywordflow">break</span>;
+00978 }
+00979 }
+00980 }
+00981 }
+00982
+00983
+00984 <span class="comment">// compute the list of load/unload banks.</span>
+00985 {
+00986 <a class="code" href="a04365.html#a4">H_AUTO</a>(NLSOUND_LoadUnloadSampleBank)
+00987 <span class="comment">// set of bank that must be in ram.</span>
+00988 std::set&lt;std::string&gt; newBanks;
+00989
+00990 std::vector&lt;TBanksData&gt;::iterator first(<a class="code" href="a02248.html#NLSOUND_1_1CBackgroundSoundManagerz1295_0">_Banks</a>.begin()), last(<a class="code" href="a02248.html#NLSOUND_1_1CBackgroundSoundManagerz1295_0">_Banks</a>.end());
+00991 <span class="keywordflow">for</span> (; first != last; ++first)
+00992 {
+00993 <span class="keywordflow">if</span> (listener.x &gt;= first-&gt;MinBox.x &amp;&amp; listener.x &lt;= first-&gt;MaxBox.x
+00994 &amp;&amp; listener.y &gt;= first-&gt;MinBox.y &amp;&amp; listener.y &lt;= first-&gt;MaxBox.y
+00995 )
+00996 {
+00997 <span class="comment">// bounding box ok, </span>
+00998 <span class="keywordflow">if</span> (CPrimZone::contains(listener, first-&gt;Points))
+00999 {
+01000 <span class="comment">// add the banks of this zone in the n</span>
+01001 newBanks.insert(first-&gt;Banks.begin(), first-&gt;Banks.end());
+01002 }
+01003 }
+01004 }
+01005
+01006 <span class="comment">/* {</span>
+01007 <span class="comment"> nldebug("-----------------------------");</span>
+01008 <span class="comment"> nldebug("Loaded sample banks (%u elements):", _LoadedBanks.size());</span>
+01009 <span class="comment"> set&lt;string&gt;::iterator first(_LoadedBanks.begin()), last(_LoadedBanks.end());</span>
+01010 <span class="comment"> for (; first != last; ++first)</span>
+01011 <span class="comment"> {</span>
+01012 <span class="comment"> const string &amp;str = *first;</span>
+01013 <span class="comment"> nldebug(" %s", first-&gt;c_str());</span>
+01014 <span class="comment"> }</span>
+01015 <span class="comment"> }</span>
+01016 <span class="comment"> {</span>
+01017 <span class="comment"> nldebug("New Sample bank list (%u elements):", newBanks.size());</span>
+01018 <span class="comment"> set&lt;string&gt;::iterator first(newBanks.begin()), last(newBanks.end());</span>
+01019 <span class="comment"> for (; first != last; ++first)</span>
+01020 <span class="comment"> {</span>
+01021 <span class="comment"> const string &amp;str = *first;</span>
+01022 <span class="comment"> nldebug(" %s", first-&gt;c_str());</span>
+01023 <span class="comment"> }</span>
+01024 <span class="comment"> }</span>
+01025 <span class="comment">*/</span>
+01026 <span class="comment">// ok, now compute to set : the set of bank to load, and the set of banks to unload.</span>
+01027 std::set&lt;std::string&gt; noChange;
+01028 std::set_intersection(<a class="code" href="a02248.html#NLSOUND_1_1CBackgroundSoundManagerz1295_1">_LoadedBanks</a>.begin(), <a class="code" href="a02248.html#NLSOUND_1_1CBackgroundSoundManagerz1295_1">_LoadedBanks</a>.end(), newBanks.begin(), newBanks.end(), std::inserter(noChange, noChange.end()));
+01029
+01030 std::set&lt;std::string&gt; loadList;
+01031 std::set_difference(newBanks.begin(), newBanks.end(), noChange.begin(), noChange.end(), std::inserter(loadList, loadList.end()));
+01032
+01033 std::set&lt;std::string&gt; unloadList;
+01034 std::set_difference(<a class="code" href="a02248.html#NLSOUND_1_1CBackgroundSoundManagerz1295_1">_LoadedBanks</a>.begin(), <a class="code" href="a02248.html#NLSOUND_1_1CBackgroundSoundManagerz1295_1">_LoadedBanks</a>.end(), newBanks.begin(), newBanks.end(), std::inserter(unloadList, unloadList.end()));
+01035
+01036 <span class="comment">// and now, load and unload....</span>
+01037 {
+01038 std::set&lt;std::string&gt;::iterator first(loadList.begin()), last(loadList.end());
+01039 <span class="keywordflow">for</span> (; first != last; ++first)
+01040 {
+01041 <span class="comment">// nldebug("Trying to load sample bank %s", first-&gt;c_str());</span>
+01042 mixer-&gt;loadSampleBank(<span class="keyword">true</span>, *first);
+01043 }
+01044 <a class="code" href="a02248.html#NLSOUND_1_1CBackgroundSoundManagerz1295_1">_LoadedBanks</a>.insert(loadList.begin(), loadList.end());
+01045 }
+01046 {
+01047 std::set&lt;std::string&gt;::iterator first(unloadList.begin()), last(unloadList.end());
+01048 <span class="keywordflow">for</span> (; first != last; ++first)
+01049 {
+01050 <span class="comment">// nldebug("Trying to unload sample bank %s", first-&gt;c_str());</span>
+01051 <span class="keywordflow">if</span> (mixer-&gt;unloadSampleBank(*first))
+01052 {
+01053 <span class="comment">// ok, the bank is unloaded</span>
+01054 <a class="code" href="a02248.html#NLSOUND_1_1CBackgroundSoundManagerz1295_1">_LoadedBanks</a>.erase(*first);
+01055 }
+01056 <span class="keywordflow">else</span> <span class="keywordflow">if</span> (CSampleBank::findSampleBank(CStringMapper::map(*first)) == 0)
+01057 {
+01058 <span class="comment">// ok, the bank is unavailable !</span>
+01059 <a class="code" href="a02248.html#NLSOUND_1_1CBackgroundSoundManagerz1295_1">_LoadedBanks</a>.erase(*first);
+01060 }
+01061 }
+01062 }
+01063 }
+01064
+01065 <a class="code" href="a04365.html#a2">H_BEFORE</a>(NLSOUND_UpdateSoundLayer)
+01066 <span class="comment">// retreive the root cluster...</span>
+01067 <a class="code" href="a02362.html">NL3D::CCluster</a> *rootCluster = 0;
+01068 <span class="keywordflow">if</span> (mixer-&gt;getClusteredSound() != 0)
+01069 rootCluster = mixer-&gt;getClusteredSound()-&gt;getRootCluster();
+01070
+01071 <span class="comment">// Apply the same algo for each sound layer.</span>
+01072 <span class="keywordflow">for</span> (<a class="code" href="a04558.html#a15">uint</a> i=0; i&lt;<a class="code" href="a05381.html#a4">BACKGROUND_LAYER</a>; ++i)
+01073 {
+01074 vector&lt;TSoundData&gt; &amp;layer = <a class="code" href="a02248.html#NLSOUND_1_1CBackgroundSoundManagerz1296_0">_Layers</a>[i];
+01075 vector&lt;uint&gt; selectedIndex;
+01076 vector&lt;uint&gt; leaveIndex;
+01077
+01078 selectedIndex.reserve(layer.size());
+01079 leaveIndex.reserve(layer.size());
+01080
+01081 <span class="comment">// extract the list of selected/unselected box</span>
+01082 vector&lt;TSoundData&gt;::iterator first(layer.begin()), last(layer.end());
+01083 <span class="keywordflow">for</span> (<a class="code" href="a04558.html#a15">uint</a> <a class="code" href="a04223.html#a577">count</a> = 0; first != last; ++first, ++<a class="code" href="a04223.html#a577">count</a>)
+01084 {
+01085 <span class="keywordflow">if</span> (listener.x &gt;= first-&gt;MinBox.x &amp;&amp; listener.x &lt;= first-&gt;MaxBox.x
+01086 &amp;&amp; listener.y &gt;= first-&gt;MinBox.y &amp;&amp; listener.y &lt;= first-&gt;MaxBox.y
+01087 <span class="comment">// &amp;&amp; listener.z &gt;= first-&gt;MinBox.z &amp;&amp; listener.z &lt;= first-&gt;MaxBox.z</span>
+01088 )
+01089 {
+01090 <span class="comment">// nldebug("patat %u is selected by box (%s)", count, first-&gt;SoundName.c_str());</span>
+01091 selectedIndex.push_back(count);
+01092 }
+01093 <span class="keywordflow">else</span>
+01094 {
+01095 <span class="comment">// nldebug("patat %u is rejected by box (%s)", count, first-&gt;SoundName.c_str());</span>
+01096 <span class="comment">// listener out of this box.</span>
+01097 <span class="keywordflow">if</span> (first-&gt;Selected &amp;&amp; first-&gt;Source != 0)
+01098 {
+01099 <span class="comment">// we leave this box.</span>
+01100 leaveIndex.push_back(count);
+01101 }
+01102 }
+01103 }
+01104
+01105 <span class="comment">// stop all the sound that are leaved.</span>
+01106 {
+01107 vector&lt;uint&gt;::iterator first(leaveIndex.begin()), last(leaveIndex.end());
+01108 <span class="keywordflow">for</span> (; first != last; ++first)
+01109 {
+01110 TSoundData &amp;sd = layer[*first];
+01111 sd.Selected = <span class="keyword">false</span>;
+01112 <span class="keywordflow">if</span> (sd.Source-&gt;isPlaying())
+01113 sd.Source-&gt;stop();
+01114 }
+01115 }
+01116 <span class="comment">// Compute new source mixing in this layer</span>
+01117 {
+01119 multimap&lt;float, TSoundStatus&gt; status;
+01120
+01121 <span class="comment">// first loop to compute selected sound gain and position and order the result by surface..</span>
+01122 {
+01123 vector&lt;uint&gt;::iterator first(selectedIndex.begin()), last(selectedIndex.end());
+01124 <span class="keywordflow">for</span> (; first != last; ++first)
+01125 {
+01126 TSoundData &amp;sd = layer[*first];
+01127 CVector pos;
+01128 <span class="keywordtype">float</span> gain = 1.0f;
+01129 <span class="keywordtype">float</span> distance;
+01130 <span class="keywordtype">bool</span> inside = <span class="keyword">false</span>;
+01131
+01132 <span class="comment">// inside the patat ?</span>
+01133
+01134 <span class="keywordflow">if</span>(CPrimZone::contains(listener, sd.Points, distance, pos, sd.IsPath))
+01135 {
+01136 inside = <span class="keyword">true</span>;
+01137 pos = _LastPosition; <span class="comment">// use the real listener position, not the 0 z centered</span>
+01138 gain = 1.0f;
+01139 <span class="comment">// nlinfo ("inside patate %d name '%s' ", *first, sd.SoundName.c_str());</span>
+01140 }
+01141 <span class="keywordflow">else</span>
+01142 {
+01143 <span class="keywordflow">if</span> (distance &lt; sd.MaxDist)
+01144 {
+01145 <span class="comment">// compute the gain.</span>
+01146 <span class="comment">// gain = (sd.MaxDist - distance) / sd.MaxDist;</span>
+01147 }
+01148 <span class="keywordflow">else</span>
+01149 {
+01150 <span class="comment">// too far</span>
+01151 gain = 0;
+01152 }
+01153 <span class="comment">//nlinfo ("near patate %d name '%s' from %f ", *first, sd.SoundName.c_str(), distance);</span>
+01154 }
+01155
+01156 <span class="comment">// store the status.</span>
+01157 status.insert(make_pair(sd.Surface, TSoundStatus(sd, pos, gain, distance, inside)));
+01158 }
+01159 }
+01160 <span class="comment">// second loop thrue the surface ordered selected sound.</span>
+01161 {
+01162 <span class="comment">// Sound mixing strategie :</span>
+01163 <span class="comment">// The smallest zone sound mask bigger one</span>
+01164
+01165 <span class="keywordtype">float</span> maskFactor = 1.0f;
+01166
+01167 multimap&lt;float, TSoundStatus&gt;::iterator first(status.begin()), last(status.end());
+01168 <span class="keywordflow">for</span> (; first != last; ++first)
+01169 {
+01170 TSoundStatus &amp;ss = first-&gt;second;
+01171
+01172 <span class="keywordflow">if</span> (maskFactor &gt; 0.0f &amp;&amp; ss.Gain &gt; 0)
+01173 {
+01174 <span class="keywordtype">float</span> gain;
+01175
+01176 <span class="keywordflow">if</span> (!ss.SoundData.IsPath &amp;&amp; ss.SoundData.Points.size() &gt; 1)
+01177 gain = maskFactor * ss.Gain;
+01178 <span class="keywordflow">else</span>
+01179 gain = ss.Gain;
+01180
+01181 <span class="comment">// maskFactor -= ss.Gain;</span>
+01182
+01183 ss.SoundData.Selected = <span class="keyword">true</span>;
+01184
+01185 <span class="comment">// if (ss.Gain == 1)</span>
+01186 <span class="comment">// if (ss.Distance == 0)</span>
+01187 <span class="keywordflow">if</span> (ss.Inside)
+01188 {
+01189 <span class="comment">// inside a pattate, then decrease the mask factor will we are more inside the patate</span>
+01190 maskFactor -= first-&gt;second.Distance / <a class="code" href="a05381.html#a2">INSIDE_FALLOF</a>;
+01191 <a class="code" href="a05378.html#a374">clamp</a>(maskFactor, 0.0f, 1.0f);
+01192 }
+01193
+01194 <span class="comment">// start the soond (if needed) and update the volume.</span>
+01195
+01196 <span class="keywordflow">if</span> (ss.SoundData.Source == 0)
+01197 {
+01198 <span class="comment">// try to create the source.</span>
+01199 ss.SoundData.Source = static_cast&lt;CSourceCommon*&gt;(mixer-&gt;createSource(ss.SoundData.Sound, <span class="keyword">false</span>, 0, 0, rootCluster));
+01200 }
+01201 <span class="keywordflow">if</span> (ss.SoundData.Source != 0)
+01202 {
+01203 <span class="comment">// set the volume</span>
+01204 ss.SoundData.Source-&gt;setRelativeGain(gain);
+01205 <span class="comment">// and the position</span>
+01206 ss.Position.z = _LastPosition.z + <a class="code" href="a05381.html#a3">BACKGROUND_SOUND_ALTITUDE</a>;
+01207 ss.SoundData.Source-&gt;setPos(ss.Position);
+01208
+01209 <span class="comment">// nldebug("Setting source %s at %f", ss.SoundData.SoundName.c_str(), gain);</span>
+01210 <span class="keywordflow">if</span> (!ss.SoundData.Source-&gt;isPlaying())
+01211 {
+01212 <span class="comment">// start the sound is needed.</span>
+01213 ss.SoundData.Source-&gt;play();
+01214 }
+01215 <span class="keywordflow">else</span> <span class="keywordflow">if</span> (ss.SoundData.Source-&gt;getType() != CSourceCommon::SOURCE_SIMPLE)
+01216 ss.SoundData.Source-&gt;checkup();
+01217 }
+01218 }
+01219 <span class="keywordflow">else</span> <span class="keywordflow">if</span> (ss.SoundData.Source != 0 &amp;&amp; ss.SoundData.Source-&gt;isPlaying())
+01220 {
+01221 <span class="comment">// stop this too far source.</span>
+01222 ss.SoundData.Source-&gt;stop();
+01223 }
+01224 }
+01225 }
+01226 } <span class="comment">// compute source mixing</span>
+01227 } <span class="comment">// for each layer</span>
+01228
+01229 <a class="code" href="a04365.html#a3">H_AFTER</a>(NLSOUND_UpdateSoundLayer)
+01230
+01231
+01232 <a class="code" href="a04365.html#a2">H_BEFORE</a>(NLSOUND_DoFadeInOut)
+01233 <span class="comment">// update the fade in / out</span>
+01234 <span class="keywordflow">if</span> (<a class="code" href="a02248.html#NLSOUND_1_1CBackgroundSoundManagerr2">_DoFade</a>)
+01235 {
+01236 <a class="code" href="a05378.html#a242">TTime</a> now = <a class="code" href="a02142.html#NLMISC_1_1CTimee0">NLMISC::CTime::getLocalTime</a>();
+01237 <a class="code" href="a02248.html#NLSOUND_1_1CBackgroundSoundManagerr2">_DoFade</a> = <span class="keyword">false</span>;
+01238 <a class="code" href="a04558.html#a15">uint</a> i;
+01239
+01240 <span class="comment">//for each filter</span>
+01241 <span class="keywordflow">for</span> (i=0; i&lt; UAudioMixer::TBackgroundFlags::NB_BACKGROUND_FLAGS; ++i)
+01242 {
+01243 <span class="keywordflow">if</span> (<a class="code" href="a02248.html#NLSOUND_1_1CBackgroundSoundManagerr3">_FilterFadesStart</a>[i] != 0)
+01244 {
+01245 <span class="comment">// this filter is fading</span>
+01246 <span class="keywordflow">if</span> (<a class="code" href="a02248.html#NLSOUND_1_1CBackgroundSoundManagerr1">_BackgroundFlags</a>.Flags[i])
+01247 {
+01248 <span class="comment">// fading out</span>
+01249 <a class="code" href="a05378.html#a242">TTime</a> delta = now - <a class="code" href="a02248.html#NLSOUND_1_1CBackgroundSoundManagerr3">_FilterFadesStart</a>[i];
+01250 <span class="keywordflow">if</span> (delta &gt; <a class="code" href="a02248.html#NLSOUND_1_1CBackgroundSoundManagerr0">_BackgroundFilterFades</a>.FadeOuts[i])
+01251 {
+01252 <span class="comment">// the fade is terminated</span>
+01253 <a class="code" href="a02248.html#NLSOUND_1_1CBackgroundSoundManagerr4">_FilterFadeValues</a>[i] = 0;
+01254 <span class="comment">// stop the fade for this filter</span>
+01255 <a class="code" href="a02248.html#NLSOUND_1_1CBackgroundSoundManagerr3">_FilterFadesStart</a>[i] = 0;
+01256 }
+01257 <span class="keywordflow">else</span>
+01258 {
+01259 <a class="code" href="a02248.html#NLSOUND_1_1CBackgroundSoundManagerr4">_FilterFadeValues</a>[i] = 1 - (float(delta) / <a class="code" href="a02248.html#NLSOUND_1_1CBackgroundSoundManagerr0">_BackgroundFilterFades</a>.FadeOuts[i]);
+01260 <span class="comment">// continue to fade (at least for this filter.</span>
+01261 <a class="code" href="a02248.html#NLSOUND_1_1CBackgroundSoundManagerr2">_DoFade</a> |= <span class="keyword">true</span>;
+01262 }
+01263 }
+01264 <span class="keywordflow">else</span>
+01265 {
+01266 <span class="comment">// fading in</span>
+01267 <a class="code" href="a05378.html#a242">TTime</a> delta = now - <a class="code" href="a02248.html#NLSOUND_1_1CBackgroundSoundManagerr3">_FilterFadesStart</a>[i];
+01268 <span class="keywordflow">if</span> (delta &gt; <a class="code" href="a02248.html#NLSOUND_1_1CBackgroundSoundManagerr0">_BackgroundFilterFades</a>.FadeIns[i])
+01269 {
+01270 <span class="comment">// the fade is terminated</span>
+01271 <a class="code" href="a02248.html#NLSOUND_1_1CBackgroundSoundManagerr4">_FilterFadeValues</a>[i] = 1;
+01272 <span class="comment">// stop the fade for this filter</span>
+01273 <a class="code" href="a02248.html#NLSOUND_1_1CBackgroundSoundManagerr3">_FilterFadesStart</a>[i] = 0;
+01274 }
+01275 <span class="keywordflow">else</span>
+01276 {
+01277 <a class="code" href="a02248.html#NLSOUND_1_1CBackgroundSoundManagerr4">_FilterFadeValues</a>[i] = float(delta) / <a class="code" href="a02248.html#NLSOUND_1_1CBackgroundSoundManagerr0">_BackgroundFilterFades</a>.FadeIns[i];
+01278 <span class="comment">// continue to fade (at least for this filter.</span>
+01279 <a class="code" href="a02248.html#NLSOUND_1_1CBackgroundSoundManagerr2">_DoFade</a> |= <span class="keyword">true</span>;
+01280 }
+01281 }
+01282 }
+01283 }
+01284
+01285 <span class="comment">// update all playing background source that filter value has changed</span>
+01286 <span class="comment">// for each layer</span>
+01287 <span class="keywordflow">for</span> (i=0; i&lt;<a class="code" href="a05381.html#a4">BACKGROUND_LAYER</a>; ++i)
+01288 {
+01289 <span class="comment">// for each patat</span>
+01290 std::vector&lt;TSoundData&gt;::iterator first(_Layers[i].begin()), last(_Layers[i].end());
+01291 <span class="keywordflow">for</span> (; first != last; ++first)
+01292 {
+01293 <span class="keywordflow">if</span> (first-&gt;Selected)
+01294 {
+01295 <span class="comment">// update this playing sound</span>
+01296 <span class="keywordflow">if</span> (first-&gt;Source != 0 &amp;&amp; first-&gt;Source-&gt;getType() == CSourceCommon::SOURCE_BACKGROUND)
+01297 static_cast&lt;CBackgroundSource*&gt;(first-&gt;Source)-&gt;updateFilterValues(_FilterFadeValues);
+01298 }
+01299 }
+01300
+01301 }
+01302
+01303 <span class="keywordflow">if</span> (!<a class="code" href="a02248.html#NLSOUND_1_1CBackgroundSoundManagerr2">_DoFade</a>)
+01304 {
+01305 <span class="comment">// we can remove the update.</span>
+01306 mixer-&gt;unregisterUpdate(<span class="keyword">this</span>);
+01307 }
+01308 }
+01309 <a class="code" href="a04365.html#a3">H_AFTER</a>(NLSOUND_DoFadeInOut)
+01310 }
+</pre></div> </td>
+ </tr>
+</table>
+<hr><h2>Friends And Related Function Documentation</h2>
+<a class="anchor" name="NLSOUND_1_1CBackgroundSoundManagern0" doxytag="NLSOUND::CBackgroundSoundManager::CAudioMixerUser" ></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"> friend class <a class="el" href="a02235.html">CAudioMixerUser</a><code> [friend]</code>
+ </table>
+ </td>
+ </tr>
+</table>
+<table cellspacing=5 cellpadding=0 border=0>
+ <tr>
+ <td>
+ &nbsp;
+ </td>
+ <td>
+
+<p>
+
+<p>
+Definition at line <a class="el" href="a05472.html#l00147">147</a> of file <a class="el" href="a05472.html">background_sound_manager.h</a>. </td>
+ </tr>
+</table>
+<hr><h2>Field Documentation</h2>
+<a class="anchor" name="NLSOUND_1_1CBackgroundSoundManagerr0" doxytag="NLSOUND::CBackgroundSoundManager::_BackgroundFilterFades" ></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="a03920.html">UAudioMixer::TBackgroundFilterFades</a> <a class="el" href="a02248.html#NLSOUND_1_1CBackgroundSoundManagerr0">NLSOUND::CBackgroundSoundManager::_BackgroundFilterFades</a><code> [private]</code>
+ </table>
+ </td>
+ </tr>
+</table>
+<table cellspacing=5 cellpadding=0 border=0>
+ <tr>
+ <td>
+ &nbsp;
+ </td>
+ <td>
+
+<p>
+Background filters fades.
+<p>
+
+<p>
+Definition at line <a class="el" href="a05472.html#l00200">200</a> of file <a class="el" href="a05472.html">background_sound_manager.h</a>.
+<p>
+Referenced by <a class="el" href="a05471.html#l00087">getBackgroundFilterFades()</a>, <a class="el" href="a05471.html#l00082">setBackgroundFilterFades()</a>, <a class="el" href="a05471.html#l01312">setBackgroundFlags()</a>, and <a class="el" href="a05471.html#l00861">updateBackgroundStatus()</a>. </td>
+ </tr>
+</table>
+<a class="anchor" name="NLSOUND_1_1CBackgroundSoundManagerr1" doxytag="NLSOUND::CBackgroundSoundManager::_BackgroundFlags" ></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="a03921.html">UAudioMixer::TBackgroundFlags</a> <a class="el" href="a02248.html#NLSOUND_1_1CBackgroundSoundManagerr1">NLSOUND::CBackgroundSoundManager::_BackgroundFlags</a><code> [private]</code>
+ </table>
+ </td>
+ </tr>
+</table>
+<table cellspacing=5 cellpadding=0 border=0>
+ <tr>
+ <td>
+ &nbsp;
+ </td>
+ <td>
+
+<p>
+Background flags.
+<p>
+
+<p>
+Definition at line <a class="el" href="a05472.html#l00198">198</a> of file <a class="el" href="a05472.html">background_sound_manager.h</a>.
+<p>
+Referenced by <a class="el" href="a05471.html#l00060">CBackgroundSoundManager()</a>, <a class="el" href="a05471.html#l00076">getBackgroundFlags()</a>, <a class="el" href="a05471.html#l00778">play()</a>, <a class="el" href="a05471.html#l01312">setBackgroundFlags()</a>, and <a class="el" href="a05471.html#l00861">updateBackgroundStatus()</a>. </td>
+ </tr>
+</table>
+<a class="anchor" name="NLSOUND_1_1CBackgroundSoundManagerz1295_0" doxytag="NLSOUND::CBackgroundSoundManager::_Banks" ></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::vector&lt;<a class="el" href="a02249.html">TBanksData</a>&gt; <a class="el" href="a02248.html#NLSOUND_1_1CBackgroundSoundManagerz1295_0">NLSOUND::CBackgroundSoundManager::_Banks</a><code> [private]</code>
+ </table>
+ </td>
+ </tr>
+</table>
+<table cellspacing=5 cellpadding=0 border=0>
+ <tr>
+ <td>
+ &nbsp;
+ </td>
+ <td>
+
+<p>
+Container for the banks primitive.
+<p>
+
+<p>
+Definition at line <a class="el" href="a05472.html#l00229">229</a> of file <a class="el" href="a05472.html">background_sound_manager.h</a>. </td>
+ </tr>
+</table>
+<a class="anchor" name="NLSOUND_1_1CBackgroundSoundManagerr2" doxytag="NLSOUND::CBackgroundSoundManager::_DoFade" ></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="a02248.html#NLSOUND_1_1CBackgroundSoundManagerr2">NLSOUND::CBackgroundSoundManager::_DoFade</a><code> [private]</code>
+ </table>
+ </td>
+ </tr>
+</table>
+<table cellspacing=5 cellpadding=0 border=0>
+ <tr>
+ <td>
+ &nbsp;
+ </td>
+ <td>
+
+<p>
+Is some fade in/out running?
+<p>
+
+<p>
+Definition at line <a class="el" href="a05472.html#l00206">206</a> of file <a class="el" href="a05472.html">background_sound_manager.h</a>.
+<p>
+Referenced by <a class="el" href="a05471.html#l00778">play()</a>, <a class="el" href="a05471.html#l01312">setBackgroundFlags()</a>, and <a class="el" href="a05471.html#l00861">updateBackgroundStatus()</a>. </td>
+ </tr>
+</table>
+<a class="anchor" name="NLSOUND_1_1CBackgroundSoundManagerr3" doxytag="NLSOUND::CBackgroundSoundManager::_FilterFadesStart" ></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="a05378.html#a242">NLMISC::TTime</a> <a class="el" href="a02248.html#NLSOUND_1_1CBackgroundSoundManagerr3">NLSOUND::CBackgroundSoundManager::_FilterFadesStart</a>[UAudioMixer::TBackgroundFlags::NB_BACKGROUND_FLAGS]<code> [private]</code>
+ </table>
+ </td>
+ </tr>
+</table>
+<table cellspacing=5 cellpadding=0 border=0>
+ <tr>
+ <td>
+ &nbsp;
+ </td>
+ <td>
+
+<p>
+The date of last fade in or out started for each filter.
+<p>
+
+<p>
+Definition at line <a class="el" href="a05472.html#l00202">202</a> of file <a class="el" href="a05472.html">background_sound_manager.h</a>.
+<p>
+Referenced by <a class="el" href="a05471.html#l00060">CBackgroundSoundManager()</a>, <a class="el" href="a05471.html#l00778">play()</a>, <a class="el" href="a05471.html#l01312">setBackgroundFlags()</a>, and <a class="el" href="a05471.html#l00861">updateBackgroundStatus()</a>. </td>
+ </tr>
+</table>
+<a class="anchor" name="NLSOUND_1_1CBackgroundSoundManagerr4" doxytag="NLSOUND::CBackgroundSoundManager::_FilterFadeValues" ></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"> float <a class="el" href="a02248.html#NLSOUND_1_1CBackgroundSoundManagerr4">NLSOUND::CBackgroundSoundManager::_FilterFadeValues</a>[UAudioMixer::TBackgroundFlags::NB_BACKGROUND_FLAGS]<code> [private]</code>
+ </table>
+ </td>
+ </tr>
+</table>
+<table cellspacing=5 cellpadding=0 border=0>
+ <tr>
+ <td>
+ &nbsp;
+ </td>
+ <td>
+
+<p>
+The filter fade values.
+<p>
+
+<p>
+Definition at line <a class="el" href="a05472.html#l00204">204</a> of file <a class="el" href="a05472.html">background_sound_manager.h</a>.
+<p>
+Referenced by <a class="el" href="a05471.html#l00060">CBackgroundSoundManager()</a>, <a class="el" href="a05472.html#l00139">getFilterValues()</a>, <a class="el" href="a05471.html#l00778">play()</a>, <a class="el" href="a05471.html#l01312">setBackgroundFlags()</a>, and <a class="el" href="a05471.html#l00861">updateBackgroundStatus()</a>. </td>
+ </tr>
+</table>
+<a class="anchor" name="NLSOUND_1_1CBackgroundSoundManagerr5" doxytag="NLSOUND::CBackgroundSoundManager::_FxZones" ></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::vector&lt;<a class="el" href="a02250.html">TFxZone</a>&gt; <a class="el" href="a02248.html#NLSOUND_1_1CBackgroundSoundManagerr5">NLSOUND::CBackgroundSoundManager::_FxZones</a><code> [private]</code>
+ </table>
+ </td>
+ </tr>
+</table>
+<table cellspacing=5 cellpadding=0 border=0>
+ <tr>
+ <td>
+ &nbsp;
+ </td>
+ <td>
+
+<p>
+Container for the fx primitive.
+<p>
+
+<p>
+Definition at line <a class="el" href="a05472.html#l00305">305</a> of file <a class="el" href="a05472.html">background_sound_manager.h</a>.
+<p>
+Referenced by <a class="el" href="a05471.html#l00473">addFxZone()</a>, <a class="el" href="a05471.html#l00618">load()</a>, <a class="el" href="a05471.html#l00441">loadEffectsFromPrimitives()</a>, and <a class="el" href="a05471.html#l00861">updateBackgroundStatus()</a>. </td>
+ </tr>
+</table>
+<a class="anchor" name="NLSOUND_1_1CBackgroundSoundManagerr6" doxytag="NLSOUND::CBackgroundSoundManager::_LastEnv" ></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="a05378.html#a236">NLMISC::TStringId</a> <a class="el" href="a02248.html#NLSOUND_1_1CBackgroundSoundManagerr6">NLSOUND::CBackgroundSoundManager::_LastEnv</a><code> [private]</code>
+ </table>
+ </td>
+ </tr>
+</table>
+<table cellspacing=5 cellpadding=0 border=0>
+ <tr>
+ <td>
+ &nbsp;
+ </td>
+ <td>
+
+<p>
+Last setted env fx. Used when clustered sound is not active.
+<p>
+
+<p>
+Definition at line <a class="el" href="a05472.html#l00307">307</a> of file <a class="el" href="a05472.html">background_sound_manager.h</a>.
+<p>
+Referenced by <a class="el" href="a05471.html#l00861">updateBackgroundStatus()</a>. </td>
+ </tr>
+</table>
+<a class="anchor" name="NLSOUND_1_1CBackgroundSoundManagerr7" doxytag="NLSOUND::CBackgroundSoundManager::_LastPosition" ></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="a03128.html">NLMISC::CVector</a> <a class="el" href="a02248.html#NLSOUND_1_1CBackgroundSoundManagerr7">NLSOUND::CBackgroundSoundManager::_LastPosition</a><code> [private]</code>
+ </table>
+ </td>
+ </tr>
+</table>
+<table cellspacing=5 cellpadding=0 border=0>
+ <tr>
+ <td>
+ &nbsp;
+ </td>
+ <td>
+
+<p>
+The last position of the listener.
+<p>
+
+<p>
+Definition at line <a class="el" href="a05472.html#l00209">209</a> of file <a class="el" href="a05472.html">background_sound_manager.h</a>.
+<p>
+Referenced by <a class="el" href="a05471.html#l00850">setListenerPosition()</a>, and <a class="el" href="a05471.html#l00861">updateBackgroundStatus()</a>. </td>
+ </tr>
+</table>
+<a class="anchor" name="NLSOUND_1_1CBackgroundSoundManagerz1296_0" doxytag="NLSOUND::CBackgroundSoundManager::_Layers" ></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::vector&lt;<a class="el" href="a02251.html">TSoundData</a>&gt; <a class="el" href="a02248.html#NLSOUND_1_1CBackgroundSoundManagerz1296_0">NLSOUND::CBackgroundSoundManager::_Layers</a>[<a class="el" href="a05381.html#a4">BACKGROUND_LAYER</a>]<code> [private]</code>
+ </table>
+ </td>
+ </tr>
+</table>
+<table cellspacing=5 cellpadding=0 border=0>
+ <tr>
+ <td>
+ &nbsp;
+ </td>
+ <td>
+
+<p>
+Array of vector of sound data.
+<p>
+
+<p>
+Definition at line <a class="el" href="a05472.html#l00265">265</a> of file <a class="el" href="a05472.html">background_sound_manager.h</a>.
+<p>
+Referenced by <a class="el" href="a05471.html#l00093">addSound()</a>, <a class="el" href="a05471.html#l00618">load()</a>, <a class="el" href="a05471.html#l00801">stop()</a>, <a class="el" href="a05471.html#l00823">unload()</a>, and <a class="el" href="a05471.html#l00861">updateBackgroundStatus()</a>. </td>
+ </tr>
+</table>
+<a class="anchor" name="NLSOUND_1_1CBackgroundSoundManagerz1295_1" doxytag="NLSOUND::CBackgroundSoundManager::_LoadedBanks" ></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::set&lt;std::string&gt; <a class="el" href="a02248.html#NLSOUND_1_1CBackgroundSoundManagerz1295_1">NLSOUND::CBackgroundSoundManager::_LoadedBanks</a><code> [private]</code>
+ </table>
+ </td>
+ </tr>
+</table>
+<table cellspacing=5 cellpadding=0 border=0>
+ <tr>
+ <td>
+ &nbsp;
+ </td>
+ <td>
+
+<p>
+Container for the list of currently loaded banks.
+<p>
+
+<p>
+Definition at line <a class="el" href="a05472.html#l00231">231</a> of file <a class="el" href="a05472.html">background_sound_manager.h</a>.
+<p>
+Referenced by <a class="el" href="a05471.html#l00861">updateBackgroundStatus()</a>. </td>
+ </tr>
+</table>
+<a class="anchor" name="NLSOUND_1_1CBackgroundSoundManagerr8" doxytag="NLSOUND::CBackgroundSoundManager::_Playing" ></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="a02248.html#NLSOUND_1_1CBackgroundSoundManagerr8">NLSOUND::CBackgroundSoundManager::_Playing</a><code> [private]</code>
+ </table>
+ </td>
+ </tr>
+</table>
+<table cellspacing=5 cellpadding=0 border=0>
+ <tr>
+ <td>
+ &nbsp;
+ </td>
+ <td>
+
+<p>
+Flag for playing background sounds.
+<p>
+
+<p>
+Definition at line <a class="el" href="a05472.html#l00195">195</a> of file <a class="el" href="a05472.html">background_sound_manager.h</a>.
+<p>
+Referenced by <a class="el" href="a05471.html#l00272">loadAudioFromPrimitives()</a>, <a class="el" href="a05471.html#l00574">loadSoundsFromRegion()</a>, <a class="el" href="a05471.html#l00778">play()</a>, <a class="el" href="a05471.html#l00801">stop()</a>, and <a class="el" href="a05471.html#l00861">updateBackgroundStatus()</a>. </td>
+ </tr>
+</table>
+<hr>The documentation for this class was generated from the following files:<ul>
+<li><a class="el" href="a05472.html">background_sound_manager.h</a><li><a class="el" href="a05471.html">background_sound_manager.cpp</a></ul>
+<hr size="1"><address style="align: right;"><small>Generated on Tue Mar 16 14:31:47 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>