-
Notifications
You must be signed in to change notification settings - Fork 1
/
SoundController.h
62 lines (46 loc) · 1.99 KB
/
SoundController.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
/*
Copyright (C) 2011-2012 Erkin Cakar
TeamTwo is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
TeamTwo is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
Contact: projectteamtwo@gmail.com
*/
#ifndef SOUNDCONTROLLER_H
#define SOUNDCONTROLLER_H
#include <OgreAL/OgreAL.h>
#include <OgreAL/OgreALListener.h>
class SoundController {
public:
SoundController();
~SoundController();
static SoundController* getSingleton();
void attachDynamicSound( Ogre::SceneNode* sceneNode, std::string name, std::string path, bool repat=false );
void attachStaticSound( std::string name, std::string path, bool repeat=false );
void playSound( std::string name, bool restart=false );
void pauseSound( std::string name );
void stopSound( std::string name );
void updateAllSoundPositions();
void setBackgroundSound( std::string path, bool repeat=true );
void setBackgroundSoundVolume(float level);
void playBackgroundSound();
void pauseBackgroundSound();
void stopBackgroundSound();
void setListener(Ogre::SceneNode* listenerNode);
bool deleteSound(std::string name);
void deleteAllSounds();
static SoundController *singleton;
OgreAL::SoundManager *soundManager;
private:
std::map<std::string, Ogre::SceneNode*> dynamicSoundList;
std::vector<std::string> staticSoundList;
std::string backgroundSound;
Ogre::SceneNode* listenerNode;
};
#endif /* SOUNDCONTROLLER_H */