hx3d  1
2D/3D Simple Game Framework
audio.hpp
1 /*
2  Audio management.
3  Copyright (C) 2015 Denis BOURGE
4 
5  This library is free software; you can redistribute it and/or
6  modify it under the terms of the GNU Lesser General Public
7  License as published by the Free Software Foundation; either
8  version 2.1 of the License, or (at your option) any later version.
9 
10  This library is distributed in the hope that it will be useful,
11  but WITHOUT ANY WARRANTY; without even the implied warranty of
12  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13  Lesser General Public License for more details.
14 
15  You should have received a copy of the GNU Lesser General Public
16  License along with this library; if not, write to the Free Software
17  Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301
18  USA
19 */
20 
21 #ifndef HX3D_AUDIO_AUDIO
22 #define HX3D_AUDIO_AUDIO
23 
24 #include "hx3d/utils/ptr.hpp"
25 
26 namespace hx3d {
27 
31 namespace audio {
32 
33 class Effect;
34 
40 class AudioDevice {
41 public:
42  AudioDevice();
43  ~AudioDevice();
44 
46 
55  void registerEffect(const int channel, Effect& effect);
56 
64  void clearEffects(const int channel);
65 
71  unsigned int getFrequencyRate();
72 
80  unsigned int getSampleSize();
81 
85  static int PostChannel;
86 
87 private:
89  int _audioRate;
91  int _audioChannels;
93  unsigned short _audioFormat;
95  int _bits;
97  int _sampleSize;
99  int _bufferSize;
100 };
101 
102 } /* audio */
103 } /* hx3d */
104 
105 #endif
Audio device management.
Definition: audio.hpp:40
static int PostChannel
Post Channel Identifier.
Definition: audio.hpp:85
void clearEffects(const int channel)
Clear all the effects for a channel.
Definition: audio.cpp:86
hx3d framework namespace
Definition: audio.hpp:26
Audio effect manipulation.
Definition: effect.hpp:32
unsigned int getFrequencyRate()
Get the audio device frequency rate.
Definition: audio.cpp:90
unsigned int getSampleSize()
Get the audio device sample size.
Definition: audio.cpp:94
void registerEffect(const int channel, Effect &effect)
Register an effect on a channel.
Definition: audio.cpp:73