FIFE  6e1afdbeda11afe9ac53e6023a4be96ef88f1dc6
FIFE::SoundFilter Class Reference

The class defines filters. More...

#include <soundfilter.h>

+ Collaboration diagram for FIFE::SoundFilter:

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...
 

Detailed Description

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.

Constructor & Destructor Documentation

FIFE::SoundFilter::SoundFilter ( SoundFilterType  type)

Constructor.

Parameters
typeThe 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.

Member Function Documentation

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().

+ Here is the caller graph for this function:

SoundFilterType FIFE::SoundFilter::getFilterType ( ) const

Return the filter type.

See also
SoundFilterType

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().

+ Here is the caller graph for this function:

void FIFE::SoundFilter::setEnabled ( bool  enabled)

Enables or disables the filter.

Parameters
enabledA 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().

+ Here is the caller graph for this function:

void FIFE::SoundFilter::setFilterType ( SoundFilterType  type)

Sets the filter type.

See also
SoundFilterType

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().

+ Here is the caller graph for this function:

void FIFE::SoundFilter::setGain ( float  gain)

Sets filter gain.

Parameters
gainThe 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.

Parameters
gainThe 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.

Parameters
gainThe 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.

Member Data Documentation

bool FIFE::SoundFilter::m_enabled
private

Filter enabled.

Definition at line 110 of file soundfilter.h.

Referenced by isEnabled(), and setEnabled().

ALuint FIFE::SoundFilter::m_filter
private

Filter object id.

Definition at line 106 of file soundfilter.h.

Referenced by getFilterId(), setFilterType(), setGain(), setGainHf(), setGainLf(), SoundFilter(), and ~SoundFilter().

float FIFE::SoundFilter::m_gain
private

Gain.

Definition at line 112 of file soundfilter.h.

Referenced by getGain(), and setGain().

float FIFE::SoundFilter::m_hGain
private

High frequency gain.

Definition at line 114 of file soundfilter.h.

Referenced by getGainHf(), and setGainHf().

float FIFE::SoundFilter::m_lGain
private

Low frequency gain.

Definition at line 116 of file soundfilter.h.

Referenced by getGainLf(), and setGainLf().

SoundFilterType FIFE::SoundFilter::m_type
private

Filter type.

Definition at line 108 of file soundfilter.h.

Referenced by getFilterType(), setFilterType(), setGain(), setGainHf(), and setGainLf().


The documentation for this class was generated from the following files: