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 /scumm/sound.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 'scumm/sound.h')
-rw-r--r-- | scumm/sound.h | 58 |
1 files changed, 48 insertions, 10 deletions
diff --git a/scumm/sound.h b/scumm/sound.h index 2f4ddec5c8..635fda5531 100644 --- a/scumm/sound.h +++ b/scumm/sound.h @@ -65,24 +65,62 @@ enum { uint16 _mouthSyncTimes[52]; uint _curSoundPos; +#ifdef COMPRESSED_SOUND_FILE MP3OffsetTable *offset_table; // SO3 MP3 compressed audio int num_sound_effects; // SO3 MP3 compressed audio -#ifdef COMPRESSED_SOUND_FILE #define CACHE_TRACKS 10 /* used for mp3 CD music */ int _cached_tracks[CACHE_TRACKS]; - struct mad_header _mad_header[CACHE_TRACKS]; - long _mp3_size[CACHE_TRACKS]; - File *_mp3_tracks[CACHE_TRACKS]; - int _mp3_index; - int _mp3_cd_track; - int _mp3_cd_start; - int _mp3_cd_delay; - int _mp3_cd_num_loops; - bool _mp3_cd_playing; + int _dig_cd_index; + int _dig_cd_track; + int _dig_cd_start; + int _dig_cd_delay; + int _dig_cd_num_loops; + bool _dig_cd_playing; + + class DigitalTrackInfo { + public: + virtual bool error() = 0; + virtual int play(SoundMixer *mixer, int start, int delay) = 0; + virtual ~DigitalTrackInfo() { } + }; + + DigitalTrackInfo *_track_info[CACHE_TRACKS]; + +#ifdef USE_MAD + class MP3TrackInfo : public DigitalTrackInfo { + private: + struct mad_header _mad_header; + long _size; + File *_file; + bool _error_flag; + + public: + MP3TrackInfo(File *file); + ~MP3TrackInfo(); + bool error() { return _error_flag; } + int play(SoundMixer *mixer, int start, int delay); + }; +#endif + +#ifdef USE_VORBIS + class VorbisTrackInfo : public DigitalTrackInfo { + private: + File *_file; + OggVorbis_File _ov_file; + bool _error_flag; + + public: + VorbisTrackInfo(File *file); + ~VorbisTrackInfo(); + bool error() { return _error_flag; } + int play(SoundMixer *mixer, int start, int delay); + }; +#endif + #endif Scumm * _scumm; |