From 6109275750a3b9df41649a5787923e0578109f8b Mon Sep 17 00:00:00 2001 From: Johannes Schickel Date: Fri, 1 Jan 2010 22:55:38 +0000 Subject: Properly reset _numPlayedLoops in setNumLoops in all AudioStream implementations implementing setNumLoops. svn-id: r46861 --- sound/audiostream.cpp | 5 ++++- sound/flac.cpp | 5 ++++- sound/mp3.cpp | 5 ++++- sound/vorbis.cpp | 5 ++++- 4 files changed, 16 insertions(+), 4 deletions(-) diff --git a/sound/audiostream.cpp b/sound/audiostream.cpp index e8e90de4fa..e1847a4aac 100644 --- a/sound/audiostream.cpp +++ b/sound/audiostream.cpp @@ -224,7 +224,10 @@ class LinearDiskStream : public AudioStream { static const int32 BUFFER_SIZE = 16384; #endif - void setNumLoops(uint numLoops = 1) { _numLoops = numLoops; } + void setNumLoops(uint numLoops) { + _numLoops = numLoops; + _numPlayedLoops = 0; + } uint getNumPlayedLoops() { return _numPlayedLoops; } protected: diff --git a/sound/flac.cpp b/sound/flac.cpp index 09c7cce7c0..d06402e192 100644 --- a/sound/flac.cpp +++ b/sound/flac.cpp @@ -151,7 +151,10 @@ public: bool isStreamDecoderReady() const { return getStreamDecoderState() == FLAC__STREAM_DECODER_SEARCH_FOR_FRAME_SYNC ; } - void setNumLoops(uint numLoops = 1) { _numLoops = numLoops; } + void setNumLoops(uint numLoops = 1) { + _numLoops = numLoops; + _numPlayedLoops = 0; + } uint getNumPlayedLoops() { return _numPlayedLoops; } protected: diff --git a/sound/mp3.cpp b/sound/mp3.cpp index 6614dc944c..4ed68a3586 100644 --- a/sound/mp3.cpp +++ b/sound/mp3.cpp @@ -98,7 +98,10 @@ public: return _totalPlayTime * _numLoops; } - void setNumLoops(uint numLoops = 1) { _numLoops = numLoops; } + void setNumLoops(uint numLoops) { + _numLoops = numLoops; + _numPlayedLoops = 0; + } uint getNumPlayedLoops() { return _numPlayedLoops; } protected: diff --git a/sound/vorbis.cpp b/sound/vorbis.cpp index c80bc700fb..8e0cda06c9 100644 --- a/sound/vorbis.cpp +++ b/sound/vorbis.cpp @@ -121,7 +121,10 @@ public: bool isStereo() const { return _isStereo; } int getRate() const { return _rate; } - void setNumLoops(uint numLoops = 1) { _numLoops = numLoops; } + void setNumLoops(uint numLoops) { + _numLoops = numLoops; + _numPlayedLoops = 0; + } uint getNumPlayedLoops() { return _numPlayedLoops; } int32 getTotalPlayTime() const { -- cgit v1.2.3