Cafu Engine
Sound.hpp
1 /*
2 Cafu Engine, http://www.cafu.de/
3 Copyright (c) Carsten Fuchs and other contributors.
4 This project is licensed under the terms of the MIT license.
5 */
6 
7 #ifndef CAFU_SOUNDSYS_SOUND_HPP_INCLUDED
8 #define CAFU_SOUNDSYS_SOUND_HPP_INCLUDED
9 
10 #include "Math3D/Vector3.hpp"
11 
12 
13 /// This class represents a sound.
14 /// Sounds are created and destroyed via the appropriate methods in the sound system.
15 class SoundI
16 {
17  public:
18 
19  /// Plays the sound using the current sound system.
20  virtual bool Play()=0;
21 
22  /// Stops the sound.
23  virtual void Stop()=0;
24 
25  /// Pauses the sound.
26  virtual void Pause()=0;
27 
28  /// Resumes a previously paused sound.
29  virtual bool Resume()=0;
30 
31  /// Checks if the sound is currently playing.
32  virtual bool IsPlaying() const=0;
33 
34  /// Checks if the sound is for 3D playback.
35  virtual bool Is3D() const=0;
36 
37  /// Resets the sound properties to those of the shader it was created from.
38  virtual void ResetProperties()=0;
39 
40  /// Set the position from which the sound is emanating.
41  virtual void SetPosition(const Vector3dT& Position_)=0;
42 
43  /// Sets the velocity of the source that emits the sound.
44  virtual void SetVelocity(const Vector3dT& Velocity_)=0;
45 
46  /// Sets the direction into which the sound source is moving.
47  virtual void SetDirection(const Vector3dT& Direction_)=0;
48 
49  /// Sets the priority of this sound.
50  virtual void SetPriority(unsigned int Priority_)=0;
51 
52  /// Sets the volume.
53  virtual void SetInnerVolume(float InnerVolume_)=0;
54 
55  /// Sets the minimal distance.
56  virtual void SetMinDistance(float MinDist_)=0;
57 
58  /// Sets the maximal distance.
59  virtual void SetMaxDistance(float MaxDist_)=0;
60 
61  /// Sets the angle of the inner sound cone.
62  virtual void SetInnerConeAngle(float InnerConeAngle_)=0;
63 
64  /// Sets the angle of the outer sound cone.
65  virtual void SetOuterConeAngle(float OuterConeAngle_)=0;
66 
67  /// Sets the volume inside the outer sound cone.
68  virtual void SetOuterVolume(float OuterVolume_)=0;
69 
70  /// Gets the priority of this sound.
71  virtual unsigned int GetPriority() const=0;
72 
73  /// Gets the volume.
74  virtual float GetInnerVolume() const=0;
75 
76  /// Gets the minimal distance.
77  virtual float GetMinDistance() const=0;
78 
79  /// Gets the maximal distance.
80  virtual float GetMaxDistance() const=0;
81 
82  /// Gets the angle of the inner sound cone.
83  virtual float GetInnerConeAngle() const=0;
84 
85  /// Sets the angle of the outer sound cone.
86  virtual float GetOuterConeAngle() const=0;
87 
88  /// Gets the volume inside the outer sound cone.
89  virtual float GetOuterVolume() const=0;
90 
91  /// The virtual destructor makes sure that deleting derived classes via a SoundI pointer works properly.
92  virtual ~SoundI() { }
93 };
94 
95 #endif
virtual float GetOuterConeAngle() const =0
Sets the angle of the outer sound cone.
virtual void SetPosition(const Vector3dT &Position_)=0
Set the position from which the sound is emanating.
virtual void SetMaxDistance(float MaxDist_)=0
Sets the maximal distance.
virtual void SetMinDistance(float MinDist_)=0
Sets the minimal distance.
virtual float GetMinDistance() const =0
Gets the minimal distance.
virtual float GetOuterVolume() const =0
Gets the volume inside the outer sound cone.
virtual void Pause()=0
Pauses the sound.
virtual void SetOuterVolume(float OuterVolume_)=0
Sets the volume inside the outer sound cone.
virtual void Stop()=0
Stops the sound.
virtual bool Play()=0
Plays the sound using the current sound system.
virtual void SetOuterConeAngle(float OuterConeAngle_)=0
Sets the angle of the outer sound cone.
virtual bool Is3D() const =0
Checks if the sound is for 3D playback.
This class represents a sound.
Definition: Sound.hpp:15
virtual bool IsPlaying() const =0
Checks if the sound is currently playing.
virtual bool Resume()=0
Resumes a previously paused sound.
virtual unsigned int GetPriority() const =0
Gets the priority of this sound.
virtual ~SoundI()
The virtual destructor makes sure that deleting derived classes via a SoundI pointer works properly...
Definition: Sound.hpp:92
virtual float GetInnerConeAngle() const =0
Gets the angle of the inner sound cone.
virtual void SetInnerConeAngle(float InnerConeAngle_)=0
Sets the angle of the inner sound cone.
virtual void SetDirection(const Vector3dT &Direction_)=0
Sets the direction into which the sound source is moving.
virtual void SetInnerVolume(float InnerVolume_)=0
Sets the volume.
virtual float GetMaxDistance() const =0
Gets the maximal distance.
virtual void SetPriority(unsigned int Priority_)=0
Sets the priority of this sound.
virtual void ResetProperties()=0
Resets the sound properties to those of the shader it was created from.
virtual void SetVelocity(const Vector3dT &Velocity_)=0
Sets the velocity of the source that emits the sound.
virtual float GetInnerVolume() const =0
Gets the volume.