fixed spacing in the headers to get rid of some warnings and some other
[blender.git] / intern / SoundSystem / SND_Scene.h
1 /*
2  * SND_Scene.h
3  *
4  * The scene for sounds.
5  *
6  * $Id$
7  *
8  * ***** BEGIN GPL/BL DUAL LICENSE BLOCK *****
9  *
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. The Blender
14  * Foundation also sells licenses for use in proprietary software under
15  * the Blender License.  See http://www.blender.org/BL/ for information
16  * about this.
17  *
18  * This program is distributed in the hope that it will be useful,
19  * but WITHOUT ANY WARRANTY; without even the implied warranty of
20  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
21  * GNU General Public License for more details.
22  *
23  * You should have received a copy of the GNU General Public License
24  * along with this program; if not, write to the Free Software Foundation,
25  * Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
26  *
27  * The Original Code is Copyright (C) 2001-2002 by NaN Holding BV.
28  * All rights reserved.
29  *
30  * The Original Code is: all of this file.
31  *
32  * Contributor(s): none yet.
33  *
34  * ***** END GPL/BL DUAL LICENSE BLOCK *****
35  */
36
37 #ifdef WIN32
38 #pragma warning (disable:4786) // get rid of stupid stl-visual compiler debug warning
39 #endif //WIN32
40
41 #ifndef __SND_SCENE_H
42 #define __SND_SCENE_H
43
44 #include "SoundDefines.h"
45 #include "SND_SoundObject.h"
46 #include "SND_CDObject.h"
47 #include "SND_SoundListener.h"
48 #include "SND_WaveSlot.h"
49
50 #include "MT_Vector3.h"
51 #include "MT_Matrix3x3.h"
52 #include "STR_String.h"
53
54 #include <set>
55
56
57 class SND_Scene
58 {
59         std::set<class SND_SoundObject*>        m_soundobjects;
60
61         GEN_List                                        m_activeobjects;
62         class SND_IAudioDevice*         m_audiodevice;
63         class SND_WaveCache*            m_wavecache;
64         class SND_SoundListener         m_listener;
65         bool                                            m_audio;                        // to check if audio works
66         bool                                            m_audioplayback;        // to check if audioplayback is wanted
67
68         void                                    UpdateListener();
69         void                                    BuildActiveList(MT_Scalar curtime);
70         void                                    UpdateActiveObects();
71         void                                    UpdateCD();
72
73 public:
74         SND_Scene(SND_IAudioDevice* adi);
75         ~SND_Scene();
76
77         bool                            IsPlaybackWanted();
78
79         void                            AddActiveObject(SND_SoundObject* pObject, MT_Scalar curtime);
80         void                            RemoveActiveObject(SND_SoundObject* pObject);
81         void                            DeleteObjectWhenFinished(SND_SoundObject* pObject);
82
83         void                            Proceed();
84
85         int                                     LoadSample(const STR_String& samplename,
86                                                                    void* memlocation,
87                                                                    int size);
88         void                            RemoveAllSamples();
89         bool                            CheckBuffer(SND_SoundObject* pObject);
90         bool                            IsSampleLoaded(STR_String& samplename);
91
92         void                            AddObject(SND_SoundObject* pObject);
93         bool                            SetCDObject(SND_CDObject* cdobject);
94         void                            DeleteObject(SND_SoundObject* pObject);
95         void                            RemoveAllObjects();
96         void                            StopAllObjects();
97         int                                     GetObjectStatus(SND_SoundObject* pObject) const;
98
99         void                            SetListenerTransform(const MT_Vector3& pos,
100                                                                                          const MT_Vector3& vel,
101                                                                                          const MT_Matrix3x3& mat);
102
103         SND_SoundListener*      GetListener();
104 };
105
106 #endif //__SND_SCENE_H
107