1 // NeL - MMORPG Framework <http://dev.ryzom.com/projects/nel/>
2 // Copyright (C) 2010 Winch Gate Property Limited
4 // This program is free software: you can redistribute it and/or modify
5 // it under the terms of the GNU Affero General Public License as
6 // published by the Free Software Foundation, either version 3 of the
7 // License, or (at your option) any later version.
9 // This program is distributed in the hope that it will be useful,
10 // but WITHOUT ANY WARRANTY; without even the implied warranty of
11 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 // GNU Affero General Public License for more details.
14 // You should have received a copy of the GNU Affero General Public License
15 // along with this program. If not, see <http://www.gnu.org/licenses/>.
18 #ifndef OV_SOUND_SYTEM_H
19 #define OV_SOUND_SYTEM_H
22 #include <nel/misc/types_nl.h>
23 #include <nel/misc/vector.h>
27 #include "nel/sound/sound_anim_manager.h"
41 /// this class init the sound system used by the object viewer
45 /// set the name of the file containing the sound bank
46 /* static void addSoundBank(const std::string &soundBankFileName)
48 _SoundBanksFileName.insert(soundBankFileName);
50 */ /// set the name of the file containing the sample bank
51 static void addSampleBank(const std::string
&sampleBankFileName
)
53 _SampleBanksFileName
.insert(sampleBankFileName
);
56 static void setSamplePath(std::string
& path
) { _SamplePath
= NLMISC::CPath::standardizePath(path
, true); }
57 static void setPackedSheetPath(std::string
& path
) { _PackedSheetPath
= NLMISC::CPath::standardizePath(path
, true); }
59 /** Init the sound system this also load the sound bank
62 static void initSoundSystem(void);
64 /// release the sound system
65 static void releaseSoundSystem(void);
67 /// set the listener matrix.
68 static void setListenerMatrix(const NLMISC::CMatrix
&m
);
70 /// poll sound. Must be called periodically
71 static void poll(void);
73 // spawn a sound at the user position
74 static void play(const std::string
&soundName
);
75 // create a sound at the user position (don't spawn it)
76 static NLSOUND::USource
*create(const std::string
&soundName
);
78 // get the audio mixer, or null if init failed
79 static NLSOUND::UAudioMixer
*getAudioMixer(void) { return _AudioMixer
; }
81 /// Load the sound animation with the specified name
82 static void loadAnimation(std::string
& name
) { _AnimManager
->loadAnimation(name
); }
84 /// Start playing a sound animation.
85 static void playAnimation(std::string
& name
, float lastTime
, float curTime
, NLSOUND::CSoundContext
&context
);
87 /// Update the sound animations.
88 //static void updateAnimations(float lastTime, float curTime) { _AnimManager->update(lastTime, curTime); };
91 /// Returns a reference to the animation manager
92 static NLSOUND::CSoundAnimManager
* getSoundAnimManager() { return _AnimManager
; }
95 static NLSOUND::UAudioMixer
*_AudioMixer
;
96 // static std::set<std::string> _SoundBanksFileName;
97 static std::set
<std::string
> _SampleBanksFileName
;
98 static NLSOUND::CSoundAnimManager
*_AnimManager
;
99 //static sint _AnimIndex;
100 //static NLSOUND::TSoundAnimId _CurrentAnimation;
101 //static NLSOUND::TSoundAnimPlayId _CurrentPlayback;
102 static NLMISC::CVector _Zero
;
103 static std::string _SamplePath
;
104 static std::string _PackedSheetPath
;