aboutsummaryrefslogtreecommitdiff
path: root/engines/titanic/sound/audio_buffer.h
diff options
context:
space:
mode:
authorPaul Gilbert2017-02-05 22:57:56 -0500
committerPaul Gilbert2017-02-05 22:57:56 -0500
commit8f193017bd0fe32b6bf6a4c9a9ce58b2f809b0ac (patch)
tree1ebfa562d3ac3c96330667120d162ae50fa3f817 /engines/titanic/sound/audio_buffer.h
parent6bf2ddde13e9872359fa139e813a0ed94164c5ea (diff)
downloadscummvm-rg350-8f193017bd0fe32b6bf6a4c9a9ce58b2f809b0ac.tar.gz
scummvm-rg350-8f193017bd0fe32b6bf6a4c9a9ce58b2f809b0ac.tar.bz2
scummvm-rg350-8f193017bd0fe32b6bf6a4c9a9ce58b2f809b0ac.zip
TITANIC: Renamings and cleanups for music room handler & audio buffer
Diffstat (limited to 'engines/titanic/sound/audio_buffer.h')
-rw-r--r--engines/titanic/sound/audio_buffer.h36
1 files changed, 29 insertions, 7 deletions
diff --git a/engines/titanic/sound/audio_buffer.h b/engines/titanic/sound/audio_buffer.h
index b65f0bb8cc..5b6fb11072 100644
--- a/engines/titanic/sound/audio_buffer.h
+++ b/engines/titanic/sound/audio_buffer.h
@@ -31,10 +31,25 @@ namespace Titanic {
class CAudioBuffer {
private:
Common::Mutex _mutex;
+private:
+ /**
+ * Gets the beginning of stored audio data
+ */
+ byte *getBegin();
+
+ /**
+ * Gets the end of the stored audio data
+ */
+ byte *getEnd();
+
+ /**
+ * Reverses the audio buffer
+ */
+ void reverse();
public:
Common::Array<byte> _buffer;
int _fieldC;
- int _field10;
+ int _writeBytesLeft;
bool _flag;
int _field18;
public:
@@ -42,15 +57,22 @@ public:
~CAudioBuffer();
void reset();
- byte *getDataPtr1();
- byte *getDataPtr2();
+
byte *getPtr1();
- uint16 *getPtr2();
+ uint16 *getWritePtr();
int getC() const { return _fieldC; }
- int get10() const { return _field10; }
void setC(int val);
- void set10(int val);
- void update();
+
+ /**
+ * Returns how many bytes can be written before hitting the
+ * end of the audio buffer
+ */
+ int getWriteBytesLeft() const { return _writeBytesLeft; }
+
+ /**
+ * Advances the write pointer by the specified number of bytes
+ */
+ void advanceWrite(int size);
/**
* Enters a critical section