aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJames Brown2002-04-05 04:35:41 +0000
committerJames Brown2002-04-05 04:35:41 +0000
commit8448963ee5d603fce051bca6d0726d9cc7456e1a (patch)
treec08838c184e7038cb4f63c6ff01d3ce167b96ff9
parent4c9a95c3f9641eebd8941f0c759ece559e0b5911 (diff)
downloadscummvm-rg350-8448963ee5d603fce051bca6d0726d9cc7456e1a.tar.gz
scummvm-rg350-8448963ee5d603fce051bca6d0726d9cc7456e1a.tar.bz2
scummvm-rg350-8448963ee5d603fce051bca6d0726d9cc7456e1a.zip
Fix mp3_cd support
svn-id: r3869
-rw-r--r--Makefile4
-rwxr-xr-xmp3_cd.cpp18
-rw-r--r--sound.cpp8
-rw-r--r--sound.h5
4 files changed, 20 insertions, 15 deletions
diff --git a/Makefile b/Makefile
index bd0c520791..ed594885da 100644
--- a/Makefile
+++ b/Makefile
@@ -6,6 +6,8 @@ DEFINES = -DUNIX -DUSE_ADLIB
LDFLAGS :=
INCLUDES:= `sdl-config --cflags` -I./ -I./sound
CPPFLAGS= $(DEFINES) $(INCLUDES)
+
+# Add -lMAD for -DCOMPRESSED_SOUND_FILE
LIBS = `sdl-config --libs` -lncurses -lm
ZIPFILE := scummvm-`date '+%Y-%m-%d'`.zip
@@ -15,7 +17,7 @@ OBJS = actor.o boxes.o costume.o gfx.o object.o resource.o \
saveload.o script.o scummvm.o sound.o string.o \
sys.o verbs.o sdl.o script_v1.o script_v2.o debug.o gui.o \
sound/imuse.o sound/fmopl.o sound/adlib.o sound/gmidi.o debugrl.o \
- akos.o vars.o insane.o gameDetector.o init.o \
+ akos.o vars.o insane.o gameDetector.o init.o mp3_cd.o\
v3/resource_v3.o v4/resource_v4.o
DISTFILES=$(OBJS:.o=.cpp) Makefile scumm.h scummsys.h stdafx.h stdafx.cpp \
diff --git a/mp3_cd.cpp b/mp3_cd.cpp
index a36b703992..1dc6cfd3ac 100755
--- a/mp3_cd.cpp
+++ b/mp3_cd.cpp
@@ -208,14 +208,14 @@ bool mp3_cd_play(Scumm *s, int track, int num_loops, int start_frame, int end_fr
_mp3_track = fopen(track_name, "rb");
if (!_mp3_track) {
warning("No CD and track %d not available in mp3 format", track);
- return FALSE;
+ return false;
}
if (!parse_xing_vbr_tag()) {
warning("Error parsing file header - ignoring file",
track);
fclose(_mp3_track);
- return FALSE;
+ return false;
}
if (_vbr_header.flags) {
@@ -227,7 +227,7 @@ bool mp3_cd_play(Scumm *s, int track, int num_loops, int start_frame, int end_fr
warning("Missing required part of VBR header - ignoring file");
fclose(_mp3_track);
_vbr_header.flags = 0;
- return FALSE;
+ return false;
}
}
@@ -237,7 +237,7 @@ bool mp3_cd_play(Scumm *s, int track, int num_loops, int start_frame, int end_fr
_mc = s->allocateMixer();
if (!_mc) {
warning("No mixer channel available for MP3 music");
- return FALSE;
+ return false;
}
}
@@ -247,7 +247,7 @@ bool mp3_cd_play(Scumm *s, int track, int num_loops, int start_frame, int end_fr
_mc->type = MIXER_MP3_CDMUSIC;
_mc->sound_data.mp3_cdmusic.file = _mp3_track;
- _mc->sound_data.mp3_cdmusic.playing = FALSE;
+ _mc->sound_data.mp3_cdmusic.playing = false;
_mc->sound_data.mp3_cdmusic.buffer_size = 200000;
_mc->_sfx_sound = malloc(_mc->sound_data.mp3_cdmusic.buffer_size);
@@ -273,7 +273,7 @@ bool mp3_cd_play(Scumm *s, int track, int num_loops, int start_frame, int end_fr
if (start_frame < 0 || end_frame < 0) {
warning("Negative index in frame");
- return FALSE;
+ return false;
}
mad_timer_set(&_mc->sound_data.mp3_cdmusic.duration,
@@ -282,12 +282,12 @@ bool mp3_cd_play(Scumm *s, int track, int num_loops, int start_frame, int end_fr
CD_FPS);
fseek(_mp3_track, where, SEEK_SET);
- _mc->sound_data.mp3_cdmusic.playing = TRUE;
+ _mc->sound_data.mp3_cdmusic.playing = true;
- return TRUE;
+ return true;
}
- return FALSE;
+ return false;
}
#endif
diff --git a/sound.cpp b/sound.cpp
index ec8b67754b..ea3147dd7e 100644
--- a/sound.cpp
+++ b/sound.cpp
@@ -746,7 +746,7 @@ void MixerChannel::mix(int16 *data, uint32 len) {
fread(_sfx_sound, 1, sound_data.mp3_cdmusic.buffer_size,
sound_data.mp3_cdmusic.file);
if (!sound_data.mp3_cdmusic.size) {
- sound_data.mp3_cdmusic.playing = FALSE;
+ sound_data.mp3_cdmusic.playing = false;
return;
}
last_pos = ftell(sound_data.mp3_cdmusic.file);
@@ -769,7 +769,7 @@ void MixerChannel::mix(int16 *data, uint32 len) {
else {
if (!MAD_RECOVERABLE(sound_data.mp3_cdmusic.stream.error)) {
debug(1, "Unrecoverable error while skipping !");
- sound_data.mp3_cdmusic.playing = FALSE;
+ sound_data.mp3_cdmusic.playing = false;
return;
}
}
@@ -786,7 +786,7 @@ void MixerChannel::mix(int16 *data, uint32 len) {
sound_data.mp3_cdmusic.pos_in_frame = 0;
}
else {
- sound_data.mp3_cdmusic.playing = FALSE;
+ sound_data.mp3_cdmusic.playing = false;
return;
}
}
@@ -814,7 +814,7 @@ void MixerChannel::mix(int16 *data, uint32 len) {
mad_timer_negate(&frame_duration);
mad_timer_add(&sound_data.mp3_cdmusic.duration, frame_duration);
if (mad_timer_compare(sound_data.mp3_cdmusic.duration, mad_timer_zero) < 0) {
- sound_data.mp3_cdmusic.playing = FALSE;
+ sound_data.mp3_cdmusic.playing = false;
}
if (mad_frame_decode(&sound_data.mp3_cdmusic.frame,
diff --git a/sound.h b/sound.h
index 013d1f752e..49d5c2e0f2 100644
--- a/sound.h
+++ b/sound.h
@@ -17,6 +17,9 @@
*
* Change Log:
* $Log$
+ * Revision 1.12 2002/04/05 04:35:41 ender
+ * Fix mp3_cd support
+ *
* Revision 1.11 2002/04/05 04:24:39 ender
* Fix last BOOL
*
@@ -279,7 +282,7 @@ struct VolumeFader {
int8 speed_lo;
uint16 speed_lo_counter;
- void initialize() { active = false; }
+ void initialize() { active = false; }
void on_timer();
};