RioEngine  0.1
My first attempt to create a 3D WYSIWYG Game Engine
ik_ISound.h
Go to the documentation of this file.
1 // Copyright (C) 2002-2014 Nikolaus Gebhardt
2 // This file is part of the "irrKlang" library.
3 // For conditions of distribution and use, see copyright notice in irrKlang.h
4 
5 #ifndef __I_IRRKLANG_SOUND_H_INCLUDED__
6 #define __I_IRRKLANG_SOUND_H_INCLUDED__
7 
10 #include "ik_vec3d.h"
11 
12 
13 namespace irrklang
14 {
15  class ISoundSource;
16  class ISoundStopEventReceiver;
17 
19 
24  class ISound : public IVirtualRefCounted
25  {
26  public:
27 
29 
31  virtual ISoundSource* getSoundSource() = 0;
32 
34  virtual void setIsPaused( bool paused = true) = 0;
35 
37  virtual bool getIsPaused() = 0;
38 
40 
43  virtual void stop() = 0;
44 
46 
48  virtual ik_f32 getVolume() = 0;
49 
51 
53  virtual void setVolume(ik_f32 volume) = 0;
54 
56  virtual void setPan(ik_f32 pan) = 0;
57 
59  virtual ik_f32 getPan() = 0;
60 
62  virtual bool isLooped() = 0;
63 
65 
70  virtual void setIsLooped(bool looped) = 0;
71 
73 
78  virtual bool isFinished() = 0;
79 
81 
89  virtual void setMinDistance(ik_f32 min) = 0;
90 
92 
93  virtual ik_f32 getMinDistance() = 0;
94 
96 
103  virtual void setMaxDistance(ik_f32 max) = 0;
104 
106 
107  virtual ik_f32 getMaxDistance() = 0;
108 
110  virtual void setPosition(vec3df position) = 0;
111 
113  virtual vec3df getPosition() = 0;
114 
116 
120  virtual void setVelocity(vec3df vel) = 0;
121 
123 
127  virtual vec3df getVelocity() = 0;
128 
130 
132  virtual ik_u32 getPlayPosition() = 0;
133 
135 
141  virtual bool setPlayPosition(ik_u32 pos) = 0;
142 
144 
155  virtual bool setPlaybackSpeed(ik_f32 speed = 1.0f) = 0;
156 
158 
159  virtual ik_f32 getPlaybackSpeed() = 0;
160 
162 
166  virtual ik_u32 getPlayLength() = 0;
167 
169 
178 
180 
188  virtual void setSoundStopEventReceiver(ISoundStopEventReceiver* reciever, void* userData=0) = 0;
189  };
190 
191 } // end namespace irrklang
192 
193 
194 #endif
virtual void setMaxDistance(ik_f32 max)=0
Sets the maximal distance if this is a 3D sound.
a 3d vector template class for representing vectors and points in 3d
Definition: ik_vec3d.h:17
virtual bool setPlaybackSpeed(ik_f32 speed=1.0f)=0
Sets the playback speed (frequency) of the sound.
virtual void setMinDistance(ik_f32 min)=0
Sets the minimal distance if this is a 3D sound.
Reference counting base class for objects in the Irrlicht Engine similar to IRefCounted.
Interface to be implemented by the user, which recieves sound stop events.
virtual ik_f32 getPlaybackSpeed()=0
Returns the playback speed set by setPlaybackSpeed(). Default: 1.0f.
unsigned int ik_u32
32 bit unsigned variable.
virtual ik_u32 getPlayLength()=0
returns the play length of the sound in milliseconds.
virtual void setIsPaused(bool paused=true)=0
returns if the sound is paused
virtual void setVolume(ik_f32 volume)=0
sets the volume of the sound, a value between 0 (mute) and 1 (full volume).
virtual ik_f32 getPan()=0
returns the pan of the sound. Takes a value between -1 and 1, 0 is center.
Represents a sound which is currently played.
Definition: ik_ISound.h:24
Everything in the irrKlang Sound Engine can be found in this namespace.
virtual void setVelocity(vec3df vel)=0
sets the position of the sound in 3d space, needed for Doppler effects.
A sound source describes an input file (.ogg, .mp3, .wav or similar) and its default settings...
virtual ISoundSource * getSoundSource()=0
returns source of the sound which stores the filename and other informations about that sound ...
virtual ik_f32 getMinDistance()=0
Returns the minimal distance if this is a 3D sound.
virtual bool setPlayPosition(ik_u32 pos)=0
sets the current play position of the sound in milliseconds.
virtual bool getIsPaused()=0
returns if the sound is paused
virtual void setPosition(vec3df position)=0
sets the position of the sound in 3d space
virtual vec3df getPosition()=0
returns the position of the sound in 3d space
float ik_f32
32 bit floating point variable.
virtual bool isLooped()=0
returns if the sound has been started to play looped
virtual ik_f32 getVolume()=0
returns volume of the sound, a value between 0 (mute) and 1 (full volume).
virtual vec3df getVelocity()=0
returns the velocity of the sound in 3d space, needed for Doppler effects.
virtual ISoundEffectControl * getSoundEffectControl()=0
Returns the sound effect control interface for this sound.
virtual ik_f32 getMaxDistance()=0
Returns the maximal distance if this is a 3D sound.
virtual void setIsLooped(bool looped)=0
changes the loop mode of the sound.
Interface to control the active sound effects (echo, reverb,...) of an ISound object, a playing sound.
virtual void setPan(ik_f32 pan)=0
sets the pan of the sound. Takes a value between -1 and 1, 0 is center.
virtual void setSoundStopEventReceiver(ISoundStopEventReceiver *reciever, void *userData=0)=0
Sets the sound stop event receiver, an interface which gets called if a sound has finished playing...
virtual void stop()=0
Will stop the sound and free its resources.
virtual bool isFinished()=0
returns if the sound has finished playing.
virtual ik_u32 getPlayPosition()=0
returns the current play position of the sound in milliseconds.