FIFE
be64c707dea6b3250bd4355bf5c825d25920087d
|
The class defines filters. More...
#include <soundfilter.h>
Public Member Functions | |
SoundFilter (SoundFilterType type) | |
Constructor. More... | |
~SoundFilter () | |
Destructor. More... | |
ALuint | getFilterId () const |
Return the OpenAL filter handle. More... | |
void | setFilterType (SoundFilterType type) |
Sets the filter type. More... | |
SoundFilterType | getFilterType () const |
Return the filter type. More... | |
void | setEnabled (bool enabled) |
Enables or disables the filter. More... | |
bool | isEnabled () const |
Return true if the filter is enabled, false otherwise. More... | |
void | setGain (float gain) |
Sets filter gain. More... | |
float | getGain () const |
Return filter gain. More... | |
void | setGainHf (float gain) |
Sets filter high frequency gain. More... | |
float | getGainHf () const |
Return filter high frequency gain. More... | |
void | setGainLf (float gain) |
Sets filter low frequency gain. More... | |
float | getGainLf () const |
Return filter low frequency gain. More... | |
Private Attributes | |
ALuint | m_filter |
Filter object id. More... | |
SoundFilterType | m_type |
Filter type. More... | |
bool | m_enabled |
Filter enabled. More... | |
float | m_gain |
Gain. More... | |
float | m_hGain |
High frequency gain. More... | |
float | m_lGain |
Low frequency gain. More... | |
The class defines filters.
Lowpass, Highpass and Bandpass filters are possible. Note: On Lowpass filter setGainLf have no effect, same with Highpass and setGainHf.
Definition at line 43 of file soundfilter.h.
FIFE::SoundFilter::SoundFilter | ( | SoundFilterType | type | ) |
Constructor.
type | The filter type. |
Definition at line 44 of file soundfilter.cpp.
References FIFE::_log, FIFE::alGenFilters, CHECK_OPENAL_LOG, FIFE::LogManager::LEVEL_ERROR, m_filter, and setFilterType().
FIFE::SoundFilter::~SoundFilter | ( | ) |
Destructor.
Definition at line 57 of file soundfilter.cpp.
References FIFE::alDeleteFilters, and m_filter.
ALuint FIFE::SoundFilter::getFilterId | ( | ) | const |
Return the OpenAL filter handle.
Definition at line 61 of file soundfilter.cpp.
References m_filter.
Referenced by FIFE::SoundEffectManager::activateEffect(), FIFE::SoundEffectManager::activateFilter(), and FIFE::SoundEffectManager::enableSoundEffect().
SoundFilterType FIFE::SoundFilter::getFilterType | ( | ) | const |
Return the filter type.
Definition at line 82 of file soundfilter.cpp.
References m_type.
float FIFE::SoundFilter::getGain | ( | ) | const |
Return filter gain.
Default is 1.0.
Definition at line 108 of file soundfilter.cpp.
References m_gain.
float FIFE::SoundFilter::getGainHf | ( | ) | const |
Return filter high frequency gain.
Default is 1.0.
Definition at line 124 of file soundfilter.cpp.
References m_hGain.
float FIFE::SoundFilter::getGainLf | ( | ) | const |
Return filter low frequency gain.
Default is 1.0.
Definition at line 141 of file soundfilter.cpp.
References m_lGain.
bool FIFE::SoundFilter::isEnabled | ( | ) | const |
Return true if the filter is enabled, false otherwise.
Definition at line 90 of file soundfilter.cpp.
References m_enabled.
Referenced by FIFE::SoundEffectManager::activateFilter(), FIFE::SoundEffectManager::deactivateFilter(), FIFE::SoundEffectManager::disableDirectSoundFilter(), FIFE::SoundEffectManager::enableDirectSoundFilter(), and setFilterType().
void FIFE::SoundFilter::setEnabled | ( | bool | enabled | ) |
Enables or disables the filter.
enabled | A bool to indicate if the filter should be enabled or disabled. |
Definition at line 86 of file soundfilter.cpp.
References m_enabled.
Referenced by FIFE::SoundEffectManager::disableDirectSoundFilter(), and FIFE::SoundEffectManager::enableDirectSoundFilter().
void FIFE::SoundFilter::setFilterType | ( | SoundFilterType | type | ) |
Sets the filter type.
Definition at line 65 of file soundfilter.cpp.
References FIFE::_log, FIFE::alFilteri, CHECK_OPENAL_LOG, isEnabled(), FIFE::LogManager::LEVEL_ERROR, m_filter, m_type, FIFE::SF_FILTER_BANDPASS, FIFE::SF_FILTER_HIGHPASS, FIFE::SF_FILTER_LOWPASS, and FIFE::SF_FILTER_NULL.
Referenced by SoundFilter().
void FIFE::SoundFilter::setGain | ( | float | gain | ) |
Sets filter gain.
gain | The gain as float, range 0.0 - 1.0. |
Definition at line 94 of file soundfilter.cpp.
References FIFE::alFilterf, m_filter, m_gain, m_type, FIFE::SF_FILTER_BANDPASS, FIFE::SF_FILTER_HIGHPASS, and FIFE::SF_FILTER_LOWPASS.
void FIFE::SoundFilter::setGainHf | ( | float | gain | ) |
Sets filter high frequency gain.
gain | The gain as float, range 0.0 - 1.0. |
Definition at line 112 of file soundfilter.cpp.
References FIFE::alFilterf, m_filter, m_hGain, m_type, FIFE::SF_FILTER_BANDPASS, and FIFE::SF_FILTER_LOWPASS.
void FIFE::SoundFilter::setGainLf | ( | float | gain | ) |
Sets filter low frequency gain.
gain | The gain as float, range 0.0 - 1.0. |
Definition at line 128 of file soundfilter.cpp.
References FIFE::alFilterf, m_filter, m_lGain, m_type, FIFE::SF_FILTER_BANDPASS, and FIFE::SF_FILTER_HIGHPASS.
|
private |
Filter enabled.
Definition at line 110 of file soundfilter.h.
Referenced by isEnabled(), and setEnabled().
|
private |
Filter object id.
Definition at line 106 of file soundfilter.h.
Referenced by getFilterId(), setFilterType(), setGain(), setGainHf(), setGainLf(), SoundFilter(), and ~SoundFilter().
|
private |
|
private |
High frequency gain.
Definition at line 114 of file soundfilter.h.
Referenced by getGainHf(), and setGainHf().
|
private |
Low frequency gain.
Definition at line 116 of file soundfilter.h.
Referenced by getGainLf(), and setGainLf().
|
private |
Filter type.
Definition at line 108 of file soundfilter.h.
Referenced by getFilterType(), setFilterType(), setGain(), setGainHf(), and setGainLf().