aboutsummaryrefslogtreecommitdiff
path: root/engines/tsage/sound.cpp
diff options
context:
space:
mode:
authorPaul Gilbert2011-04-27 22:22:20 +1000
committerPaul Gilbert2011-04-27 22:22:20 +1000
commit52ff20148eeb0455ed1548bf7bd7563a82dd016f (patch)
treec691f9cda3f444914912bdac835b2b41c397f8fb /engines/tsage/sound.cpp
parent34fe545dc7f619a40cffa207b8660ecb0c027c1f (diff)
downloadscummvm-rg350-52ff20148eeb0455ed1548bf7bd7563a82dd016f.tar.gz
scummvm-rg350-52ff20148eeb0455ed1548bf7bd7563a82dd016f.tar.bz2
scummvm-rg350-52ff20148eeb0455ed1548bf7bd7563a82dd016f.zip
TSAGE: Implemented the code for the ASound class
Diffstat (limited to 'engines/tsage/sound.cpp')
-rw-r--r--engines/tsage/sound.cpp156
1 files changed, 127 insertions, 29 deletions
diff --git a/engines/tsage/sound.cpp b/engines/tsage/sound.cpp
index cdb7470c58..793409d123 100644
--- a/engines/tsage/sound.cpp
+++ b/engines/tsage/sound.cpp
@@ -61,93 +61,191 @@ void SoundManager::listenerSynchronise(Serialiser &s) {
/*--------------------------------------------------------------------------*/
-void ASound::play(int soundNum, Action *action, int volume) {
-
+void Sound::play(int soundNum, int volume) {
+
}
-void ASound::stop() {
+void Sound::stop() {
}
-void ASound::prime(int v, Action *action) {
+void Sound::prime(int soundNum) {
}
-void ASound::unPrime() {
+void Sound::prime(int soundNum, int v2) {
+
+}
+
+void Sound::_unPrime() {
}
-void ASound::go() {
+void Sound::unPrime() {
}
-void ASound::hault(void) {
+void Sound::go() {
+
}
-int ASound::getSoundNum() const { return 0; }
-bool ASound::isPlaying() const { return false; }
-bool ASound::isPaused() const { return false; }
-bool ASound::isMuted() const { return false; }
+void Sound::halt(void) {
-void ASound::pause() {
+}
+int Sound::getSoundNum() const {
+ return 0;
}
-void ASound::mute() {
+bool Sound::isPlaying() const {
+ return false;
+}
+bool Sound::isPrimed() const {
+ return false;
}
-void ASound::fadeIn() {
+bool Sound::isPaused() const {
+ return false;
+}
+bool Sound::isMuted() const {
+ return false;
}
-void ASound::fadeOut(EventHandler *evtHandler) {
+void Sound::pause() {
}
-void ASound::fade(int v1, int v2, int v3, int v4, EventHandler *evtHandler) {
+void Sound::mute() {
}
-void ASound::setTimeIndex(uint32 timeIndex) {
+void Sound::fadeIn() {
}
-uint32 ASound::getTimeIndex() const {
- return 0;
+void Sound::fadeOut(EventHandler *evtHandler) {
+
}
-void ASound::setPri(int v) {
+void Sound::fade(int v1, int v2, int v3, int v4) {
}
-void ASound::setLoop(bool flag) {
+void Sound::setTimeIndex(uint32 timeIndex) {
}
-int ASound::getPri() const {
- return 0;
+uint32 Sound::getTimeIndex() const {
+ return 0;
+}
+
+bool Sound::getCueValue() const {
+ return false;
}
-bool ASound::getLoop() {
- return false;
+void Sound::setCueValue(bool flag) {
+
}
-void ASound::setVolume(int volume) {
+void Sound::setVol(int volume) {
}
-int ASound::getVol() const {
+int Sound::getVol() const {
return 0;
}
-void ASound::holdAt(int v) {
+void Sound::setPri(int v) {
+
+}
+
+void Sound::setLoop(bool flag) {
}
-void ASound::release() {
+int Sound::getPri() const {
+ return 0;
+}
+bool Sound::getLoop() {
+ return false;
}
+void Sound::holdAt(int v) {
+
+}
+
+void Sound::release() {
+
+}
+
+
+/*--------------------------------------------------------------------------*/
+
+ASound::ASound(): EventHandler() {
+ _action = NULL;
+ _cueFlag = false;
+}
+
+void ASound::synchronise(Serialiser &s) {
+ EventHandler::synchronise(s);
+ SYNC_POINTER(_action);
+ s.syncAsByte(_cueFlag);
+}
+
+void ASound::dispatch() {
+ EventHandler::dispatch();
+
+ if (!_sound.getCueValue()) {
+ _cueFlag = false;
+ _sound.setCueValue(true);
+
+ if (_action)
+ _action->signal();
+ }
+
+ if (!_cueFlag) {
+ if (!_sound.isPrimed()) {
+ _cueFlag = true;
+ if (_action) {
+ _action->signal();
+ _action = NULL;
+ }
+ }
+ }
+}
+
+void ASound::play(int soundNum, Action *action, int volume) {
+ _action = action;
+ _cueFlag = false;
+
+ setVol(volume);
+ _sound.play(soundNum);
+}
+
+void ASound::stop() {
+ _sound.stop();
+ _action = NULL;
+}
+
+void ASound::prime(int soundNum, Action *action) {
+ _action = action;
+ _cueFlag = false;
+ _sound.prime(soundNum);
+}
+
+void ASound::unPrime() {
+ _sound.unPrime();
+ _action = NULL;
+}
+
+void ASound::fade(int v1, int v2, int v3, int v4, Action *action) {
+ if (action)
+ _action = action;
+
+ _sound.fade(v1, v2, v3, v4);
+}
} // End of namespace tSage