MezzanineEngine 
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
Public Member Functions | List of all members
Mezzanine::Audio::iSound Class Referenceabstract

This is an interface class for a non-spacialized sound. More...

#include <sound.h>

+ Inheritance diagram for Mezzanine::Audio::iSound:

Public Member Functions

 iSound ()
 Class constructor.
 
virtual ~iSound ()
 Class destructor.
 
virtual bool AttachEffect (const UInt32 Slot, iEffect *Eff)=0
 Attaches an iEffect to this sound. More...
 
virtual bool AttachFilter (iFilter *Fil)=0
 Attaches a filter to this sound that will operate on the direct feed, separate from any effects. More...
 
virtual Real GetBaseVolume () const =0
 Gets the current volume of the sound source. More...
 
virtual UInt32 GetCompressedSize () const
 Gets the size of the encoded audio source in use. More...
 
virtual UInt32 GetCurrentCompressedPosition () const
 Gets the sounds current position in the encoded audio source. More...
 
virtual UInt32 GetCurrentPosition () const
 Gets the sounds current position in the decoded audio source. More...
 
virtual Real GetCurrentTime () const
 Gets the current time position in the stream. More...
 
virtual iDecoderGetDecoder () const =0
 Gets the decoder that belongs to this sound. More...
 
virtual iEffectGetEffect (const UInt32 Slot) const =0
 Gets the iEffect attached at the specified slot. More...
 
virtual iFilterGetFilter () const =0
 Gets the filter currently being used by this object. More...
 
virtual UInt32 GetMaxEffectSlots () const =0
 Gets the max number of iEffect instances that can be attached to this sound. More...
 
virtual Real GetMaxVolume () const =0
 Gets the Maximum volume of the sound source. More...
 
virtual Real GetMinVolume () const =0
 Gets the minimum volume of the sound source. More...
 
virtual UInt32 GetNumEffectSlotsAvailable () const =0
 Gets the number of iEffect slots remaining that can be attached to. More...
 
virtual Real GetPitch () const =0
 Gets the pitch of the sound source. More...
 
virtual UInt32 GetTotalSize () const
 Gets the size of the decoded audio source in use. More...
 
virtual Real GetTotalTime () const
 Gets the length of the stream in seconds. More...
 
virtual UInt16 GetType () const =0
 Gets the sound type of this sound. More...
 
virtual Real GetVolume () const =0
 Gets the current volume of the sound source after all volume settings are applied. More...
 
virtual bool IsLooping () const =0
 Checks to see if the sound is currently set to loop. More...
 
virtual bool IsPaused () const =0
 Gets whether or not the sound is currently paused. More...
 
virtual bool IsPlaying () const =0
 Gets whether or not the sound is currently playing. More...
 
virtual bool IsStopped () const =0
 Gets whether or not the sound is currently stopped. More...
 
virtual bool IsValid () const =0
 Checks to see if this sound is valid and is ready for playback. More...
 
virtual void Loop (bool ToLoop)=0
 Sets whether the playback of the sound should loop or not. More...
 
virtual void Pause ()=0
 Pauses playback of the sound at it's current position in the stream.
 
virtual bool Play ()=0
 Plays the sound with it's current configuration. More...
 
virtual void RemoveEffect (const UInt32 Slot)=0
 Removes the iEffect in the specified slot. More...
 
virtual void RemoveFilter ()=0
 Removes any currently attached filters.
 
virtual bool Seek (const Real Seconds, bool Relative=false)=0
 Sets the current position of the stream from which to playback audio. More...
 
virtual void SetBaseVolume (const Real Base)=0
 Sets the current volume of the sound source before effects and other volume settings. More...
 
virtual void SetMaxVolume (const Real MaxVol)=0
 Sets the maximum volume the sound source can achieve. More...
 
virtual void SetMinVolume (const Real MinVol)=0
 Sets the minimum volume the sound source can achieve. More...
 
virtual void SetPitch (const Real Pitch)=0
 Sets the pitch of the sound source. More...
 
virtual void SetStream (Resource::DataStreamPtr Stream, const Audio::Encoding Encode)=0
 Sets a new stream for playback by this iSound. More...
 
virtual void SetStream (const UInt16 Type, Resource::DataStreamPtr Stream, const Audio::Encoding Encode)=0
 Sets a new stream for playback by this iSound. More...
 
virtual void SetStream (iDecoder *Decode)=0
 Sets a new stream for playback by this iSound via a new decoder. More...
 
virtual void SetStream (const UInt16 Type, iDecoder *Decode)=0
 Sets a new stream for playback by this iSound via a new decoder. More...
 
virtual void Stop ()=0
 Stops playback of the sound and resets it's position back to the start.
 

Detailed Description

This is an interface class for a non-spacialized sound.

The iSound class is intended for non-3D purposes only.

Definition at line 60 of file sound.h.

Member Function Documentation

virtual bool Mezzanine::Audio::iSound::AttachEffect ( const UInt32  Slot,
iEffect Eff 
)
pure virtual

Attaches an iEffect to this sound.

Remarks
Valid Slot Range: 0 to iSound::GetNumEffectSlotsAvailable()
Parameters
SlotThe slot into which the iEffect will be attached.
EffThe iEffect to be attached.
Returns
Returns true if the iEffect was successfully attached, false otherwise.
virtual bool Mezzanine::Audio::iSound::AttachFilter ( iFilter Fil)
pure virtual

Attaches a filter to this sound that will operate on the direct feed, separate from any effects.

Note
This will remove any previously attached filter. Only one filter can be attached at a given time.
Parameters
FilThe filter to be attached.
Returns
Returns true if the filter was successfully attached, false otherwise.
virtual Real Mezzanine::Audio::iSound::GetBaseVolume ( ) const
pure virtual

Gets the current volume of the sound source.

This function will get the current volume of the sound source before effects and other volume settings are applied.

Returns
Returns the source volume before attenuation and other effects.
virtual UInt32 Mezzanine::Audio::iSound::GetCompressedSize ( ) const
inlinevirtual

Gets the size of the encoded audio source in use.

Returns
Returns the size of the encoded audio source.

Definition at line 158 of file sound.h.

virtual UInt32 Mezzanine::Audio::iSound::GetCurrentCompressedPosition ( ) const
inlinevirtual

Gets the sounds current position in the encoded audio source.

Returns
Returns the current position in the encoded audio source in bytes.

Definition at line 166 of file sound.h.

virtual UInt32 Mezzanine::Audio::iSound::GetCurrentPosition ( ) const
inlinevirtual

Gets the sounds current position in the decoded audio source.

Returns
Returns the current position in the decoded audio source in bytes.

Definition at line 162 of file sound.h.

virtual Real Mezzanine::Audio::iSound::GetCurrentTime ( ) const
inlinevirtual

Gets the current time position in the stream.

Returns
Returns the current position in the stream in seconds.

Definition at line 150 of file sound.h.

virtual iDecoder* Mezzanine::Audio::iSound::GetDecoder ( ) const
pure virtual

Gets the decoder that belongs to this sound.

Returns
Returns a pointer to the decoder being used by this sound for playback.
virtual iEffect* Mezzanine::Audio::iSound::GetEffect ( const UInt32  Slot) const
pure virtual

Gets the iEffect attached at the specified slot.

Parameters
SlotThe slot to retrieve the iEffect from.
Returns
Returns a pointer to the iEffect attached at the specified slot, or NULL if none are attached.
virtual iFilter* Mezzanine::Audio::iSound::GetFilter ( ) const
pure virtual

Gets the filter currently being used by this object.

Returns
Returns a pointer to the currently attached filter, or NULL if there isn't one.
virtual UInt32 Mezzanine::Audio::iSound::GetMaxEffectSlots ( ) const
pure virtual

Gets the max number of iEffect instances that can be attached to this sound.

Returns
Returns the maximum number of iEffect instances this sound can support.
virtual Real Mezzanine::Audio::iSound::GetMaxVolume ( ) const
pure virtual

Gets the Maximum volume of the sound source.

Returns
Returns the maximum volume that the source can achieve.
virtual Real Mezzanine::Audio::iSound::GetMinVolume ( ) const
pure virtual

Gets the minimum volume of the sound source.

Returns
Returns the minimum volume that the source can be attenuated to.
virtual UInt32 Mezzanine::Audio::iSound::GetNumEffectSlotsAvailable ( ) const
pure virtual

Gets the number of iEffect slots remaining that can be attached to.

Returns
Returns the remaining number of iEffect instances this sound can support before it reaches it's max.
virtual Real Mezzanine::Audio::iSound::GetPitch ( ) const
pure virtual

Gets the pitch of the sound source.

Returns
Returns the pitch of the source.
virtual UInt32 Mezzanine::Audio::iSound::GetTotalSize ( ) const
inlinevirtual

Gets the size of the decoded audio source in use.

Returns
Returns the size of the decoded audio source.

Definition at line 154 of file sound.h.

virtual Real Mezzanine::Audio::iSound::GetTotalTime ( ) const
inlinevirtual

Gets the length of the stream in seconds.

Returns
Returns the total amount of time needed to playback the sound in seconds.

Definition at line 146 of file sound.h.

virtual UInt16 Mezzanine::Audio::iSound::GetType ( ) const
pure virtual

Gets the sound type of this sound.

Returns
Returns a SoundType enum value that is the type of this sound.
virtual Real Mezzanine::Audio::iSound::GetVolume ( ) const
pure virtual

Gets the current volume of the sound source after all volume settings are applied.

Note
The internal constructs for sound will be updated of any changes to the volume of this object when the _Update() method is called.
Returns
Returns a Real representing the volume of this sound after all volume settings are applied.
virtual bool Mezzanine::Audio::iSound::IsLooping ( ) const
pure virtual

Checks to see if the sound is currently set to loop.

Returns
Returns true if this sound will restart from the beginning when it finishes playing back.
virtual bool Mezzanine::Audio::iSound::IsPaused ( ) const
pure virtual

Gets whether or not the sound is currently paused.

Returns
Returns true if the sound is paused, false otherwise.
virtual bool Mezzanine::Audio::iSound::IsPlaying ( ) const
pure virtual

Gets whether or not the sound is currently playing.

Returns
Returns true if the sound is playing, false otherwise.
virtual bool Mezzanine::Audio::iSound::IsStopped ( ) const
pure virtual

Gets whether or not the sound is currently stopped.

Returns
Returns true if the sound is stopped, false otherwise.
virtual bool Mezzanine::Audio::iSound::IsValid ( ) const
pure virtual

Checks to see if this sound is valid and is ready for playback.

Returns
Returns true if this sound is ready for playback, false if it is misconfigured.
virtual void Mezzanine::Audio::iSound::Loop ( bool  ToLoop)
pure virtual

Sets whether the playback of the sound should loop or not.

Parameters
ToLoopWhether to restart the sound when the end of playback is reached.
virtual bool Mezzanine::Audio::iSound::Play ( )
pure virtual

Plays the sound with it's current configuration.

Note
This will restart playback in the event it is already playing.
Returns
Returns true if the sound succussfully started playing, false if there was an error.
virtual void Mezzanine::Audio::iSound::RemoveEffect ( const UInt32  Slot)
pure virtual

Removes the iEffect in the specified slot.

Remarks
Valid Slot Range: 0 to iSound::GetNumEffectSlotsAvailable()
Parameters
SlotThe slot to remove the occupying iEffect.
virtual bool Mezzanine::Audio::iSound::Seek ( const Real  Seconds,
bool  Relative = false 
)
pure virtual

Sets the current position of the stream from which to playback audio.

Note
May not be supported by all codecs.
Parameters
SecondsNumber of seconds to seek.
RelativeWhether to seek from the current position or the start of the stream.
Returns
Returns true on success, False if the codec does not support seeking.
virtual void Mezzanine::Audio::iSound::SetBaseVolume ( const Real  Base)
pure virtual

Sets the current volume of the sound source before effects and other volume settings.

This function will set the current volume of the sound source before effects (like attenuation) are applied.

Parameters
BaseThe volume of the sound source to be applied.
virtual void Mezzanine::Audio::iSound::SetMaxVolume ( const Real  MaxVol)
pure virtual

Sets the maximum volume the sound source can achieve.

This function will set the maximum volume the sound source can achieve after effects(like attenuation) have been applied.

Parameters
MaxVolThe maximum volume allowed for the sound source.
virtual void Mezzanine::Audio::iSound::SetMinVolume ( const Real  MinVol)
pure virtual

Sets the minimum volume the sound source can achieve.

This function will set the minimum volume the sound source can achieve after effects(like attenuation) have been applied.

Parameters
MinVolThe minimum volume allowed for the sound source.
virtual void Mezzanine::Audio::iSound::SetPitch ( const Real  Pitch)
pure virtual

Sets the pitch of the sound source.

Note
Higher values will speed up the playback of the sound. Default: 1.0
Parameters
PitchThe new pitch of the sound.
virtual void Mezzanine::Audio::iSound::SetStream ( Resource::DataStreamPtr  Stream,
const Audio::Encoding  Encode 
)
pure virtual

Sets a new stream for playback by this iSound.

Parameters
StreamThe stream to be decoded and played by this sound.
EncodeThe encoding to expect when decoding the stream provided.
virtual void Mezzanine::Audio::iSound::SetStream ( const UInt16  Type,
Resource::DataStreamPtr  Stream,
const Audio::Encoding  Encode 
)
pure virtual

Sets a new stream for playback by this iSound.

Parameters
TypeThe new type to set this iSound instance as.
StreamThe stream to be decoded and played by this sound.
EncodeThe encoding to expect when decoding the stream provided.
virtual void Mezzanine::Audio::iSound::SetStream ( iDecoder Decode)
pure virtual

Sets a new stream for playback by this iSound via a new decoder.

Warning
iSound instances take ownership of decoders. Decoders should not be shared between iSound instances.
Parameters
DecodeA pointer to the decoder containing the stream that will be used by this iSound.
virtual void Mezzanine::Audio::iSound::SetStream ( const UInt16  Type,
iDecoder Decode 
)
pure virtual

Sets a new stream for playback by this iSound via a new decoder.

Warning
iSound instances take ownership of decoders. Decoders should not be shared between iSound instances.
Parameters
TypeThe new type to set this iSound instance as.
DecodeA pointer to the decoder containing the stream that will be used by this iSound.

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