aboutsummaryrefslogtreecommitdiff
path: root/sound/mixer.h
diff options
context:
space:
mode:
authorNicolas Bacca2002-04-17 20:23:45 +0000
committerNicolas Bacca2002-04-17 20:23:45 +0000
commitbb06400d007d0056434fe4a0076e8dacfcd26aec (patch)
treee44c70f1736da47d2f2ff6b39788f1b7b06f2603 /sound/mixer.h
parentfd6a44e7c52548f0374752071841f696ca5ae0d9 (diff)
downloadscummvm-rg350-bb06400d007d0056434fe4a0076e8dacfcd26aec.tar.gz
scummvm-rg350-bb06400d007d0056434fe4a0076e8dacfcd26aec.tar.bz2
scummvm-rg350-bb06400d007d0056434fe4a0076e8dacfcd26aec.zip
Return of the MP3 CD patch ... use CBR 22 kHz
svn-id: r3981
Diffstat (limited to 'sound/mixer.h')
-rw-r--r--sound/mixer.h23
1 files changed, 22 insertions, 1 deletions
diff --git a/sound/mixer.h b/sound/mixer.h
index 26d19881ca..e455e03d0e 100644
--- a/sound/mixer.h
+++ b/sound/mixer.h
@@ -53,6 +53,26 @@ private:
Channel_MP3(SoundMixer *mixer, void *sound, uint size, byte flags);
};
+ class Channel_MP3_CDMUSIC : public Channel {
+ SoundMixer *_mixer;
+ void *_ptr;
+ struct mad_stream _stream;
+ struct mad_frame _frame;
+ struct mad_synth _synth;
+ uint32 _pos_in_frame;
+ uint32 _size;
+ uint32 _buffer_size;
+ mad_timer_t _duration;
+ FILE *_file;
+ bool _initialized;
+ byte _flags;
+ public:
+ void mix(int16 *data, uint len);
+ void destroy();
+
+ Channel_MP3_CDMUSIC(SoundMixer *mixer, FILE* file, void *buffer, uint32 buffer_size, mad_timer_t duration);
+ };
+
#endif
static void on_generate_samples(void *s, byte *samples, int len);
@@ -81,11 +101,12 @@ public:
enum {
FLAG_AUTOFREE = 1,
FLAG_UNSIGNED = 2, /* unsigned samples */
- FLAG_FILE = 4, /* sound is a FILE * that's read from */
+ FLAG_FILE = 4, /* sound is a FILE * that's read from */
};
void play_raw(PlayingSoundHandle *handle, void *sound, uint32 size, uint rate, byte flags);
#ifdef COMPRESSED_SOUND_FILE
void play_mp3(PlayingSoundHandle *handle, void *sound, uint32 size, byte flags);
+ void play_mp3_cdtrack(PlayingSoundHandle *handle, FILE* file, void *buffer, uint32 buffer_size, mad_timer_t duration);
#endif
/* Premix procedure, useful when using fmopl adlib */