aboutsummaryrefslogtreecommitdiff
path: root/queen
diff options
context:
space:
mode:
authorMax Horn2004-02-22 14:11:16 +0000
committerMax Horn2004-02-22 14:11:16 +0000
commitaa6ec62e9db78db12912d0e48025241c5d7ef4f7 (patch)
tree0afae2b795f07b9bd1c00dc75af3dca3864dac5f /queen
parent6db3a8819e7ef847f6aefac8e40f542cad006481 (diff)
downloadscummvm-rg350-aa6ec62e9db78db12912d0e48025241c5d7ef4f7.tar.gz
scummvm-rg350-aa6ec62e9db78db12912d0e48025241c5d7ef4f7.tar.bz2
scummvm-rg350-aa6ec62e9db78db12912d0e48025241c5d7ef4f7.zip
Patch #885904 (Flac Support) with some tweaks by me
svn-id: r12984
Diffstat (limited to 'queen')
-rw-r--r--queen/defs.h3
-rw-r--r--queen/sound.cpp15
-rw-r--r--queen/sound.h9
3 files changed, 26 insertions, 1 deletions
diff --git a/queen/defs.h b/queen/defs.h
index e64cd99e89..aed9ce9e09 100644
--- a/queen/defs.h
+++ b/queen/defs.h
@@ -29,7 +29,8 @@ namespace Queen {
enum {
COMPRESSION_NONE = 0,
COMPRESSION_MP3 = 1,
- COMPRESSION_OGG = 2
+ COMPRESSION_OGG = 2,
+ COMPRESSION_FLAC = 3
};
enum {
diff --git a/queen/sound.cpp b/queen/sound.cpp
index c403d32b1c..9b2d452b20 100644
--- a/queen/sound.cpp
+++ b/queen/sound.cpp
@@ -61,6 +61,14 @@ Sound *Sound::giveSound(SoundMixer *mixer, QueenEngine *vm, uint8 compression) {
return new OGGSound(mixer, vm);
#endif
break;
+ case COMPRESSION_FLAC:
+ #ifndef USE_FLAC
+ warning("Using FLAC compressed datafile, but FLAC support not compiled in");
+ return new SilentSound(mixer, vm);
+ #else
+ return new FLACSound(mixer, vm);
+ #endif
+ break;
default:
warning("Unknown compression type");
return new SilentSound(mixer, vm);
@@ -184,4 +192,11 @@ void OGGSound::sfxPlay(const char *name, bool isSpeech) {
}
#endif
+#ifdef USE_FLAC
+void FLACSound::sfxPlay(const char *name, bool isSpeech) {
+ if (_vm->resource()->fileExists(name))
+ _mixer->playFlac(isSpeech ? &_speechHandle : &_sfxHandle, _vm->resource()->giveCompressedSound(name), _vm->resource()->fileSize(name));
+}
+#endif
+
} //End of namespace Queen
diff --git a/queen/sound.h b/queen/sound.h
index 2bc0ec04c4..bbc48b0cea 100644
--- a/queen/sound.h
+++ b/queen/sound.h
@@ -133,6 +133,15 @@ public:
void sfxPlay(const char *name, bool isSpeech);
};
#endif
+
+#ifdef USE_FLAC
+class FLACSound : public Sound {
+public:
+ FLACSound(SoundMixer *mixer, QueenEngine *vm) : Sound(mixer, vm) {};
+ void sfxPlay(const char *name, bool isSpeech);
+};
+#endif // #ifdef USE_FLAC
+
} // End of namespace Queen
#endif