FIFE  be64c707dea6b3250bd4355bf5c825d25920087d
actionaudio.h
Go to the documentation of this file.
1 /***************************************************************************
2  * Copyright (C) 2005-2019 by the FIFE team *
3  * http://www.fifengine.net *
4  * This file is part of FIFE. *
5  * *
6  * FIFE is free software; you can redistribute it and/or *
7  * modify it under the terms of the GNU Lesser General Public *
8  * License as published by the Free Software Foundation; either *
9  * version 2.1 of the License, or (at your option) any later version. *
10  * *
11  * This library is distributed in the hope that it will be useful, *
12  * but WITHOUT ANY WARRANTY; without even the implied warranty of *
13  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU *
14  * Lesser General Public License for more details. *
15  * *
16  * You should have received a copy of the GNU Lesser General Public *
17  * License along with this library; if not, write to the *
18  * Free Software Foundation, Inc., *
19  * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA *
20  ***************************************************************************/
21 
22 #ifndef FIFE_ACTIONAUDIO_H
23 #define FIFE_ACTIONAUDIO_H
24 
25 // Standard C++ library includes
26 
27 // Platform specific includes
28 
29 // 3rd party library includes
30 
31 // FIFE includes
32 // These includes are split up in two parts, separated by one empty line
33 // First block: files included from the FIFE root src directory
34 // Second block: files included from the same folder
36 
37 namespace FIFE {
38 
41  class ActionAudio {
42  public:
43 
44  ActionAudio();
45  ~ActionAudio();
46 
49  void setSoundFileName(const std::string& name);
50 
53  const std::string& getSoundFileName() const;
54 
57  void setGroupName(const std::string& name);
58 
61  const std::string& getGroupName() const;
62 
67  void setGain(float gain);
68 
73  float getGain() const;
74 
79  void setMaxGain(float gain);
80 
85  float getMaxGain() const;
86 
91  void setMinGain(float gain);
92 
97  float getMinGain() const;
98 
102  void setReferenceDistance(float distance);
103 
106  float getReferenceDistance() const;
107 
111  void setMaxDistance(float distance);
112 
115  float getMaxDistance() const;
116 
121  void setRolloff(float rolloff);
122 
125  float getRolloff() const;
126 
129  void setPitch(float pitch);
130 
133  float getPitch() const;
134 
137  void setConeInnerAngle(float inner);
138 
141  float getConeInnerAngle() const;
142 
145  void setConeOuterAngle(float outer);
146 
149  float getConeOuterAngle() const;
150 
153  void setConeOuterGain(float gain);
154 
157  float getConeOuterGain() const;
158 
161  void setVelocity(const AudioSpaceCoordinate& velocity);
162 
165  const AudioSpaceCoordinate& getVelocity() const;
166 
169  void setLooping(bool loop);
170 
173  bool isLooping() const;
174 
181  void setRelativePositioning(bool relative);
182 
185  bool isRelativePositioning() const;
186 
189  void setDirection(bool direction);
190 
193  bool isDirection() const;
194 
195  private:
196  std::string m_name;
197  std::string m_group;
198  float m_volume;
199  float m_maxVolume;
200  float m_minVolume;
203  float m_rolloff;
204  float m_pitch;
209  bool m_looping;
212 
213  };
214 }
215 
216 #endif
void setRolloff(float rolloff)
Sets the AL_ROLEOFF_FACTOR.
void setGroupName(const std::string &name)
Sets the name of the group to which the emitter is added.
Definition: actionaudio.cpp:72
void setDirection(bool direction)
Sets if the sound should use the instance direction.
float getGain() const
Returns the gain of the emitter.
Definition: actionaudio.cpp:84
float getConeInnerAngle() const
Return inner angle of the sound cone, in degrees.
void setMaxGain(float gain)
Sets the max.
Definition: actionaudio.cpp:88
const AudioSpaceCoordinate & getVelocity() const
Return the velocity of the SoundEmitter in the virtual audio space.
void setReferenceDistance(float distance)
Sets the distance under which the volume for the SoundEmitter would normally drop by half (before bei...
std::string m_name
Definition: actionaudio.h:196
void setRelativePositioning(bool relative)
Sets Positioning-Type Default is false.
void setPitch(float pitch)
Sets pitch multiplier.
float getPitch() const
Return pitch multiplier.
float getMaxDistance() const
Return the max distance.
bool isDirection() const
Return true if the Instance direction is used, false for undirected.
bool isLooping() const
Return playing mode.
void setConeOuterGain(float gain)
Sets the gain when outside the oriented cone.
void setMinGain(float gain)
Sets the min.
Definition: actionaudio.cpp:96
void setGain(float gain)
Sets the gain of the emitter.
Definition: actionaudio.cpp:80
The class for holding audio data per Action.
Definition: actionaudio.h:41
void setSoundFileName(const std::string &name)
Sets the name of the sound file.
Definition: actionaudio.cpp:64
void setVelocity(const AudioSpaceCoordinate &velocity)
Sets the velocity of the SoundEmitter in the virtual audio space.
std::iterator_traits< octet_iterator >::difference_type distance(octet_iterator first, octet_iterator last)
Definition: checked.h:198
float getRolloff() const
Return the AL_ROLEOFF_FACTOR.
std::string m_group
Definition: actionaudio.h:197
float getMinGain() const
Returns the min.
void setConeInnerAngle(float inner)
Sets inner angle of the sound cone, in degrees.
void setMaxDistance(float distance)
Sets the max distance used with the Inverse Clamped Distance Model to set the distance where there wi...
void setConeOuterAngle(float outer)
Sets outer angle of the sound cone, in degrees.
float getMaxGain() const
Returns the max.
Definition: actionaudio.cpp:92
bool isRelativePositioning() const
Return Positioning-Type.
const std::string & getGroupName() const
Return the name of the group to which the emitter is added.
Definition: actionaudio.cpp:76
float getConeOuterAngle() const
Return outer angle of the sound cone, in degrees.
float getConeOuterGain() const
Return the gain when outside the oriented cone.
float getReferenceDistance() const
Return the reference distance.
const std::string & getSoundFileName() const
Return the name of the sound file.
Definition: actionaudio.cpp:68
AudioSpaceCoordinate m_velocity
Definition: actionaudio.h:208
void setLooping(bool loop)
Sets the playing mode.