From 0a4d8d06bd9ba07731cb375b2f2acf6f8854902b Mon Sep 17 00:00:00 2001 From: kaetemi Date: Wed, 11 Apr 2012 15:44:02 +0200 Subject: [PATCH] Changed: Allow changing looping parameter of audio decoder after init --- code/nel/include/nel/sound/audio_decoder.h | 3 +++ code/nel/include/nel/sound/audio_decoder_vorbis.h | 3 +++ code/nel/src/sound/audio_decoder_vorbis.cpp | 5 +++++ 3 files changed, 11 insertions(+) diff --git a/code/nel/include/nel/sound/audio_decoder.h b/code/nel/include/nel/sound/audio_decoder.h index bded79cfe..3babc1de1 100644 --- a/code/nel/include/nel/sound/audio_decoder.h +++ b/code/nel/include/nel/sound/audio_decoder.h @@ -95,6 +95,9 @@ public: /// Get the total time in seconds. virtual float getLength() = 0; + + /// Set looping + virtual void setLooping(bool loop) = 0; }; /* class IAudioDecoder */ } /* namespace NLSOUND */ diff --git a/code/nel/include/nel/sound/audio_decoder_vorbis.h b/code/nel/include/nel/sound/audio_decoder_vorbis.h index c65c4de82..bd7e45019 100644 --- a/code/nel/include/nel/sound/audio_decoder_vorbis.h +++ b/code/nel/include/nel/sound/audio_decoder_vorbis.h @@ -99,6 +99,9 @@ public: /// Get the total time in seconds. virtual float getLength(); + + /// Set looping + virtual void setLooping(bool loop); }; /* class CAudioDecoderVorbis */ } /* namespace NLSOUND */ diff --git a/code/nel/src/sound/audio_decoder_vorbis.cpp b/code/nel/src/sound/audio_decoder_vorbis.cpp index 1f79b0ddc..c54ce0ade 100644 --- a/code/nel/src/sound/audio_decoder_vorbis.cpp +++ b/code/nel/src/sound/audio_decoder_vorbis.cpp @@ -219,6 +219,11 @@ float CAudioDecoderVorbis::getLength() return (float)ov_time_total(&_OggVorbisFile, -1); } +void CAudioDecoderVorbis::setLooping(bool loop) +{ + _Loop = loop; +} + } /* namespace NLSOUND */ /* end of file */