diff options
Diffstat (limited to 'engines/titanic/sound/audio_buffer.h')
-rw-r--r-- | engines/titanic/sound/audio_buffer.h | 23 |
1 files changed, 8 insertions, 15 deletions
diff --git a/engines/titanic/sound/audio_buffer.h b/engines/titanic/sound/audio_buffer.h index 8d27667e93..1f157b9346 100644 --- a/engines/titanic/sound/audio_buffer.h +++ b/engines/titanic/sound/audio_buffer.h @@ -23,7 +23,7 @@ #ifndef TITANIC_AUDIO_BUFFER_H #define TITANIC_AUDIO_BUFFER_H -#include "common/array.h" +#include "titanic/support/fixed_queue.h" #include "common/mutex.h" namespace Titanic { @@ -31,14 +31,7 @@ namespace Titanic { class CAudioBuffer { private: Common::Mutex _mutex; - Common::Array<int16> _data; - int16 *_frontP, *_backP; - - /** - * Reclaims any space at the start of the array resulting from - * having read values off the font - */ - void compact(); + FixedQueue<int16, 88200> _data; public: bool _finished; public: @@ -57,17 +50,17 @@ public: /** * Returns the number of 16-bit entries in the buffer */ - int size() const { return _backP - _frontP; } + int size() const { return _data.size(); } /** - * Returns true if the buffer is full + * Returns the number of entries free in the buffer */ - bool full() const { return (_backP - _frontP) == (int)_data.size(); } + int freeSize() const { return _data.freeSize(); } /** - * Returns the number of entries free in the buffer + * Returns true if the buffer is full */ - int freeSize(); + bool full() const { return _data.full(); } /** * Adds a value to the buffer @@ -77,7 +70,7 @@ public: /** * Adds a value to the buffer */ - void push(int16 *values, int count); + void push(const int16 *values, int count); /** * Removes a value from the buffer |