2010-02-09 05:18:39 +01:00
// Copyright (c) 2008-2010 Raynaldo (Wildicv) Rivera, Joshua (Dark_Kilauea) Jones
// This file is part of the "cAudio Engine"
// For conditions of distribution and use, see copyright notice in cAudio.h
2010-01-11 01:39:08 +01:00
# ifndef IFILTER_H
# define IFILTER_H
# include "IRefCounted.h"
2010-02-13 03:34:50 +01:00
# include "cAudioDefines.h"
# ifdef CAUDIO_EFX_ENABLED
2010-01-11 01:39:08 +01:00
namespace cAudio
{
2010-02-17 02:42:45 +01:00
//! Enum of all available filter types in cAudio.
2010-01-11 01:39:08 +01:00
enum FilterTypes
{
EFT_NULL ,
EFT_LOWPASS ,
EFT_HIGHPASS ,
EFT_BANDPASS ,
EFT_COUNT
} ;
2010-02-17 06:57:55 +01:00
//! Interface for a filter in cAudio.
2010-01-11 01:39:08 +01:00
class IFilter : public IRefCounted
{
public :
IFilter ( ) { }
virtual ~ IFilter ( ) { }
2010-02-17 06:57:55 +01:00
//! Returns the type of the filter.
2010-01-11 01:39:08 +01:00
virtual const FilterTypes & getType ( ) const = 0 ;
2010-02-17 06:57:55 +01:00
//! Sets the type of this filter.
/**
\ param type : Type of filter to set this filter up as . */
2010-01-11 01:39:08 +01:00
virtual void setType ( const FilterTypes & type ) = 0 ;
2010-02-17 06:57:55 +01:00
//! Returns the master volume of this filter.
2010-01-11 01:39:08 +01:00
virtual float getVolume ( ) const = 0 ;
2010-02-17 06:57:55 +01:00
//! Sets the master volume of this filter.
/** This volume scales all audio that goes through it by this amount.
\ param volume : New volume amount . Range : 0.0f to 1.0 . */
2010-01-11 01:39:08 +01:00
virtual void setVolume ( const float & volume ) = 0 ;
2010-02-17 06:57:55 +01:00
//! Returns the volume for low frequencies.
2010-01-11 01:39:08 +01:00
virtual float getLowFrequencyVolume ( ) const = 0 ;
2010-02-17 06:57:55 +01:00
//! Sets the volume for low frequencies.
/** This volume scales lower frequency audio that goes through it by this amount.
\ param volume : New volume amount . Range : 0.0f to 1.0 . */
2010-01-11 01:39:08 +01:00
virtual void setLowFrequencyVolume ( const float & volumeLF ) = 0 ;
2010-02-17 06:57:55 +01:00
//! Returns the volume for high frequencies.
2010-01-11 01:39:08 +01:00
virtual float getHighFrequencyVolume ( ) const = 0 ;
2010-02-17 06:57:55 +01:00
//! Sets the volume for high frequencies.
/** This volume scales higher frequency audio that goes through it by this amount.
\ param volume : New volume amount . Range : 0.0f to 1.0 . */
2010-01-11 01:39:08 +01:00
virtual void setHighFrequencyVolume ( const float & volumeHF ) = 0 ;
2010-02-17 06:57:55 +01:00
//! Returns a timestamp indicating the last time settings on this filter were changed. Used internally by the engine to update attached sources or effects.
2010-01-11 01:39:08 +01:00
virtual unsigned int getLastUpdated ( ) const = 0 ;
2010-02-17 06:57:55 +01:00
//! Returns if this filter is ready to be used or if it has encountered a fatal error.
2010-01-11 01:39:08 +01:00
virtual bool isValid ( ) const = 0 ;
} ;
} ;
2010-02-13 03:34:50 +01:00
# endif
2010-01-11 01:39:08 +01:00
# endif //! IFILTER_H