diff options
author | Jonathan Gray | 2002-10-27 01:12:10 +0000 |
---|---|---|
committer | Jonathan Gray | 2002-10-27 01:12:10 +0000 |
commit | d93e63908659a9601ee29269606500ded088175e (patch) | |
tree | 420f1bb6c9a364cf25317622984381d9ae94aeec /sound/mixer.h | |
parent | f89b40f0276601fb279dd2db03eed30c650df22a (diff) | |
download | scummvm-rg350-d93e63908659a9601ee29269606500ded088175e.tar.gz scummvm-rg350-d93e63908659a9601ee29269606500ded088175e.tar.bz2 scummvm-rg350-d93e63908659a9601ee29269606500ded088175e.zip |
patch #628997 support for ogg vorbis instead of cd tracks by Daniel Schepler. Uncomment the relevant lines in the makefile to use
svn-id: r5320
Diffstat (limited to 'sound/mixer.h')
-rw-r--r-- | sound/mixer.h | 29 |
1 files changed, 26 insertions, 3 deletions
diff --git a/sound/mixer.h b/sound/mixer.h index fd947502ca..1fecef27a2 100644 --- a/sound/mixer.h +++ b/sound/mixer.h @@ -25,10 +25,14 @@ #include <stdio.h> -#ifdef COMPRESSED_SOUND_FILE +#ifdef USE_MAD #include <mad.h> #endif +#ifdef USE_VORBIS +#include <vorbis/vorbisfile.h> +#endif + #include "common/scummsys.h" #include "common/system.h" @@ -92,7 +96,7 @@ private: void realDestroy(); }; -#ifdef COMPRESSED_SOUND_FILE +#ifdef USE_MAD class ChannelMP3 : public Channel { SoundMixer * _mixer; @@ -138,6 +142,22 @@ private: #endif +#ifdef USE_VORBIS + class ChannelVorbis : public Channel { + SoundMixer * _mixer; + OggVorbis_File * _ov_file; + double _end_pos; + bool _eof_flag; + + public: + ChannelVorbis(SoundMixer * mixer, OggVorbis_File * ov_file, double duration); + + void mix(int16 * data, uint len); + void realDestroy(); + bool soundFinished(); + }; +#endif + static void onGenerateSamples(void * s, byte * samples, int len); public: @@ -187,10 +207,13 @@ public: int playRaw(PlayingSoundHandle * handle, void * sound, uint32 size, uint rate, byte flags, int id); int playStream(PlayingSoundHandle * handle, int index, void * sound, uint32 size, uint rate, byte flags, int32 timeout = 3, int32 buffer_size = 2000000); -#ifdef COMPRESSED_SOUND_FILE +#ifdef USE_MAD int playMP3(PlayingSoundHandle * handle, void * sound, uint32 size, byte flags); int playMP3CDTrack(PlayingSoundHandle * handle, File * file, mad_timer_t duration); #endif +#ifdef USE_VORBIS + int playVorbisCDTrack(PlayingSoundHandle * handle, OggVorbis_File * ov_file, double duration); +#endif /* Premix procedure, useful when using fmopl adlib */ void setupPremix(void * param, PremixProc * proc); |