From 23a6533c95d8ca80677113df68c678e23dda1311 Mon Sep 17 00:00:00 2001 From: Paul Gilbert Date: Sat, 14 Oct 2017 21:31:35 -0400 Subject: TITANIC: Properly flag audio buffer as finished when song is done --- engines/titanic/sound/audio_buffer.h | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) (limited to 'engines/titanic/sound/audio_buffer.h') diff --git a/engines/titanic/sound/audio_buffer.h b/engines/titanic/sound/audio_buffer.h index c775c5bb35..6d074a356d 100644 --- a/engines/titanic/sound/audio_buffer.h +++ b/engines/titanic/sound/audio_buffer.h @@ -44,7 +44,7 @@ private: * Leave a critical section */ void leaveCriticalSection(); -public: +private: bool _finished; public: CAudioBuffer(int maxSize); @@ -74,6 +74,11 @@ public: */ bool full() const { return _data.full(); } + /** + * Returns true if the audio buffering is finished + */ + bool isFinished() const { return _finished && empty(); } + /** * Adds a value to the buffer */ @@ -93,6 +98,11 @@ public: * Reads out a specified number of samples */ int read(int16 *values, int count); + + /** + * Marks the buffer as finishing, and that no more new data will arrive + */ + void finalize() { _finished = true; } }; } // End of namespace Titanic -- cgit v1.2.3