aboutsummaryrefslogtreecommitdiff
path: root/sound/softsynth
diff options
context:
space:
mode:
authorSven Hesse2007-12-13 23:27:36 +0000
committerSven Hesse2007-12-13 23:27:36 +0000
commit79e22d29f4500bf8d2310702cc5aa493944581e0 (patch)
tree33ef2bff027a5cedd2b3c9a8d52db3f8b9f9f5f6 /sound/softsynth
parent1e483cc8572000707fe7bdd00c94b55f2376b7b9 (diff)
downloadscummvm-rg350-79e22d29f4500bf8d2310702cc5aa493944581e0.tar.gz
scummvm-rg350-79e22d29f4500bf8d2310702cc5aa493944581e0.tar.bz2
scummvm-rg350-79e22d29f4500bf8d2310702cc5aa493944581e0.zip
Adding a method to check whether a note currently playing
svn-id: r29856
Diffstat (limited to 'sound/softsynth')
-rw-r--r--sound/softsynth/pcspk.cpp4
-rw-r--r--sound/softsynth/pcspk.h2
2 files changed, 6 insertions, 0 deletions
diff --git a/sound/softsynth/pcspk.cpp b/sound/softsynth/pcspk.cpp
index dea3eac549..396d9328f1 100644
--- a/sound/softsynth/pcspk.cpp
+++ b/sound/softsynth/pcspk.cpp
@@ -74,6 +74,10 @@ void PCSpeaker::setVolume(byte volume) {
_volume = volume;
}
+bool PCSpeaker::isPlaying() const {
+ return _remainingSamples != 0;
+}
+
int PCSpeaker::readBuffer(int16 *buffer, const int numSamples) {
Common::StackLock lock(_mutex);
diff --git a/sound/softsynth/pcspk.h b/sound/softsynth/pcspk.h
index 17eb6320e5..3cd8734a7e 100644
--- a/sound/softsynth/pcspk.h
+++ b/sound/softsynth/pcspk.h
@@ -53,6 +53,8 @@ public:
/** Adjust the volume. */
void setVolume(byte volume);
+ bool isPlaying() const;
+
int readBuffer(int16 *buffer, const int numSamples);
bool isStereo() const { return false; }