From 93a2e9502dfcf5b69a3e53b5eaf2905ca9b17d7c Mon Sep 17 00:00:00 2001 From: Cobaltergeist Date: Wed, 16 Nov 2016 23:17:42 -0800 Subject: [PATCH] Added Loop Point support to sf::Music --- include/SFML/Audio/Music.hpp | 115 ++++++++++++++++++++++- include/SFML/Audio/SoundStream.hpp | 39 +++++--- src/SFML/Audio/Music.cpp | 141 +++++++++++++++++++++++++++-- src/SFML/Audio/SoundStream.cpp | 48 ++++++---- 4 files changed, 302 insertions(+), 41 deletions(-) diff --git a/include/SFML/Audio/Music.hpp b/include/SFML/Audio/Music.hpp index 5e272655..0e22aba1 100644 --- a/include/SFML/Audio/Music.hpp +++ b/include/SFML/Audio/Music.hpp @@ -49,6 +49,43 @@ class SFML_AUDIO_API Music : public SoundStream { public: + //////////////////////////////////////////////////////////// + /// \brief Structure defining a time range using the template type + /// + //////////////////////////////////////////////////////////// + template + struct Span + { + //////////////////////////////////////////////////////////// + /// \brief Default constructor + /// + //////////////////////////////////////////////////////////// + Span() + { + + } + + //////////////////////////////////////////////////////////// + /// \brief Initialization constructor + /// + /// \param off Initial Offset + /// \param len Initial Length + /// + //////////////////////////////////////////////////////////// + Span(T off, T len): + offset(off), + length(len) + { + + } + + T offset; ///< The beginning offset of the time range + T length; ///< The length of the time range + }; + + // Define the relevant Span types + typedef Span