mirror of
https://github.com/SFML/SFML.git
synced 2025-01-18 23:35:11 +08:00
Added functionality to allow polymorphism with sf::SoundSource
This commit is contained in:
parent
61cdcd47ca
commit
e31b925234
@ -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
|
||||
////////////////////////////////////////////////////////////
|
||||
|
Loading…
Reference in New Issue
Block a user