Planeshift
system.h
Go to the documentation of this file.
1 /*
2  * system.h
3  *
4  * Copyright (C) 2001-2010 Atomic Blue (info@planeshift.it, http://www.planeshift.it)
5  *
6  * Credits : Saul Leite <leite@engineer.com>
7  * Mathias 'AgY' Voeroes <agy@operswithoutlife.net>
8  * and all past and present planeshift coders
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 (version 2 of the License.
13  *
14  * This program is distributed in the hope that it will be useful,
15  * but WITHOUT ANY WARRANTY; without even the implied warranty of
16  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
17  * GNU General Public License for more details.
18  * You should have received a copy of the GNU General Public License
19  * along with this program; if not, write to the Free Software
20  * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
21  *
22  */
23 
24 #ifndef _SOUND_SYSTEM_H_
25 #define _SOUND_SYSTEM_H_
26 
27 #include <cssysdef.h>
28 #include <iutil/objreg.h>
29 #include <isndsys.h>
30 
38 {
39  public:
45  bool Initialize(iObjectRegistry* objectReg);
46 
54  bool CreateStream (csRef<iSndSysData> &snddata, int loop, int type,
55  csRef<iSndSysStream> &sndstream);
56 
61  void RemoveStream(csRef<iSndSysStream> &sndstream);
62 
68  bool CreateSource (csRef<iSndSysStream> &sndstream,
69  csRef<iSndSysSource> &sndsource);
70 
75  void RemoveSource (csRef<iSndSysSource> &sndsource);
76 
86  void Create3dSource (csRef<iSndSysSource> &sndsource,
87  csRef<iSndSysSource3D> &sndsource3d,
88  float mindist, float maxdist, csVector3 pos);
89 
97  void CreateDirectional3dSource (csRef<iSndSysSource3D> &sndsource3d,
98  csRef<iSndSysSource3DDirectionalSimple> &sndsourcedir,
99  csVector3 direction, float rad);
100 
107  void UpdateListener( csVector3 v, csVector3 f, csVector3 t );
108 
109  private:
110  csRef<iSndSysRenderer> sndrenderer;
111  csRef<iSndSysListener> listener;
112 };
113 
114 #endif /*_SOUND_SYSTEM_H_*/
void CreateDirectional3dSource(csRef< iSndSysSource3D > &sndsource3d, csRef< iSndSysSource3DDirectionalSimple > &sndsourcedir, csVector3 direction, float rad)
Creates a directional source on top of a 3d source.
void RemoveSource(csRef< iSndSysSource > &sndsource)
Removes a Source.
bool CreateSource(csRef< iSndSysStream > &sndstream, csRef< iSndSysSource > &sndsource)
Create a Source associated to your Stream.
bool Initialize(iObjectRegistry *objectReg)
initializes this object and tries to load the soundrenderer.
bool CreateStream(csRef< iSndSysData > &snddata, int loop, int type, csRef< iSndSysStream > &sndstream)
Creates a stream out of the given snddata.
void RemoveStream(csRef< iSndSysStream > &sndstream)
Removes a stream.
void Create3dSource(csRef< iSndSysSource > &sndsource, csRef< iSndSysSource3D > &sndsource3d, float mindist, float maxdist, csVector3 pos)
Creates a 3d Source on top of a 2d source.
void UpdateListener(csVector3 v, csVector3 f, csVector3 t)
Updates listener position.
This is an Interface Class to the Crystalspace Soundrenderer.
Definition: system.h:37