aboutsummaryrefslogtreecommitdiff
path: root/sound
diff options
context:
space:
mode:
authorJonathan Gray2005-08-10 06:16:26 +0000
committerJonathan Gray2005-08-10 06:16:26 +0000
commit3c1b5648aed0be45b303cea49e7537c98dd4a001 (patch)
treebd810ba197c9ceeab024be3f4b602c558b92019f /sound
parentc6c5c8f868c0c0ea37ddef156b8581d304ad5cac (diff)
downloadscummvm-rg350-3c1b5648aed0be45b303cea49e7537c98dd4a001.tar.gz
scummvm-rg350-3c1b5648aed0be45b303cea49e7537c98dd4a001.tar.bz2
scummvm-rg350-3c1b5648aed0be45b303cea49e7537c98dd4a001.zip
Rest of the changes required for tremor to actually work.
Based on patches against 0.7.1 by Jolan Luff. svn-id: r18641
Diffstat (limited to 'sound')
-rw-r--r--sound/audiocd.cpp8
-rw-r--r--sound/audiostream.cpp8
-rw-r--r--sound/vorbis.cpp14
-rw-r--r--sound/vorbis.h2
4 files changed, 11 insertions, 21 deletions
diff --git a/sound/audiocd.cpp b/sound/audiocd.cpp
index 7be50dc4d6..dee17a0910 100644
--- a/sound/audiocd.cpp
+++ b/sound/audiocd.cpp
@@ -46,13 +46,13 @@ static const TrackFormat TRACK_FORMATS[] = {
/* decoderName, openTrackFunction */
#ifdef USE_FLAC
{ "Flac", getFlacTrack },
-#endif // #ifdef USE_FLAC
-#ifdef USE_VORBIS
+#endif
+#if defined(USE_VORBIS) || defined(USE_TREMOR)
{ "Ogg Vorbis", getVorbisTrack },
-#endif // #ifdef USE_VORBIS
+#endif
#ifdef USE_MAD
{ "Mpeg Layer 3", getMP3Track },
-#endif // #ifdef USE_MAD
+#endif
{ NULL, NULL } // Terminator
};
diff --git a/sound/audiostream.cpp b/sound/audiostream.cpp
index 9cab081f69..776322d0fe 100644
--- a/sound/audiostream.cpp
+++ b/sound/audiostream.cpp
@@ -44,13 +44,13 @@ static const StreamFileFormat STREAM_FILEFORMATS[] = {
#ifdef USE_FLAC
{ "Flac", "flac", makeFlacStream },
{ "Flac", "fla", makeFlacStream },
-#endif // #ifdef USE_FLAC
-#ifdef USE_VORBIS
+#endif
+#if defined(USE_VORBIS) || defined(USE_TREMOR)
{ "Ogg Vorbis", "ogg", makeVorbisStream },
-#endif // #ifdef USE_VORBIS
+#endif
#ifdef USE_MAD
{ "Mpeg Layer 3", "mp3", makeMP3Stream },
-#endif // #ifdef USE_MAD
+#endif
{ NULL, NULL, NULL } // Terminator
};
diff --git a/sound/vorbis.cpp b/sound/vorbis.cpp
index 7c18a83a8e..669293a90f 100644
--- a/sound/vorbis.cpp
+++ b/sound/vorbis.cpp
@@ -168,16 +168,12 @@ VorbisTrackInfo::~VorbisTrackInfo() {
}
}
-#ifdef CHUNKSIZE
-#define VORBIS_TREMOR
-#endif
-
void VorbisTrackInfo::play(Audio::Mixer *mixer, Audio::SoundHandle *handle, int startFrame, int duration) {
bool err = openTrack();
assert(!err);
-#ifdef VORBIS_TREMOR
+#ifdef USE_TREMOR
ov_time_seek(&_ov_file, (ogg_int64_t)(startFrame / 75.0 * 1000));
#else
ov_time_seek(&_ov_file, startFrame / 75.0);
@@ -234,12 +230,6 @@ public:
};
-
-#ifdef CHUNKSIZE
-#define VORBIS_TREMOR
-#endif
-
-
VorbisInputStream::VorbisInputStream(OggVorbis_File *file, int duration, bool deleteFileAfterUse)
: _ov_file(file),
_bufferEnd(_buffer + ARRAYSIZE(_buffer)),
@@ -290,7 +280,7 @@ void VorbisInputStream::refill() {
while (len_left > 0 && _end_pos > ov_pcm_tell(_ov_file)) {
long result = ov_read(_ov_file, read_pos, len_left,
-#ifndef VORBIS_TREMOR
+#ifndef USE_TREMOR
#ifdef SCUMM_BIG_ENDIAN
1,
#else
diff --git a/sound/vorbis.h b/sound/vorbis.h
index 6f3796afff..fe8da6881f 100644
--- a/sound/vorbis.h
+++ b/sound/vorbis.h
@@ -25,7 +25,7 @@
#include "common/stdafx.h"
#include "common/scummsys.h"
-#ifdef USE_VORBIS
+#if defined(USE_VORBIS) || defined(USE_TREMOR)
class AudioStream;
class DigitalTrackInfo;