4 * The scene for sounds.
8 * ***** BEGIN GPL LICENSE BLOCK *****
10 * This program is free software; you can redistribute it and/or
11 * modify it under the terms of the GNU General Public License
12 * as published by the Free Software Foundation; either version 2
13 * of the License, or (at your option) any later version.
15 * This program is distributed in the hope that it will be useful,
16 * but WITHOUT ANY WARRANTY; without even the implied warranty of
17 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
18 * GNU General Public License for more details.
20 * You should have received a copy of the GNU General Public License
21 * along with this program; if not, write to the Free Software Foundation,
22 * Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
24 * The Original Code is Copyright (C) 2001-2002 by NaN Holding BV.
25 * All rights reserved.
27 * The Original Code is: all of this file.
29 * Contributor(s): none yet.
31 * ***** END GPL LICENSE BLOCK *****
35 #pragma warning (disable:4786) // get rid of stupid stl-visual compiler debug warning
41 #include "SoundDefines.h"
42 #include "SND_SoundObject.h"
43 #include "SND_CDObject.h"
44 #include "SND_SoundListener.h"
45 #include "SND_WaveSlot.h"
47 #include "MT_Vector3.h"
48 #include "MT_Matrix3x3.h"
49 #include "STR_String.h"
56 std::set<class SND_SoundObject*> m_soundobjects;
58 GEN_List m_activeobjects;
59 class SND_IAudioDevice* m_audiodevice;
60 class SND_WaveCache* m_wavecache;
61 class SND_SoundListener m_listener;
62 bool m_audio; // to check if audio works
63 bool m_audioplayback; // to check if audioplayback is wanted
65 void UpdateListener();
66 void BuildActiveList(MT_Scalar curtime);
67 void UpdateActiveObects();
71 SND_Scene(SND_IAudioDevice* adi);
74 bool IsPlaybackWanted();
76 void AddActiveObject(SND_SoundObject* pObject, MT_Scalar curtime);
77 void RemoveActiveObject(SND_SoundObject* pObject);
78 void DeleteObjectWhenFinished(SND_SoundObject* pObject);
82 int LoadSample(const STR_String& samplename,
85 void RemoveAllSamples();
86 bool CheckBuffer(SND_SoundObject* pObject);
87 bool IsSampleLoaded(STR_String& samplename);
89 void AddObject(SND_SoundObject* pObject);
90 bool SetCDObject(SND_CDObject* cdobject);
91 void DeleteObject(SND_SoundObject* pObject);
92 void RemoveAllObjects();
93 void StopAllObjects();
94 int GetObjectStatus(SND_SoundObject* pObject) const;
96 void SetListenerTransform(const MT_Vector3& pos,
97 const MT_Vector3& vel,
98 const MT_Matrix3x3& mat);
100 SND_SoundListener* GetListener();
103 #endif //__SND_SCENE_H