FIFE  be64c707dea6b3250bd4355bf5c825d25920087d
soundfilter.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_SOUNDFILTER_H
23 #define FIFE_SOUNDFILTER_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
35 #include "audio/fife_openal.h"
36 #include "audio/soundconfig.h"
37 
38 namespace FIFE {
39 
43  class SoundFilter {
44  public:
49 
52  ~SoundFilter();
53 
56  ALuint getFilterId() const;
57 
61  void setFilterType(SoundFilterType type);
62 
67 
71  void setEnabled(bool enabled);
72 
75  bool isEnabled() const;
76 
80  void setGain(float gain);
81 
84  float getGain() const;
85 
89  void setGainHf(float gain);
90 
93  float getGainHf() const;
94 
98  void setGainLf(float gain);
99 
102  float getGainLf() const;
103 
104  private:
106  ALuint m_filter;
110  bool m_enabled;
112  float m_gain;
114  float m_hGain;
116  float m_lGain;
117  };
118 }
119 #endif
SoundFilterType getFilterType() const
Return the filter type.
Definition: soundfilter.cpp:82
void setFilterType(SoundFilterType type)
Sets the filter type.
Definition: soundfilter.cpp:65
void setGain(float gain)
Sets filter gain.
Definition: soundfilter.cpp:94
The class defines filters.
Definition: soundfilter.h:43
ALuint getFilterId() const
Return the OpenAL filter handle.
Definition: soundfilter.cpp:61
SoundFilter(SoundFilterType type)
Constructor.
Definition: soundfilter.cpp:44
float getGainHf() const
Return filter high frequency gain.
bool isEnabled() const
Return true if the filter is enabled, false otherwise.
Definition: soundfilter.cpp:90
float getGainLf() const
Return filter low frequency gain.
ALuint m_filter
Filter object id.
Definition: soundfilter.h:106
void setGainLf(float gain)
Sets filter low frequency gain.
float m_lGain
Low frequency gain.
Definition: soundfilter.h:116
float getGain() const
Return filter gain.
void setGainHf(float gain)
Sets filter high frequency gain.
~SoundFilter()
Destructor.
Definition: soundfilter.cpp:57
SoundFilterType m_type
Filter type.
Definition: soundfilter.h:108
float m_hGain
High frequency gain.
Definition: soundfilter.h:114
float m_gain
Gain.
Definition: soundfilter.h:112
bool m_enabled
Filter enabled.
Definition: soundfilter.h:110
SoundFilterType
Sound filter type.
Definition: soundconfig.h:39
void setEnabled(bool enabled)
Enables or disables the filter.
Definition: soundfilter.cpp:86