Describes all information needed for the playback of a music. More...
#include <OSDLMusicManager.h>
Public Member Functions | |
MusicPlaybackSetting (Music &music, PlaybackCount count=1) | |
Defines a new set of settings for the playback of specified music, whose ownership is not taken. | |
virtual | ~MusicPlaybackSetting () throw () |
Virtual destructor. | |
virtual void | setFadeInStatus (bool on) |
The playback will start with a fade-in iff true is specified. | |
virtual void | setFadeOutStatus (bool on) |
The playback will end with a fade-out iff true is specified. | |
virtual void | startPlayback () |
Starts immediately the play-back corresponding to these settings. | |
virtual void | stopPlayback () |
Stops immediately the play-back corresponding to these settings. | |
virtual bool | onPlaybackEnded () |
Called by the music manager whenever this playback is over. | |
virtual const std::string | toString (Ceylan::VerbosityLevels level=Ceylan::high) const |
Returns an user-friendly description of the state of this object. | |
Protected Attributes | |
Music * | _music |
The music to playback. | |
PlaybackCount | _count |
The number of remaining playbacks (can be Loop). | |
bool | _fadeIn |
Tells whether the playback should start with a fade-in. | |
bool | _fadeOut |
Tells whether the playback should end with a fade-out. | |
Private Member Functions | |
MusicPlaybackSetting (const MusicPlaybackSetting &source) | |
Copy constructor made private to ensure that it will be never called. | |
MusicPlaybackSetting & | operator= (const MusicPlaybackSetting &source) |
Assignment operator made private to ensure that it will be never called. |
Describes all information needed for the playback of a music.
Used by the music manager.
Definition at line 94 of file OSDLMusicManager.h.
MusicPlaybackSetting::MusicPlaybackSetting | ( | Music & | music, | |
PlaybackCount | count = 1 | |||
) | [explicit] |
Defines a new set of settings for the playback of specified music, whose ownership is not taken.
By default a playback will be done with no fade-in nor fade-out.
music | the music to playback. | |
count | the number of times this music should be played (-1 means infinite). |
Definition at line 115 of file OSDLMusicManager.cc.
References OSDL::Audio::Loop.
MusicPlaybackSetting::~MusicPlaybackSetting | ( | ) | throw () [virtual] |
Virtual destructor.
Definition at line 136 of file OSDLMusicManager.cc.
OSDL::Audio::MusicPlaybackSetting::MusicPlaybackSetting | ( | const MusicPlaybackSetting & | 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.
bool MusicPlaybackSetting::onPlaybackEnded | ( | ) | [virtual] |
Called by the music manager whenever this playback is over.
Definition at line 226 of file OSDLMusicManager.cc.
References toString().
Referenced by OSDL::Audio::MusicManager::onMusicPlaybackFinished().
MusicPlaybackSetting& OSDL::Audio::MusicPlaybackSetting::operator= | ( | const MusicPlaybackSetting & | 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.
void MusicPlaybackSetting::setFadeInStatus | ( | bool | on | ) | [virtual] |
The playback will start with a fade-in iff true is specified.
Definition at line 145 of file OSDLMusicManager.cc.
References _fadeIn.
Referenced by OSDL::Audio::MusicManager::enqueue().
void MusicPlaybackSetting::setFadeOutStatus | ( | bool | on | ) | [virtual] |
The playback will end with a fade-out iff true is specified.
Definition at line 154 of file OSDLMusicManager.cc.
References _fadeOut.
Referenced by OSDL::Audio::MusicManager::enqueue().
void MusicPlaybackSetting::startPlayback | ( | ) | [virtual] |
Starts immediately the play-back corresponding to these settings.
Does not return whether this playback should be kept, as anyway it should be removed once the playback is over, so that no music still being played back is removed if its reference counter drops to zero.
Definition at line 163 of file OSDLMusicManager.cc.
References _count, _fadeIn, _fadeOut, _music, OSDL::Audio::Music::play(), and OSDL::Audio::Music::playWithFadeIn().
Referenced by OSDL::Audio::MusicManager::startNextMusicPlayback().
void MusicPlaybackSetting::stopPlayback | ( | ) | [virtual] |
Stops immediately the play-back corresponding to these settings.
Definition at line 217 of file OSDLMusicManager.cc.
References _music, and OSDL::Audio::Music::stop().
Referenced by OSDL::Audio::MusicManager::stopCurrentMusicPlayback().
const string MusicPlaybackSetting::toString | ( | Ceylan::VerbosityLevels | level = Ceylan::high |
) | const [virtual] |
Returns an user-friendly description of the state of this object.
level | the requested verbosity level. |
Definition at line 261 of file OSDLMusicManager.cc.
References _count, _fadeIn, _fadeOut, _music, OSDL::Audio::Loop, and OSDL::Audio::Music::toString().
Referenced by onPlaybackEnded(), and OSDL::Audio::MusicManager::toString().
The number of remaining playbacks (can be Loop).
Definition at line 197 of file OSDLMusicManager.h.
Referenced by startPlayback(), and toString().
bool OSDL::Audio::MusicPlaybackSetting::_fadeIn [protected] |
Tells whether the playback should start with a fade-in.
Definition at line 201 of file OSDLMusicManager.h.
Referenced by setFadeInStatus(), startPlayback(), and toString().
bool OSDL::Audio::MusicPlaybackSetting::_fadeOut [protected] |
Tells whether the playback should end with a fade-out.
Definition at line 205 of file OSDLMusicManager.h.
Referenced by setFadeOutStatus(), startPlayback(), and toString().
Music* OSDL::Audio::MusicPlaybackSetting::_music [protected] |
The music to playback.
Definition at line 193 of file OSDLMusicManager.h.
Referenced by startPlayback(), stopPlayback(), and toString().