aboutsummaryrefslogtreecommitdiff
path: root/sword2/driver/d_sound.h
diff options
context:
space:
mode:
authorMax Horn2003-12-19 00:27:09 +0000
committerMax Horn2003-12-19 00:27:09 +0000
commit97ee61963c896e48a0acc5b4169ce96163e76b06 (patch)
tree67fb29271c611eeb1e2dd90e6148a4efa98ce049 /sword2/driver/d_sound.h
parent32dd4cc0061de24c804bd7a9be9dfc6576dd19a1 (diff)
downloadscummvm-rg350-97ee61963c896e48a0acc5b4169ce96163e76b06.tar.gz
scummvm-rg350-97ee61963c896e48a0acc5b4169ce96163e76b06.tar.bz2
scummvm-rg350-97ee61963c896e48a0acc5b4169ce96163e76b06.zip
I am going to remove the default implementation of readBuffer() (AudioInputStream subclasses really really should implement readBuffer() for good performance)
svn-id: r11753
Diffstat (limited to 'sword2/driver/d_sound.h')
-rw-r--r--sword2/driver/d_sound.h8
1 files changed, 8 insertions, 0 deletions
diff --git a/sword2/driver/d_sound.h b/sword2/driver/d_sound.h
index 3a273b8744..b36e402002 100644
--- a/sword2/driver/d_sound.h
+++ b/sword2/driver/d_sound.h
@@ -59,6 +59,14 @@ public:
bool isStereo() const { return false; }
int getRate() const { return 22050; }
+ virtual int readBuffer(int16 *buffer, const int numSamples) {
+ int samples;
+ for (samples = 0; samples < numSamples && !eos(); samples++) {
+ *buffer++ = read();
+ }
+ return samples;
+ }
+
int16 read();
bool eos() const;