Added aqua_speed for rite geo 50 tryker
[ryzomcore.git] / nel / tools / 3d / object_viewer / sound_system.h
blobf11f15d75f493c5788d970560b9c27348d238711
1 // NeL - MMORPG Framework <http://dev.ryzom.com/projects/nel/>
2 // Copyright (C) 2010 Winch Gate Property Limited
3 //
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.
8 //
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>
24 #include <string>
25 #include <set>
27 #include "nel/sound/sound_anim_manager.h"
30 namespace NLSOUND
32 class UAudioMixer;
33 class USource;
36 namespace NLMISC
38 class CMatrix;
41 /// this class init the sound system used by the object viewer
42 class CSoundSystem
44 public:
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
60 * See setSoundBank
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; }
94 private:
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;
109 #endif