Neo  0.5.0
Developer Documentation
OSound.h
Go to the documentation of this file.
1 //========================================================================
2 // Copyright (c) 2003-2011 Anael Seghezzi <www.maratis3d.com>
3 //
4 // This software is provided 'as-is', without any express or implied
5 // warranty. In no event will the authors be held liable for any damages
6 // arising from the use of this software.
7 //
8 // Permission is granted to anyone to use this software for any purpose,
9 // including commercial applications, and to alter it and redistribute it
10 // freely, subject to the following restrictions:
11 //
12 // 1. The origin of this software must not be misrepresented; you must not
13 // claim that you wrote the original software. If you use this software
14 // in a product, an acknowledgment in the product documentation would
15 // be appreciated but is not required.
16 //
17 // 2. Altered source versions must be plainly marked as such, and must not
18 // be misrepresented as being the original software.
19 //
20 // 3. This notice may not be removed or altered from any source
21 // distribution.
22 //
23 //========================================================================
24 
25 
26 #ifndef __OSOUND_SOURCE_H
27 #define __OSOUND_SOURCE_H
28 
29 namespace Neo
30 {
31 class NEO_ENGINE_EXPORT OSound : public Object3d
32 {
33 public:
34 
35  // constructor / destructor
36  OSound(SoundRef * soundRef);
37  virtual ~OSound(void);
38 
39  // copy constructor
40  OSound(const OSound & sound);
41 
42 private:
43 
44  // sound ref
45  SoundRef * m_soundRef;
46 
47  // source
48  unsigned int m_sourceId;
49 
50  // properties
51  bool m_isLooping;
52  bool m_isRelative;
53 
54  float m_pitch;
55  float m_gain;
56  float m_radius;
57  float m_rolloff;
58 
59 public:
60 
61  // type
62  int getType(void){ return OBJECT3D_SOUND; }
63 
64  // sound ref
65  void setSoundRef(SoundRef * soundRef);
66  inline SoundRef * getSoundRef(void){ return m_soundRef; }
67 
68  // source
69  inline unsigned int getSourceId(void){ return m_sourceId; }
70 
71  // properties
72  void setLooping(bool loop);
73  void setRelative(bool relative);
74  void setPitch(float pitch);
75  void setGain(float gain);
76  void setRadius(float radius);
77  void setRolloff(float rolloff);
78 
79  bool isPlaying(void);
80  inline bool isLooping(void){ return m_isLooping; }
81  inline bool isRelative(void){ return m_isRelative; }
82 
83  inline float getPitch(void){ return m_pitch; }
84  inline float getGain(void){ return m_gain; }
85  inline float getRadius(void){ return m_radius; }
86  inline float getRolloff(void){ return m_rolloff; }
87 
88  float getTimePos(void);
89  float getSoundDuration(void);
90 
91  // control
92  void play(void);
93  void pause(void);
94  void stop(void);
95 
96  // update
97  void update(void);
98 };
99 }
100 #endif
SoundRef * getSoundRef(void)
Definition: OSound.h:66
bool isRelative(void)
Definition: OSound.h:81
Definition: SoundRef.h:32
Definition: OSound.h:31
bool isLooping(void)
Definition: OSound.h:80
float getRolloff(void)
Definition: OSound.h:86
Definition: NeoEngine.h:49
The Object3d class represents a general object in a 3D scene.
Definition: Object3d.h:43
float getGain(void)
Definition: OSound.h:84
int getType(void)
Returns the type of the object.
Definition: OSound.h:62
Definition: Color.h:29
float getRadius(void)
Definition: OSound.h:85
float getPitch(void)
Definition: OSound.h:83
unsigned int getSourceId(void)
Definition: OSound.h:69