OSDL::Audio::MusicPlaybackSetting Class Reference

Describes all information needed for the playback of a music. More...

#include <OSDLMusicManager.h>

Collaboration diagram for OSDL::Audio::MusicPlaybackSetting:
Collaboration graph
[legend]

List of all members.

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.
MusicPlaybackSettingoperator= (const MusicPlaybackSetting &source)
 Assignment operator made private to ensure that it will be never called.

Detailed Description

Describes all information needed for the playback of a music.

Used by the music manager.

Definition at line 94 of file OSDLMusicManager.h.


Constructor & Destructor Documentation

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.

Parameters:
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.


Member Function Documentation

bool MusicPlaybackSetting::onPlaybackEnded (  )  [virtual]

Called by the music manager whenever this playback is over.

Returns:
true iff this playback must be kept by the music manager.

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.

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

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().


Member Data Documentation

The number of remaining playbacks (can be Loop).

Definition at line 197 of file OSDLMusicManager.h.

Referenced by startPlayback(), and toString().

Tells whether the playback should start with a fade-in.

Definition at line 201 of file OSDLMusicManager.h.

Referenced by setFadeInStatus(), startPlayback(), and toString().

Tells whether the playback should end with a fade-out.

Definition at line 205 of file OSDLMusicManager.h.

Referenced by setFadeOutStatus(), startPlayback(), and toString().

The music to playback.

Definition at line 193 of file OSDLMusicManager.h.

Referenced by startPlayback(), stopPlayback(), and toString().


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