Added functionality to allow polymorphism with sf::SoundSource

This commit is contained in:
jonathan.r.paton@googlemail.com 2017-01-23 16:13:13 +00:00 committed by Lukas Dürrenberger
parent 61cdcd47ca
commit e31b925234

View File

@ -250,6 +250,49 @@ public:
////////////////////////////////////////////////////////////
SoundSource& operator =(const SoundSource& right);
////////////////////////////////////////////////////////////
/// \brief Start or resume playing the sound source
///
/// This function starts the source if it was stopped, resumes
/// it if it was paused, and restarts it from the beginning if
/// it was already playing.
///
/// \see pause, stop
///
////////////////////////////////////////////////////////////
virtual void play() = 0;
////////////////////////////////////////////////////////////
/// \brief Pause the sound source
///
/// This function pauses the source if it was playing,
/// otherwise (source already paused or stopped) it has no effect.
///
/// \see play, stop
///
////////////////////////////////////////////////////////////
virtual void pause() = 0;
////////////////////////////////////////////////////////////
/// \brief Stop playing the sound source
///
/// This function stops the source if it was playing or paused,
/// and does nothing if it was already stopped.
/// It also resets the playing position (unlike pause()).
///
/// \see play, pause
///
////////////////////////////////////////////////////////////
virtual void stop() = 0;
////////////////////////////////////////////////////////////
/// \brief Get the current status of the sound (stopped, paused, playing)
///
/// \return Current status of the sound
///
////////////////////////////////////////////////////////////
virtual Status getStatus() const;
protected:
////////////////////////////////////////////////////////////
@ -260,14 +303,6 @@ protected:
////////////////////////////////////////////////////////////
SoundSource();
////////////////////////////////////////////////////////////
/// \brief Get the current status of the sound (stopped, paused, playing)
///
/// \return Current status of the sound
///
////////////////////////////////////////////////////////////
Status getStatus() const;
////////////////////////////////////////////////////////////
// Member data
////////////////////////////////////////////////////////////