From 4dae49e75a102f933ac8f10ddbfd57b24b6b6d61 Mon Sep 17 00:00:00 2001 From: Max Horn Date: Thu, 22 Feb 2007 18:35:57 +0000 Subject: cleanup svn-id: r25794 --- sound/mp3.cpp | 12 +++++------- sound/vorbis.cpp | 11 +++-------- 2 files changed, 8 insertions(+), 15 deletions(-) diff --git a/sound/mp3.cpp b/sound/mp3.cpp index 3233aa504f..e98134adc7 100644 --- a/sound/mp3.cpp +++ b/sound/mp3.cpp @@ -145,7 +145,6 @@ void MP3InputStream::decodeMP3Data() { return; do { - // If necessary, load more data if (_stream.buffer == NULL || _stream.error == MAD_ERROR_BUFLEN) { if (!readMP3Data()) { @@ -288,6 +287,11 @@ int MP3InputStream::readBuffer(int16 *buffer, const int numSamples) { } +#pragma mark - +#pragma mark --- MP3 factory functions --- +#pragma mark - + + AudioStream *makeMP3Stream(Common::File *file, uint32 size) { assert(file); @@ -345,7 +349,6 @@ public: void play(Audio::Mixer *mixer, Audio::SoundHandle *handle, int startFrame, int duration); }; - MP3TrackInfo::MP3TrackInfo(const char *filename) : _filename(filename), _errorFlag(false) { @@ -416,11 +419,6 @@ DigitalTrackInfo *getMP3Track(int track) { return NULL; } - -// Closing note: we added File::incRef and File::decRef mainly for the sake of the input streams -// If we could but get rid of it... - - } // End of namespace Audio #endif // #ifdef USE_MAD diff --git a/sound/vorbis.cpp b/sound/vorbis.cpp index 898730909a..edf1c3b5fb 100644 --- a/sound/vorbis.cpp +++ b/sound/vorbis.cpp @@ -41,9 +41,6 @@ #endif -using Common::File; - - namespace Audio { // These are wrapper functions to allow using a SeekableReadStream object to @@ -260,7 +257,7 @@ void VorbisInputStream::refill() { _bufferEnd = (int16 *)read_pos; } -AudioStream *makeVorbisStream(File *file, uint32 size) { +AudioStream *makeVorbisStream(Common::File *file, uint32 size) { assert(file); // FIXME: For now, just read the whole data into memory, and be done @@ -290,11 +287,11 @@ AudioStream *makeVorbisStream( } - #pragma mark - #pragma mark --- Ogg Vorbis Audio CD emulation --- #pragma mark - + class VorbisTrackInfo : public DigitalTrackInfo { private: Common::String _filename; @@ -306,7 +303,6 @@ public: void play(Audio::Mixer *mixer, Audio::SoundHandle *handle, int startFrame, int duration); }; - VorbisTrackInfo::VorbisTrackInfo(const char *filename) : _filename(filename), _errorFlag(false) { @@ -342,7 +338,7 @@ void VorbisTrackInfo::play(Audio::Mixer *mixer, Audio::SoundHandle *handle, int } // Convert startFrame & duration from frames (1/75 s) to milliseconds (1/1000s), - // i.e. multiple with a factor of 1000/75 = 40/3 + // i.e. multiply with a factor of 1000/75 = 40/3. uint start = startFrame * 40 / 3; uint end = duration ? ((startFrame + duration) * 40 / 3) : 0; @@ -371,7 +367,6 @@ DigitalTrackInfo *getVorbisTrack(int track) { } - } // End of namespace Audio #endif // #ifdef USE_VORBIS -- cgit v1.2.3