aboutsummaryrefslogtreecommitdiff
path: root/audio/audiostream.cpp
diff options
context:
space:
mode:
authorPaul Gilbert2015-10-12 15:18:03 -0400
committerPaul Gilbert2015-10-12 15:18:03 -0400
commitb0016071ecf3f5ffbc6f1619af610ab648bbba3a (patch)
treef00f6b17bfd3475200e454cdfc09eba94d764f01 /audio/audiostream.cpp
parent652a6623156b6c6bba8ca49e038945fd0c2b7780 (diff)
parentfbcf667b6a57593a2b85622ad1e1380c8aef7210 (diff)
downloadscummvm-rg350-b0016071ecf3f5ffbc6f1619af610ab648bbba3a.tar.gz
scummvm-rg350-b0016071ecf3f5ffbc6f1619af610ab648bbba3a.tar.bz2
scummvm-rg350-b0016071ecf3f5ffbc6f1619af610ab648bbba3a.zip
Merge branch 'msvc_2015' into xeen
Diffstat (limited to 'audio/audiostream.cpp')
-rw-r--r--audio/audiostream.cpp21
1 files changed, 21 insertions, 0 deletions
diff --git a/audio/audiostream.cpp b/audio/audiostream.cpp
index c413edb73d..88c41e8503 100644
--- a/audio/audiostream.cpp
+++ b/audio/audiostream.cpp
@@ -33,6 +33,7 @@
#include "audio/decoders/quicktime.h"
#include "audio/decoders/raw.h"
#include "audio/decoders/vorbis.h"
+#include "audio/mixer.h"
namespace Audio {
@@ -465,4 +466,24 @@ AudioStream *makeLimitingAudioStream(AudioStream *parentStream, const Timestamp
return new LimitingAudioStream(parentStream, length, disposeAfterUse);
}
+/**
+ * An AudioStream that plays nothing and immediately returns that
+ * the endOfStream() has been reached
+ */
+class NullAudioStream : public AudioStream {
+public:
+ bool isStereo() const { return false; }
+ int getRate() const;
+ int readBuffer(int16 *data, const int numSamples) { return 0; }
+ bool endOfData() const { return true; }
+};
+
+int NullAudioStream::getRate() const {
+ return g_system->getMixer()->getOutputRate();
+}
+
+AudioStream *makeNullAudioStream() {
+ return new NullAudioStream();
+}
+
} // End of namespace Audio