Windows: fixing user preference window opening full screen
[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 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.
14  *
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.
19  *
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.
23  *
24  * The Original Code is Copyright (C) 2001-2002 by NaN Holding BV.
25  * All rights reserved.
26  *
27  * The Original Code is: all of this file.
28  *
29  * Contributor(s): none yet.
30  *
31  * ***** END GPL LICENSE BLOCK *****
32  */
33
34 #ifdef WIN32
35 #pragma warning (disable:4786) // get rid of stupid stl-visual compiler debug warning
36 #endif //WIN32
37
38 #ifndef __SND_SCENE_H
39 #define __SND_SCENE_H
40
41 #include "SoundDefines.h"
42 #include "SND_SoundObject.h"
43 #include "SND_CDObject.h"
44 #include "SND_SoundListener.h"
45 #include "SND_WaveSlot.h"
46
47 #include "MT_Vector3.h"
48 #include "MT_Matrix3x3.h"
49 #include "STR_String.h"
50
51 #include <set>
52
53
54 class SND_Scene
55 {
56         std::set<class SND_SoundObject*>        m_soundobjects;
57
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
64
65         void                                    UpdateListener();
66         void                                    BuildActiveList(MT_Scalar curtime);
67         void                                    UpdateActiveObects();
68         void                                    UpdateCD();
69
70 public:
71         SND_Scene(SND_IAudioDevice* adi);
72         ~SND_Scene();
73
74         bool                            IsPlaybackWanted();
75
76         void                            AddActiveObject(SND_SoundObject* pObject, MT_Scalar curtime);
77         void                            RemoveActiveObject(SND_SoundObject* pObject);
78         void                            DeleteObjectWhenFinished(SND_SoundObject* pObject);
79
80         void                            Proceed();
81
82         int                                     LoadSample(const STR_String& samplename,
83                                                                    void* memlocation,
84                                                                    int size);
85         void                            RemoveAllSamples();
86         bool                            CheckBuffer(SND_SoundObject* pObject);
87         bool                            IsSampleLoaded(STR_String& samplename);
88
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;
95
96         void                            SetListenerTransform(const MT_Vector3& pos,
97                                                                                          const MT_Vector3& vel,
98                                                                                          const MT_Matrix3x3& mat);
99
100         SND_SoundListener*      GetListener();
101 };
102
103 #endif //__SND_SCENE_H
104