Mother class of all audible content, including sound and music. More...
#include <OSDLAudible.h>
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. | |
Audible & | operator= (const Audible &source) |
Assignment operator made private to ensure that it will be never called. |
Mother class of all audible content, including sound and music.
Definition at line 102 of file OSDLAudible.h.
Audible::Audible | ( | bool | convertedToOutputFormat = true |
) | [explicit] |
Creates a new audible instance.
convertedToOutputFormat | must be true iff the internal samples of this audible have been converted already to the sample format used for audio output. |
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.
string Audible::FindAudiblePath | ( | const std::string & | audibleFilename | ) | [static] |
Helper method to find the audible specified by its filename, using audio locators.
audibleFilename | the filename of the file where the audible is stored. |
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] |
Helper method to factorize conversion of play counts into a number of loops.
AudibleException | if the play count is out of bounds (must be either -1 for infinite looping or strictly superior to zero). |
Definition at line 186 of file OSDLAudible.cc.
References OSDL::Audio::Loop, and OSDL::Video::Pixels::toString().
Referenced by OSDL::Audio::Sound::play(), OSDL::Audio::Music::play(), OSDL::Audio::Sound::playForAtMost(), OSDL::Audio::Sound::playForAtMostReturnChannel(), OSDL::Audio::Sound::playReturnChannel(), OSDL::Audio::Sound::playWithFadeIn(), OSDL::Audio::Music::playWithFadeIn(), OSDL::Audio::Sound::playWithFadeInForAtMost(), OSDL::Audio::Sound::playWithFadeInForAtMostReturnChannel(), OSDL::Audio::Music::playWithFadeInFromPosition(), and OSDL::Audio::Sound::playWithFadeInReturnChannel().
virtual Volume OSDL::Audio::Audible::getVolume | ( | ) | const [pure virtual] |
Returns the volume associated to this audible instance.
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.
Definition at line 105 of file OSDLAudible.cc.
References _convertedToOutputFormat.
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).
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). |
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.
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). |
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.
newVolume | the new volume to be set. |
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.
level | the requested verbosity level. |
Reimplemented in OSDL::Audio::Music, and OSDL::Audio::Sound.
Definition at line 114 of file OSDLAudible.cc.
References _convertedToOutputFormat.
Referenced by FindAudiblePath().
bool OSDL::Audio::Audible::_convertedToOutputFormat [protected] |
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().