Planeshift
dummysndmngr.h
Go to the documentation of this file.
1 /*
2 * dummysndmngr.h, Author: Andrea Rizzi <88whacko@gmail.com>
3 *
4 * Copyright (C) 2001-2008 Atomic Blue (info@planeshift.it, http://www.atomicblue.org)
5 *
6 *
7 * This program is free software; you can redistribute it and/or
8 * modify it under the terms of the GNU General Public License
9 * as published by the Free Software Foundation (version 2 of the License)
10 * This program is distributed in the hope that it will be useful,
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 * GNU General Public License for more details.
14 * You should have received a copy of the GNU General Public License
15 * along with this program; if not, write to the Free Software
16 * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
17 *
18 */
19 
20 #ifndef _DUMMYSNDMNGR_H_
21 #define _DUMMYSNDMNGR_H_
22 
23 //====================================================================================
24 // Crystal Space Includes
25 //====================================================================================
26 #include <iutil/comp.h>
27 #include <csgeom/vector3.h>
28 #include <iutil/document.h>
29 
30 //====================================================================================
31 // Project Includes
32 //====================================================================================
33 #include <isoundmngr.h>
34 
35 //------------------------------------------------------------------------------------
36 // Forward Declarations
37 //------------------------------------------------------------------------------------
38 struct iObjectRegistry;
39 class DummySoundControl;
40 
45 class DummySoundManager: public scfImplementation2<DummySoundManager, iSoundManager, iComponent>
46 {
47 public:
48  DummySoundManager(iBase* parent);
49  virtual ~DummySoundManager();
50 
51  //From iComponent
52  virtual bool Initialize(iObjectRegistry* objReg);
53 
54  //From iSoundManager
55  //Sectors managing
56  virtual bool InitializeSectors();
57  virtual bool LoadActiveSector(const char* sectorName);
58  virtual bool ReloadSectors();
59 
60  //SoundControls and SoundQueue managing
61  virtual iSoundControl* GetSndCtrl(SndCtrlID sndCtrlID);
62  virtual bool AddSndQueue(int queueID, SndCtrlID sndCtrlID);
63  virtual void RemoveSndQueue(int queueID);
64  virtual bool PushQueueItem(int queueID, const char* fileName);
65 
66  //State
67  virtual bool IsSoundActive(SndCtrlID sndCtrlID);
68  virtual void SetCombatStance(int newCombatStance);
69  virtual int GetCombatStance() const;
70  virtual void SetPlayerMovement(csVector3 playerPosition, csVector3 playerVelocity);
71  virtual csVector3 GetPosition() const;
72  virtual void SetTimeOfDay(int newTimeOfDay);
73  virtual void SetWeather(int newWeather);
74  virtual void SetEntityState(int state, iMeshWrapper* mesh, const char* meshName, bool forceChange);
75  virtual void AddObjectEntity(iMeshWrapper* mesh, const char* meshName);
76  virtual void RemoveObjectEntity(iMeshWrapper* mesh, const char* meshName);
77  virtual void UpdateObjectEntity(iMeshWrapper* mesh, const char* meshName);
78 
79  //Toggles
80  virtual void SetLoopBGMToggle(bool toggle);
81  virtual bool IsLoopBGMToggleOn();
82  virtual void SetCombatMusicToggle(bool toggle);
83  virtual bool IsCombatMusicToggleOn();
84  virtual void SetListenerOnCameraToggle(bool toggle);
85  virtual bool IsListenerOnCameraToggleOn();
86  virtual void SetChatToggle(bool toggle);
87  virtual bool IsChatToggleOn();
88 
89  //Play sounds
90  virtual bool IsSoundValid(uint soundID) const;
91  virtual uint PlaySound(const char* fileName, bool loop, SndCtrlID sndCtrlID);
92  virtual uint PlaySound(const char* fileName, bool loop, SndCtrlID sndCtrlID, csVector3 pos, csVector3 dir, float minDist, float maxDist);
93  virtual uint PlaySong(csRef<iDocument> musicalSheet, const char* instrument,
94  SndCtrlID sndCtrlID, csVector3 pos, csVector3 dir);
95  virtual bool StopSound(uint soundID);
96  virtual bool SetSoundSource(uint soundID, csVector3 position);
97 
98  //Updating function
99  virtual void Update();
100  virtual void UpdateListener(iView* view);
101 
102 
103 private:
104  DummySoundControl* defaultSndCtrl;
105  csVector3 position;
106  int combat;
107  bool loopToggle;
108  bool combatToggle;
109  bool listenerToggle;
110  bool chatToggle;
111 };
112 
113 #endif // __DUMMYSNDMNGR_H_
virtual bool Initialize(iObjectRegistry *objReg)
This is just a dummy implementation of iSoundControl.
Definition: dummysndctrl.h:34
virtual bool ReloadSectors()
virtual int GetCombatStance() const
virtual bool IsChatToggleOn()
virtual uint PlaySound(const char *fileName, bool loop, SndCtrlID sndCtrlID)
virtual bool LoadActiveSector(const char *sectorName)
virtual void SetWeather(int newWeather)
virtual void AddObjectEntity(iMeshWrapper *mesh, const char *meshName)
virtual void SetListenerOnCameraToggle(bool toggle)
virtual void RemoveObjectEntity(iMeshWrapper *mesh, const char *meshName)
virtual void UpdateListener(iView *view)
virtual ~DummySoundManager()
virtual void RemoveSndQueue(int queueID)
DummySoundManager(iBase *parent)
virtual bool IsCombatMusicToggleOn()
virtual bool IsListenerOnCameraToggleOn()
virtual bool PushQueueItem(int queueID, const char *fileName)
virtual void UpdateObjectEntity(iMeshWrapper *mesh, const char *meshName)
This is a dummy implementation of iSoundManager.
Definition: dummysndmngr.h:45
virtual void SetCombatStance(int newCombatStance)
virtual iSoundControl * GetSndCtrl(SndCtrlID sndCtrlID)
virtual bool IsSoundActive(SndCtrlID sndCtrlID)
virtual void SetChatToggle(bool toggle)
virtual bool SetSoundSource(uint soundID, csVector3 position)
virtual void SetEntityState(int state, iMeshWrapper *mesh, const char *meshName, bool forceChange)
virtual bool StopSound(uint soundID)
virtual void SetCombatMusicToggle(bool toggle)
virtual bool InitializeSectors()
virtual bool IsLoopBGMToggleOn()
virtual void SetTimeOfDay(int newTimeOfDay)
virtual csVector3 GetPosition() const
virtual bool IsSoundValid(uint soundID) const
virtual void Update()
virtual void SetPlayerMovement(csVector3 playerPosition, csVector3 playerVelocity)
virtual bool AddSndQueue(int queueID, SndCtrlID sndCtrlID)
virtual void SetLoopBGMToggle(bool toggle)
virtual uint PlaySong(csRef< iDocument > musicalSheet, const char *instrument, SndCtrlID sndCtrlID, csVector3 pos, csVector3 dir)