diff --git a/doc/changelog.dox b/doc/changelog.dox index 082ed61b0..15c723449 100644 --- a/doc/changelog.dox +++ b/doc/changelog.dox @@ -76,6 +76,12 @@ r>>) @subsection changelog-latest-changes Changes and improvements +@subsubsection changelog-latest-changes-audio Audio library + +- @ref Audio::Source::play(), @ref Audio::Source::pause(), + @ref Audio::Source::rewind() and @ref Audio::Source::stop() now return + a self-reference like all other methods for easier method chaining + @subsubsection changelog-latest-changes-gl GL library - New @ref GL::Context::State::BindScratchVao state to make external OpenGL diff --git a/src/Magnum/Audio/Source.h b/src/Magnum/Audio/Source.h index c4bae6dbe..72c0328f7 100644 --- a/src/Magnum/Audio/Source.h +++ b/src/Magnum/Audio/Source.h @@ -586,39 +586,55 @@ class MAGNUM_AUDIO_EXPORT Source { /** * @brief Play + * @return Reference to self (for method chaining) * * @see @ref play(std::initializer_list>), * @ref state(), @ref pause(), @ref stop(), @ref rewind(), * @fn_al_keyword{SourcePlay} */ - void play() { alSourcePlay(_id); } + Source& play() { + alSourcePlay(_id); + return *this; + } /** * @brief Pause + * @return Reference to self (for method chaining) * * @see @ref pause(std::initializer_list>), * @ref state(), @ref play(), @ref stop(), @ref rewind(), * @fn_al_keyword{SourcePause} */ - void pause() { alSourcePause(_id); } + Source& pause() { + alSourcePause(_id); + return *this; + } /** * @brief Stop + * @return Reference to self (for method chaining) * * @see @ref stop(std::initializer_list>), * @ref state(), @ref play(), @ref pause(), @ref rewind(), * @fn_al_keyword{SourceStop} */ - void stop() { alSourceStop(_id); } + Source& stop() { + alSourceStop(_id); + return *this; + } /** * @brief Rewind + * @return Reference to self (for method chaining) * * @see @ref rewind(std::initializer_list>), * @ref state(), @ref play(), @ref pause(), @ref stop(), * @fn_al_keyword{SourceRewind} */ - void rewind() { alSourceRewind(_id); } + Source& rewind() { + alSourceRewind(_id); + return *this; + } /** * @brief Whether the source is looping