diff options
author | Lionel Ulmer | 2002-06-02 20:30:21 +0000 |
---|---|---|
committer | Lionel Ulmer | 2002-06-02 20:30:21 +0000 |
commit | 8b7207666e236988ebd568eeaa5386314f90cdb9 (patch) | |
tree | 8e861c514cc01fb411888582018a5699064e7995 /sound/mixer.h | |
parent | 4387c22d30298575b2c5a193d0b61a3080a9bd8c (diff) | |
download | scummvm-rg350-8b7207666e236988ebd568eeaa5386314f90cdb9.tar.gz scummvm-rg350-8b7207666e236988ebd568eeaa5386314f90cdb9.tar.bz2 scummvm-rg350-8b7207666e236988ebd568eeaa5386314f90cdb9.zip |
Fix the streaming used in the movies in TheDig (warning, did not test
Full Throttle).
This should be less buggy (ie crash less often, maybe not better
quality) than the previous code.
NOTE: the '1024 *' is here for testing purposes and will need to be
severely reduced :-/
svn-id: r4396
Diffstat (limited to 'sound/mixer.h')
-rw-r--r-- | sound/mixer.h | 26 |
1 files changed, 22 insertions, 4 deletions
diff --git a/sound/mixer.h b/sound/mixer.h index fc9d687f15..99b36903bb 100644 --- a/sound/mixer.h +++ b/sound/mixer.h @@ -36,7 +36,7 @@ private: virtual void mix(int16 *data, uint len) = 0; void destroy() { _to_be_destroyed = true; } virtual void real_destroy() = 0; - virtual void append(void *sound, uint32 size) = 0; + virtual void append(void *sound, uint32 size); #ifdef COMPRESSED_SOUND_FILE virtual bool sound_finished(); #endif @@ -54,12 +54,30 @@ private: public: - void append(void *sound, uint32 size); void mix(int16 *data, uint len); Channel_RAW(SoundMixer *mixer, void *sound, uint32 size, uint rate, byte flags); void real_destroy(); }; + class Channel_STREAM : public Channel { + SoundMixer *_mixer; + byte *_ptr; + byte *_end_of_data; + byte *_pos; + uint32 _fp_speed; + uint32 _fp_pos; + uint32 _buffer_size; + uint32 _rate; + byte _flags; + + + public: + void append(void *sound, uint32 size); + void mix(int16 *data, uint len); + Channel_STREAM(SoundMixer *mixer, void *sound, uint32 size, uint rate, byte flags); + void real_destroy(); + }; + #ifdef COMPRESSED_SOUND_FILE class Channel_MP3 : public Channel { @@ -75,7 +93,6 @@ private: byte _flags; public: - virtual void append(void *sound, uint32 size) {} // FIXME, FAKE void mix(int16 *data, uint len); Channel_MP3(SoundMixer *mixer, void *sound, uint size, byte flags); void real_destroy(); @@ -95,7 +112,6 @@ private: FILE *_file; bool _initialized; public: - virtual void append(void *sound, uint32 size) {} // FIXME, FAKE void mix(int16 *data, uint len); Channel_MP3_CDMUSIC(SoundMixer *mixer, FILE* file, mad_timer_t duration); void real_destroy(); @@ -126,6 +142,7 @@ public: PlayingSoundHandle *_handles[NUM_CHANNELS]; int insert(PlayingSoundHandle *handle, Channel *chan); + int insert_at(PlayingSoundHandle *handle, int index, Channel *chan); void append(void *data, uint32 len); void uninsert(Channel *chan); @@ -139,6 +156,7 @@ public: FLAG_FILE = 16, /* sound is a FILE * that's read from */ }; int play_raw(PlayingSoundHandle *handle, void *sound, uint32 size, uint rate, byte flags); + int play_stream(PlayingSoundHandle *handle, int index, void *sound, uint32 size, uint rate, byte flags); #ifdef COMPRESSED_SOUND_FILE int play_mp3(PlayingSoundHandle *handle, void *sound, uint32 size, byte flags); int play_mp3_cdtrack(PlayingSoundHandle *handle, FILE* file, mad_timer_t duration); |