[Scummvm-cvs-logs] CVS: scummvm/queen defs.h,1.41,1.42 sound.cpp,1.36,1.37 sound.h,1.19,1.20

Max Horn fingolfin at users.sourceforge.net
Sun Feb 22 06:25:07 CET 2004


Update of /cvsroot/scummvm/scummvm/queen
In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv387/queen

Modified Files:
	defs.h sound.cpp sound.h 
Log Message:
Patch #885904 (Flac Support) with some tweaks by me

Index: defs.h
===================================================================
RCS file: /cvsroot/scummvm/scummvm/queen/defs.h,v
retrieving revision 1.41
retrieving revision 1.42
diff -u -d -r1.41 -r1.42
--- defs.h	8 Jan 2004 16:41:03 -0000	1.41
+++ defs.h	22 Feb 2004 14:11:13 -0000	1.42
@@ -29,7 +29,8 @@
 enum {
 	COMPRESSION_NONE  = 0,
 	COMPRESSION_MP3   = 1,	
-	COMPRESSION_OGG   = 2
+	COMPRESSION_OGG   = 2,
+	COMPRESSION_FLAC  = 3
 };
 
 enum {

Index: sound.cpp
===================================================================
RCS file: /cvsroot/scummvm/scummvm/queen/sound.cpp,v
retrieving revision 1.36
retrieving revision 1.37
diff -u -d -r1.36 -r1.37
--- sound.cpp	21 Feb 2004 20:50:56 -0000	1.36
+++ sound.cpp	22 Feb 2004 14:11:13 -0000	1.37
@@ -61,6 +61,14 @@
 					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 @@
 }
 #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

Index: sound.h
===================================================================
RCS file: /cvsroot/scummvm/scummvm/queen/sound.h,v
retrieving revision 1.19
retrieving revision 1.20
diff -u -d -r1.19 -r1.20
--- sound.h	26 Jan 2004 01:07:17 -0000	1.19
+++ sound.h	22 Feb 2004 14:11:13 -0000	1.20
@@ -133,6 +133,15 @@
 	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





More information about the Scummvm-git-logs mailing list