OSDL::Audio::Audible Class Reference

Mother class of all audible content, including sound and music. More...

#include <OSDLAudible.h>

Inheritance diagram for OSDL::Audio::Audible:
Inheritance graph
[legend]

List of all members.

Public Member Functions

 Audible (bool convertedToOutputFormat=true)
 Creates a new audible instance.
virtual ~Audible () throw ()
 Virtual destructor.
virtual Volume getVolume () const =0
 Returns the volume associated to this audible instance.
virtual void setVolume (Volume newVolume)=0
 Sets the volume associated to this audible instance.
virtual void play (PlaybackCount playCount=1)=0
 Plays this audible instance at once on any appropriate output (ex: channel number).
virtual void playWithFadeIn (Ceylan::System::Millisecond fadeInMaxDuration, PlaybackCount playCount=1)=0
 Plays this audible instance at once on any appropriate output (ex: channel number), beginning with a fade-in effect.
virtual bool isConvertedToOutputFormat () const
 Tells whether the internal samples of this audible have already been converted to the sample format used for audio output.
virtual const std::string toString (Ceylan::VerbosityLevels level=Ceylan::high) const
 Returns an user-friendly description of the state of this object.

Static Public Member Functions

static std::string FindAudiblePath (const std::string &audibleFilename)
 Helper method to find the audible specified by its filename, using audio locators.

Static Protected Member Functions

static int GetLoopsForPlayCount (PlaybackCount playCount)
 Helper method to factorize conversion of play counts into a number of loops.

Protected Attributes

bool _convertedToOutputFormat
 Tells whether the internal samples have been converted already to the sample format used for audio output.

Private Member Functions

 Audible (const Audible &source)
 Copy constructor made private to ensure that it will be never called.
Audibleoperator= (const Audible &source)
 Assignment operator made private to ensure that it will be never called.

Detailed Description

Mother class of all audible content, including sound and music.

Definition at line 102 of file OSDLAudible.h.


Constructor & Destructor Documentation

Audible::Audible ( bool  convertedToOutputFormat = true  )  [explicit]

Creates a new audible instance.

Parameters:
convertedToOutputFormat must be true iff the internal samples of this audible have been converted already to the sample format used for audio output.
Exceptions:
AudibleException if the operation failed or is not supported.

Definition at line 90 of file OSDLAudible.cc.

Audible::~Audible (  )  throw () [virtual]

Virtual destructor.

Definition at line 98 of file OSDLAudible.cc.

OSDL::Audio::Audible::Audible ( const Audible source  )  [explicit, private]

Copy constructor made private to ensure that it will be never called.

The compiler should complain whenever this undefined constructor is called, implicitly or not.


Member Function Documentation

string Audible::FindAudiblePath ( const std::string &  audibleFilename  )  [static]

Helper method to find the audible specified by its filename, using audio locators.

Note:
Starts by searching the current directory, before using the locator paths.
Parameters:
audibleFilename the filename of the file where the audible is stored.
Exceptions:
AudibleException if the operation failed, including if the file could not be found despite audio path locator.

Definition at line 130 of file OSDLAudible.cc.

References OSDL::Audio::AudioModule::AudioFileLocator, OSDL::Audio::AudioModule::AudioPathEnvironmentVariable, and toString().

int Audible::GetLoopsForPlayCount ( PlaybackCount  playCount  )  [static, protected]
virtual Volume OSDL::Audio::Audible::getVolume (  )  const [pure virtual]

Returns the volume associated to this audible instance.

Exceptions:
AudibleException if the operation failed or is not supported.

Implemented in OSDL::Audio::Music, and OSDL::Audio::Sound.

bool Audible::isConvertedToOutputFormat (  )  const [virtual]

Tells whether the internal samples of this audible have already been converted to the sample format used for audio output.

Returns:
true iff the samples are already converted.

Definition at line 105 of file OSDLAudible.cc.

References _convertedToOutputFormat.

Audible& OSDL::Audio::Audible::operator= ( const Audible source  )  [private]

Assignment operator made private to ensure that it will be never called.

The compiler should complain whenever this undefined operator is called, implicitly or not.

virtual void OSDL::Audio::Audible::play ( PlaybackCount  playCount = 1  )  [pure virtual]

Plays this audible instance at once on any appropriate output (ex: channel number).

Parameters:
playCount the number of times this audible should be played, unless stopped by halt, fade out, expiration time or audio module stop. -1 means forever. Otherwise it must be strictly positive (exception thrown if zero or below -1 or below -1).
Exceptions:
AudibleException if the operation failed or is not supported.

Implemented in OSDL::Audio::Music, and OSDL::Audio::Sound.

virtual void OSDL::Audio::Audible::playWithFadeIn ( Ceylan::System::Millisecond  fadeInMaxDuration,
PlaybackCount  playCount = 1 
) [pure virtual]

Plays this audible instance at once on any appropriate output (ex: channel number), beginning with a fade-in effect.

Parameters:
fadeInMaxDuration duration in milliseconds during which the fade-in effect should take to go from silence to full volume.
playCount the number of times this audible should be played, unless stopped by halt, fade out, expiration time or audio module stop. -1 means forever. Otherwise it must be strictly positive (exception thrown if zero or below -1).
Exceptions:
AudibleException if the operation failed or is not supported.

Implemented in OSDL::Audio::Music, and OSDL::Audio::Sound.

virtual void OSDL::Audio::Audible::setVolume ( Volume  newVolume  )  [pure virtual]

Sets the volume associated to this audible instance.

Parameters:
newVolume the new volume to be set.
Exceptions:
AudibleException if the operation failed or is not supported.

Implemented in OSDL::Audio::Music, and OSDL::Audio::Sound.

const string Audible::toString ( Ceylan::VerbosityLevels  level = Ceylan::high  )  const [virtual]

Returns an user-friendly description of the state of this object.

Parameters:
level the requested verbosity level.
Note:
Text output format is determined from overall settings.
See also:
Ceylan::TextDisplayable

Reimplemented in OSDL::Audio::Music, and OSDL::Audio::Sound.

Definition at line 114 of file OSDLAudible.cc.

References _convertedToOutputFormat.

Referenced by FindAudiblePath().


Member Data Documentation

Tells whether the internal samples have been converted already to the sample format used for audio output.

Definition at line 257 of file OSDLAudible.h.

Referenced by isConvertedToOutputFormat(), OSDL::Audio::Sound::load(), OSDL::Audio::Music::load(), and toString().


The documentation for this class was generated from the following files:
Generated on Mon Nov 29 14:05:28 2010 for OSDL by  doxygen 1.6.3