[Scummvm-cvs-logs] SF.net SVN: scummvm: [22231] scummvm/trunk/sound
fingolfin at users.sourceforge.net
fingolfin at users.sourceforge.net
Sat Apr 29 15:35:04 CEST 2006
Revision: 22231
Author: fingolfin
Date: 2006-04-29 15:33:31 -0700 (Sat, 29 Apr 2006)
ViewCVS: http://svn.sourceforge.net/scummvm/?rev=22231&view=rev
Log Message:
-----------
Moved the AudioCDManager as well as class AudioStream and its (standard) subclasses to namespace Audio
Modified Paths:
--------------
scummvm/trunk/engines/cine/sound_driver.h
scummvm/trunk/engines/gob/music.h
scummvm/trunk/engines/gob/sound.h
scummvm/trunk/engines/kyra/kyra.h
scummvm/trunk/engines/kyra/sound.cpp
scummvm/trunk/engines/kyra/sound.h
scummvm/trunk/engines/kyra/sound_adlib.cpp
scummvm/trunk/engines/queen/sound.cpp
scummvm/trunk/engines/saga/music.cpp
scummvm/trunk/engines/saga/music.h
scummvm/trunk/engines/saga/sndres.cpp
scummvm/trunk/engines/scumm/he/resource_he.cpp
scummvm/trunk/engines/scumm/he/sound_he.cpp
scummvm/trunk/engines/scumm/imuse_digi/dimuse.h
scummvm/trunk/engines/scumm/imuse_digi/dimuse_script.cpp
scummvm/trunk/engines/scumm/imuse_digi/dimuse_sndmgr.cpp
scummvm/trunk/engines/scumm/imuse_digi/dimuse_sndmgr.h
scummvm/trunk/engines/scumm/imuse_digi/dimuse_track.cpp
scummvm/trunk/engines/scumm/player_mod.cpp
scummvm/trunk/engines/scumm/player_mod.h
scummvm/trunk/engines/scumm/player_nes.h
scummvm/trunk/engines/scumm/player_v2.h
scummvm/trunk/engines/scumm/saveload.cpp
scummvm/trunk/engines/scumm/smush/smush_player.cpp
scummvm/trunk/engines/scumm/sound.cpp
scummvm/trunk/engines/scumm/sound.h
scummvm/trunk/engines/simon/animation.cpp
scummvm/trunk/engines/simon/animation.h
scummvm/trunk/engines/simon/sound.cpp
scummvm/trunk/engines/sky/music/adlibmusic.h
scummvm/trunk/engines/sword1/animation.cpp
scummvm/trunk/engines/sword1/animation.h
scummvm/trunk/engines/sword1/credits.cpp
scummvm/trunk/engines/sword1/music.cpp
scummvm/trunk/engines/sword1/music.h
scummvm/trunk/engines/sword1/sound.cpp
scummvm/trunk/engines/sword2/music.cpp
scummvm/trunk/engines/sword2/sound.cpp
scummvm/trunk/engines/sword2/sound.h
scummvm/trunk/graphics/animation.cpp
scummvm/trunk/graphics/animation.h
scummvm/trunk/sound/adpcm.cpp
scummvm/trunk/sound/adpcm.h
scummvm/trunk/sound/audiocd.cpp
scummvm/trunk/sound/audiocd.h
scummvm/trunk/sound/audiostream.cpp
scummvm/trunk/sound/audiostream.h
scummvm/trunk/sound/flac.cpp
scummvm/trunk/sound/flac.h
scummvm/trunk/sound/mixer.h
scummvm/trunk/sound/mp3.cpp
scummvm/trunk/sound/mp3.h
scummvm/trunk/sound/softsynth/emumidi.h
scummvm/trunk/sound/voc.cpp
scummvm/trunk/sound/voc.h
scummvm/trunk/sound/vorbis.cpp
scummvm/trunk/sound/vorbis.h
scummvm/trunk/sound/wave.cpp
scummvm/trunk/sound/wave.h
Modified: scummvm/trunk/engines/cine/sound_driver.h
===================================================================
--- scummvm/trunk/engines/cine/sound_driver.h 2006-04-29 17:50:15 UTC (rev 22230)
+++ scummvm/trunk/engines/cine/sound_driver.h 2006-04-29 22:33:31 UTC (rev 22231)
@@ -79,7 +79,7 @@
byte amDepth;
};
-class AdlibSoundDriver : public SoundDriver, AudioStream {
+class AdlibSoundDriver : public SoundDriver, Audio::AudioStream {
public:
AdlibSoundDriver(Audio::Mixer *mixer);
virtual ~AdlibSoundDriver();
Modified: scummvm/trunk/engines/gob/music.h
===================================================================
--- scummvm/trunk/engines/gob/music.h 2006-04-29 17:50:15 UTC (rev 22230)
+++ scummvm/trunk/engines/gob/music.h 2006-04-29 22:33:31 UTC (rev 22231)
@@ -33,7 +33,7 @@
class GobEngine;
-class Music : public AudioStream {
+class Music : public Audio::AudioStream {
public:
Music(GobEngine *vm);
~Music();
Modified: scummvm/trunk/engines/gob/sound.h
===================================================================
--- scummvm/trunk/engines/gob/sound.h 2006-04-29 17:50:15 UTC (rev 22230)
+++ scummvm/trunk/engines/gob/sound.h 2006-04-29 22:33:31 UTC (rev 22231)
@@ -66,7 +66,7 @@
protected:
// TODO: This is a very primitive square wave generator. The only thing is
// has in common with the PC speaker is that it sounds terrible.
- class SquareWaveStream : public AudioStream {
+ class SquareWaveStream : public Audio::AudioStream {
private:
uint _rate;
bool _beepForever;
Modified: scummvm/trunk/engines/kyra/kyra.h
===================================================================
--- scummvm/trunk/engines/kyra/kyra.h 2006-04-29 17:50:15 UTC (rev 22230)
+++ scummvm/trunk/engines/kyra/kyra.h 2006-04-29 22:33:31 UTC (rev 22231)
@@ -26,8 +26,6 @@
#include "base/engine.h"
#include "common/rect.h"
-class AudioStream;
-
namespace Kyra {
class Movie;
Modified: scummvm/trunk/engines/kyra/sound.cpp
===================================================================
--- scummvm/trunk/engines/kyra/sound.cpp 2006-04-29 17:50:15 UTC (rev 22230)
+++ scummvm/trunk/engines/kyra/sound.cpp 2006-04-29 22:33:31 UTC (rev 22231)
@@ -71,7 +71,7 @@
Common::MemoryReadStream vocStream(fileData, fileSize);
_mixer->stopHandle(_vocHandle);
- _currentVocFile = makeVOCStream(vocStream);
+ _currentVocFile = Audio::makeVOCStream(vocStream);
}
if (_currentVocFile)
@@ -476,13 +476,13 @@
const Sound::SpeechCodecs Sound::_supportedCodes[] = {
#ifdef USE_MAD
- { ".VO3", makeMP3Stream },
+ { ".VO3", Audio::makeMP3Stream },
#endif // USE_MAD
#ifdef USE_VORBIS
- { ".VOG", makeVorbisStream },
+ { ".VOG", Audio::makeVorbisStream },
#endif // USE_VORBIS
#ifdef USE_FLAC
- { ".VOF", makeFlacStream },
+ { ".VOF", Audio::makeFlacStream },
#endif // USE_FLAC
{ 0, 0 }
};
Modified: scummvm/trunk/engines/kyra/sound.h
===================================================================
--- scummvm/trunk/engines/kyra/sound.h 2006-04-29 17:50:15 UTC (rev 22230)
+++ scummvm/trunk/engines/kyra/sound.h 2006-04-29 22:33:31 UTC (rev 22231)
@@ -30,9 +30,8 @@
#include "sound/mixer.h"
#include "kyra/kyra.h"
-class AudioStream;
-
namespace Audio {
+class AudioStream;
class Mixer;
class SoundHandle;
} // end of namespace Audio
@@ -68,13 +67,13 @@
Audio::Mixer *_mixer;
private:
- AudioStream *_currentVocFile;
+ Audio::AudioStream *_currentVocFile;
Audio::SoundHandle _vocHandle;
Common::File _compressHandle;
struct SpeechCodecs {
const char *fileext;
- AudioStream *(*streamFunc)(Common::File*, uint32);
+ Audio::AudioStream *(*streamFunc)(Common::File*, uint32);
};
static const SpeechCodecs _supportedCodes[];
Modified: scummvm/trunk/engines/kyra/sound_adlib.cpp
===================================================================
--- scummvm/trunk/engines/kyra/sound_adlib.cpp 2006-04-29 17:50:15 UTC (rev 22230)
+++ scummvm/trunk/engines/kyra/sound_adlib.cpp 2006-04-29 22:33:31 UTC (rev 22231)
@@ -38,7 +38,7 @@
namespace Kyra {
-class AdlibDriver : public AudioStream {
+class AdlibDriver : public Audio::AudioStream {
public:
AdlibDriver(Audio::Mixer *mixer);
~AdlibDriver();
Modified: scummvm/trunk/engines/queen/sound.cpp
===================================================================
--- scummvm/trunk/engines/queen/sound.cpp 2006-04-29 17:50:15 UTC (rev 22230)
+++ scummvm/trunk/engines/queen/sound.cpp 2006-04-29 22:33:31 UTC (rev 22231)
@@ -207,7 +207,7 @@
uint32 size;
Common::File *f = _vm->resource()->giveCompressedSound(name, &size);
if (f) {
- _mixer->playInputStream(Audio::Mixer::kSFXSoundType, soundHandle, makeMP3Stream(f, size));
+ _mixer->playInputStream(Audio::Mixer::kSFXSoundType, soundHandle, Audio::makeMP3Stream(f, size));
return true;
}
return false;
@@ -219,7 +219,7 @@
uint32 size;
Common::File *f = _vm->resource()->giveCompressedSound(name, &size);
if (f) {
- _mixer->playInputStream(Audio::Mixer::kSFXSoundType, soundHandle, makeVorbisStream(f, size));
+ _mixer->playInputStream(Audio::Mixer::kSFXSoundType, soundHandle, Audio::makeVorbisStream(f, size));
return true;
}
return false;
@@ -231,7 +231,7 @@
uint32 size;
Common::File *f = _vm->resource()->giveCompressedSound(name, &size);
if (f) {
- _mixer->playInputStream(Audio::Mixer::kSFXSoundType, soundHandle, makeFlacStream(f, size));
+ _mixer->playInputStream(Audio::Mixer::kSFXSoundType, soundHandle, Audio::makeFlacStream(f, size));
return true;
}
return false;
Modified: scummvm/trunk/engines/saga/music.cpp
===================================================================
--- scummvm/trunk/engines/saga/music.cpp 2006-04-29 17:50:15 UTC (rev 22230)
+++ scummvm/trunk/engines/saga/music.cpp 2006-04-29 22:33:31 UTC (rev 22231)
@@ -41,18 +41,18 @@
#define BUFFER_SIZE 4096
struct TrackFormat {
- DigitalTrackInfo* (*openTrackFunction)(int);
+ Audio::DigitalTrackInfo* (*openTrackFunction)(int);
};
static const TrackFormat TRACK_FORMATS[] = {
#ifdef USE_FLAC
- { getFlacTrack },
+ { Audio::getFlacTrack },
#endif
#ifdef USE_VORBIS
- { getVorbisTrack },
+ { Audio::getVorbisTrack },
#endif
#ifdef USE_MAD
- { getMP3Track },
+ { Audio::getMP3Track },
#endif
{ NULL } // Terminator
@@ -63,7 +63,7 @@
// Sword 2, to make it easier to add support for compressed music... but I'll
// worry about that later.
-class RAWInputStream : public AudioStream {
+class RAWInputStream : public Audio::AudioStream {
private:
ResourceContext *_context;
Common::File *_file;
@@ -374,7 +374,7 @@
}
void Music::play(uint32 resourceId, MusicFlags flags) {
- AudioStream *audioStream = NULL;
+ Audio::AudioStream *audioStream = NULL;
MidiParser *parser;
ResourceContext *context;
byte *resourceData;
Modified: scummvm/trunk/engines/saga/music.h
===================================================================
--- scummvm/trunk/engines/saga/music.h 2006-04-29 17:50:15 UTC (rev 22230)
+++ scummvm/trunk/engines/saga/music.h 2006-04-29 22:33:31 UTC (rev 22231)
@@ -137,7 +137,7 @@
MidiParser *xmidiParser;
MidiParser *smfParser;
- DigitalTrackInfo *_track;
+ Audio::DigitalTrackInfo *_track;
byte *_midiMusicData;
Modified: scummvm/trunk/engines/saga/sndres.cpp
===================================================================
--- scummvm/trunk/engines/saga/sndres.cpp 2006-04-29 17:50:15 UTC (rev 22230)
+++ scummvm/trunk/engines/saga/sndres.cpp 2006-04-29 22:33:31 UTC (rev 22231)
@@ -137,7 +137,7 @@
bool SndRes::load(ResourceContext *context, uint32 resourceId, SoundBuffer &buffer, bool onlyHeader) {
byte *soundResource;
- AudioStream *voxStream;
+ Audio::AudioStream *voxStream;
size_t soundResourceLength;
bool result = false;
GameSoundTypes resourceType;
@@ -217,7 +217,7 @@
buffer.buffer = NULL;
free(soundResource);
} else {
- voxStream = makeADPCMStream(&readS, soundResourceLength, kADPCMOki);
+ voxStream = Audio::makeADPCMStream(&readS, soundResourceLength, Audio::kADPCMOki);
buffer.buffer = (byte *)malloc(buffer.size);
voxSize = voxStream->readBuffer((int16*)buffer.buffer, soundResourceLength * 2);
if (voxSize != soundResourceLength * 2) {
@@ -228,7 +228,7 @@
result = true;
break;
case kSoundVOC:
- data = loadVOCFromStream(readS, size, rate);
+ data = Audio::loadVOCFromStream(readS, size, rate);
if (data) {
buffer.frequency = rate;
buffer.sampleBits = 8;
@@ -246,7 +246,7 @@
free(soundResource);
break;
case kSoundWAV:
- if (loadWAVFromStream(readS, size, rate, flags)) {
+ if (Audio::loadWAVFromStream(readS, size, rate, flags)) {
buffer.frequency = rate;
buffer.sampleBits = 16;
buffer.stereo = ((flags & Audio::Mixer::FLAG_STEREO) != 0);
Modified: scummvm/trunk/engines/scumm/he/resource_he.cpp
===================================================================
--- scummvm/trunk/engines/scumm/he/resource_he.cpp 2006-04-29 17:50:15 UTC (rev 22230)
+++ scummvm/trunk/engines/scumm/he/resource_he.cpp 2006-04-29 22:33:31 UTC (rev 22231)
@@ -1777,7 +1777,7 @@
size = READ_BE_UINT32(ptr + 4);
Common::MemoryReadStream stream(ptr, size);
- if (!loadWAVFromStream(stream, size, rate, flags)) {
+ if (!Audio::loadWAVFromStream(stream, size, rate, flags)) {
error("getSoundResourceSize: Not a valid WAV file");
}
} else {
Modified: scummvm/trunk/engines/scumm/he/sound_he.cpp
===================================================================
--- scummvm/trunk/engines/scumm/he/sound_he.cpp 2006-04-29 17:50:15 UTC (rev 22230)
+++ scummvm/trunk/engines/scumm/he/sound_he.cpp 2006-04-29 22:33:31 UTC (rev 22231)
@@ -538,12 +538,12 @@
size = READ_LE_UINT32(ptr + 4);
Common::MemoryReadStream stream(ptr, size);
- if (!loadWAVFromStream(stream, size, rate, flags, &compType, &blockAlign)) {
+ if (!Audio::loadWAVFromStream(stream, size, rate, flags, &compType, &blockAlign)) {
error("playHESound: Not a valid WAV file (%d)", soundID);
}
if (compType == 17) {
- AudioStream *voxStream = makeADPCMStream(&stream, size, kADPCMMSIma, rate, (flags & Audio::Mixer::FLAG_STEREO) ? 2 : 1, blockAlign);
+ Audio::AudioStream *voxStream = Audio::makeADPCMStream(&stream, size, Audio::kADPCMMSIma, rate, (flags & Audio::Mixer::FLAG_STEREO) ? 2 : 1, blockAlign);
sound = (char *)malloc(size * 4);
size = voxStream->readBuffer((int16*)sound, size * 2);
Modified: scummvm/trunk/engines/scumm/imuse_digi/dimuse.h
===================================================================
--- scummvm/trunk/engines/scumm/imuse_digi/dimuse.h 2006-04-29 17:50:15 UTC (rev 22230)
+++ scummvm/trunk/engines/scumm/imuse_digi/dimuse.h 2006-04-29 22:33:31 UTC (rev 22231)
@@ -80,7 +80,7 @@
ImuseDigiSndMgr::soundStruct *soundHandle;
Audio::SoundHandle handle;
AppendableAudioStream *stream;
- AudioStream *stream2;
+ Audio::AudioStream *stream2;
Track();
};
@@ -106,7 +106,7 @@
void callback();
void switchToNextRegion(Track *track);
int allocSlot(int priority);
- void startSound(int soundId, const char *soundName, int soundType, int volGroupId, AudioStream *input, int hookId, int volume, int priority);
+ void startSound(int soundId, const char *soundName, int soundType, int volGroupId, Audio::AudioStream *input, int hookId, int volume, int priority);
void selectVolumeGroup(int soundId, int volGroupId);
int32 getPosInMs(int soundId);
@@ -135,7 +135,7 @@
void setAudioNames(int32 num, char *names);
- void startVoice(int soundId, AudioStream *input);
+ void startVoice(int soundId, Audio::AudioStream *input);
void startVoice(int soundId, const char *soundName);
void startMusic(int soundId, int volume);
void startMusic(const char *soundName, int soundId, int hookId, int volume);
Modified: scummvm/trunk/engines/scumm/imuse_digi/dimuse_script.cpp
===================================================================
--- scummvm/trunk/engines/scumm/imuse_digi/dimuse_script.cpp 2006-04-29 17:50:15 UTC (rev 22230)
+++ scummvm/trunk/engines/scumm/imuse_digi/dimuse_script.cpp 2006-04-29 22:33:31 UTC (rev 22231)
@@ -208,7 +208,7 @@
}
}
-void IMuseDigital::startVoice(int soundId, AudioStream *input) {
+void IMuseDigital::startVoice(int soundId, Audio::AudioStream *input) {
debug(5, "startVoiceStream(%d)", soundId);
startSound(soundId, "", 0, IMUSE_VOLGRP_VOICE, input, 0, 127, 127);
}
Modified: scummvm/trunk/engines/scumm/imuse_digi/dimuse_sndmgr.cpp
===================================================================
--- scummvm/trunk/engines/scumm/imuse_digi/dimuse_sndmgr.cpp 2006-04-29 17:50:15 UTC (rev 22230)
+++ scummvm/trunk/engines/scumm/imuse_digi/dimuse_sndmgr.cpp 2006-04-29 22:33:31 UTC (rev 22231)
@@ -163,7 +163,7 @@
int time_constant = ptr[offset];
offset += 2;
len -= 2;
- sound->freq = getSampleRateFromVOCRate(time_constant);
+ sound->freq = Audio::getSampleRateFromVOCRate(time_constant);
sound->region[sound->numRegions].offset = offset;
sound->region[sound->numRegions].length = len;
sound->numRegions++;
@@ -614,11 +614,11 @@
if (!soundHandle->compressedStream) {
#ifdef USE_VORBIS
if (oggMode)
- soundHandle->compressedStream = makeVorbisStream(cmpFile, len);
+ soundHandle->compressedStream = Audio::makeVorbisStream(cmpFile, len);
#endif
#ifdef USE_MAD
if (!oggMode)
- soundHandle->compressedStream = makeMP3Stream(cmpFile, len);
+ soundHandle->compressedStream = Audio::makeMP3Stream(cmpFile, len);
#endif
assert(soundHandle->compressedStream);
}
Modified: scummvm/trunk/engines/scumm/imuse_digi/dimuse_sndmgr.h
===================================================================
--- scummvm/trunk/engines/scumm/imuse_digi/dimuse_sndmgr.h 2006-04-29 17:50:15 UTC (rev 22230)
+++ scummvm/trunk/engines/scumm/imuse_digi/dimuse_sndmgr.h 2006-04-29 22:33:31 UTC (rev 22231)
@@ -85,7 +85,7 @@
int type;
int volGroupId;
int disk;
- AudioStream *compressedStream;
+ Audio::AudioStream *compressedStream;
bool compressed;
char lastFileName[24];
};
Modified: scummvm/trunk/engines/scumm/imuse_digi/dimuse_track.cpp
===================================================================
--- scummvm/trunk/engines/scumm/imuse_digi/dimuse_track.cpp 2006-04-29 17:50:15 UTC (rev 22230)
+++ scummvm/trunk/engines/scumm/imuse_digi/dimuse_track.cpp 2006-04-29 22:33:31 UTC (rev 22231)
@@ -67,7 +67,7 @@
return trackId;
}
-void IMuseDigital::startSound(int soundId, const char *soundName, int soundType, int volGroupId, AudioStream *input, int hookId, int volume, int priority) {
+void IMuseDigital::startSound(int soundId, const char *soundName, int soundType, int volGroupId, Audio::AudioStream *input, int hookId, int volume, int priority) {
debug(5, "IMuseDigital::startSound(%d)", soundId);
int l = allocSlot(priority);
Modified: scummvm/trunk/engines/scumm/player_mod.cpp
===================================================================
--- scummvm/trunk/engines/scumm/player_mod.cpp 2006-04-29 17:50:15 UTC (rev 22230)
+++ scummvm/trunk/engines/scumm/player_mod.cpp 2006-04-29 22:33:31 UTC (rev 22231)
@@ -92,7 +92,7 @@
_channels[i].vol = vol;
_channels[i].pan = pan;
_channels[i].freq = rate;
- _channels[i].input = makeLinearInputStream(rate, Audio::Mixer::FLAG_AUTOFREE | (loopStart != loopEnd ? Audio::Mixer::FLAG_LOOP : 0), (const byte*)data, size, loopStart, loopEnd - loopStart);
+ _channels[i].input = Audio::makeLinearInputStream(rate, Audio::Mixer::FLAG_AUTOFREE | (loopStart != loopEnd ? Audio::Mixer::FLAG_LOOP : 0), (const byte*)data, size, loopStart, loopEnd - loopStart);
_channels[i].converter = Audio::makeRateConverter(rate, _mixer->getOutputRate(), false, false);
}
Modified: scummvm/trunk/engines/scumm/player_mod.h
===================================================================
--- scummvm/trunk/engines/scumm/player_mod.h 2006-04-29 17:50:15 UTC (rev 22230)
+++ scummvm/trunk/engines/scumm/player_mod.h 2006-04-29 22:33:31 UTC (rev 22231)
@@ -36,7 +36,7 @@
/**
* Generic Amiga MOD mixer - provides a 60Hz 'update' routine.
*/
-class Player_MOD : public AudioStream {
+class Player_MOD : public Audio::AudioStream {
public:
Player_MOD(ScummEngine *scumm);
virtual ~Player_MOD();
@@ -73,7 +73,7 @@
int8 pan;
uint16 freq;
Audio::RateConverter *converter;
- AudioStream *input;
+ Audio::AudioStream *input;
};
Audio::Mixer *_mixer;
Modified: scummvm/trunk/engines/scumm/player_nes.h
===================================================================
--- scummvm/trunk/engines/scumm/player_nes.h 2006-04-29 17:50:15 UTC (rev 22230)
+++ scummvm/trunk/engines/scumm/player_nes.h 2006-04-29 22:33:31 UTC (rev 22231)
@@ -43,7 +43,7 @@
/**
* Scumm NES sound/music driver.
*/
-class Player_NES : public AudioStream, public MusicEngine {
+class Player_NES : public Audio::AudioStream, public MusicEngine {
public:
Player_NES(ScummEngine *scumm);
virtual ~Player_NES();
Modified: scummvm/trunk/engines/scumm/player_v2.h
===================================================================
--- scummvm/trunk/engines/scumm/player_v2.h 2006-04-29 17:50:15 UTC (rev 22230)
+++ scummvm/trunk/engines/scumm/player_v2.h 2006-04-29 22:33:31 UTC (rev 22231)
@@ -76,7 +76,7 @@
* This simulates the pc speaker sound, which is driven by the 8253 (square
* wave generator) and a low-band filter.
*/
-class Player_V2 : public AudioStream, public MusicEngine {
+class Player_V2 : public Audio::AudioStream, public MusicEngine {
public:
Player_V2(ScummEngine *scumm, bool pcjr);
virtual ~Player_V2();
Modified: scummvm/trunk/engines/scumm/saveload.cpp
===================================================================
--- scummvm/trunk/engines/scumm/saveload.cpp 2006-04-29 17:50:15 UTC (rev 22230)
+++ scummvm/trunk/engines/scumm/saveload.cpp 2006-04-29 22:33:31 UTC (rev 22231)
@@ -871,7 +871,7 @@
// as AudioCDManager::Status::playing, and MSVC6 has
// a fit with that. This typedef simplifies the notation
// to something MSVC6 can grasp.
- typedef AudioCDManager::Status AudioCDManager_Status;
+ typedef Audio::AudioCDManager::Status AudioCDManager_Status;
const SaveLoadEntry audioCDEntries[] = {
MKLINE(AudioCDManager_Status, playing, sleUint32, VER(24)),
MKLINE(AudioCDManager_Status, track, sleInt32, VER(24)),
@@ -1140,7 +1140,7 @@
// Save/load the Audio CD status
//
if (s->getVersion() >= VER(24)) {
- AudioCDManager::Status info;
+ Audio::AudioCDManager::Status info;
if (s->isSaving())
info = AudioCD.getStatus();
s->saveLoadArrayOf(&info, 1, sizeof(info), audioCDEntries);
Modified: scummvm/trunk/engines/scumm/smush/smush_player.cpp
===================================================================
--- scummvm/trunk/engines/scumm/smush/smush_player.cpp 2006-04-29 17:50:15 UTC (rev 22230)
+++ scummvm/trunk/engines/scumm/smush/smush_player.cpp 2006-04-29 22:33:31 UTC (rev 22231)
@@ -1270,7 +1270,7 @@
if (_compressedFile.isOpen()) {
int size = _compressedFile.size();
_compressedFileMode = true;
- _vm->_mixer->playInputStream(Audio::Mixer::kSFXSoundType, &_compressedFileSoundHandle, makeMP3Stream(&_compressedFile, size));
+ _vm->_mixer->playInputStream(Audio::Mixer::kSFXSoundType, &_compressedFileSoundHandle, Audio::makeMP3Stream(&_compressedFile, size));
return;
}
#endif
@@ -1281,7 +1281,7 @@
if (_compressedFile.isOpen()) {
int size = _compressedFile.size();
_compressedFileMode = true;
- _vm->_mixer->playInputStream(Audio::Mixer::kSFXSoundType, &_compressedFileSoundHandle, makeVorbisStream(&_compressedFile, size));
+ _vm->_mixer->playInputStream(Audio::Mixer::kSFXSoundType, &_compressedFileSoundHandle, Audio::makeVorbisStream(&_compressedFile, size));
return;
}
#endif
Modified: scummvm/trunk/engines/scumm/sound.cpp
===================================================================
--- scummvm/trunk/engines/scumm/sound.cpp 2006-04-29 17:50:15 UTC (rev 22230)
+++ scummvm/trunk/engines/scumm/sound.cpp 2006-04-29 22:33:31 UTC (rev 22231)
@@ -272,10 +272,10 @@
// We'd have to add the 'Creative Voice File' header for this, though,
// or make readVOCFromMemory() less strict.
- VocBlockHeader &voc_block_hdr = *(VocBlockHeader *)ptr;
+ Audio::VocBlockHeader &voc_block_hdr = *(Audio::VocBlockHeader *)ptr;
assert(voc_block_hdr.blocktype == 1);
size = voc_block_hdr.size[0] + (voc_block_hdr.size[1] << 8) + (voc_block_hdr.size[2] << 16) - 2;
- rate = getSampleRateFromVOCRate(voc_block_hdr.sr);
+ rate = Audio::getSampleRateFromVOCRate(voc_block_hdr.sr);
assert(voc_block_hdr.pack == 0);
// Allocate a sound buffer, copy the data into it, and play
@@ -600,29 +600,29 @@
}
if (!_soundsPaused && _vm->_mixer->isReady()) {
- AudioStream *input = NULL;
+ Audio::AudioStream *input = NULL;
switch (_soundMode) {
case kMP3Mode:
#ifdef USE_MAD
assert(size > 0);
- input = makeMP3Stream(_sfxFile, size);
+ input = Audio::makeMP3Stream(_sfxFile, size);
#endif
break;
case kVorbisMode:
#ifdef USE_VORBIS
assert(size > 0);
- input = makeVorbisStream(_sfxFile, size);
+ input = Audio::makeVorbisStream(_sfxFile, size);
#endif
break;
case kFlacMode:
#ifdef USE_FLAC
assert(size > 0);
- input = makeFlacStream(_sfxFile, size);
+ input = Audio::makeFlacStream(_sfxFile, size);
#endif
break;
default:
- input = makeVOCStream(*_sfxFile);
+ input = Audio::makeVOCStream(*_sfxFile);
}
if (!input) {
Modified: scummvm/trunk/engines/scumm/sound.h
===================================================================
--- scummvm/trunk/engines/scumm/sound.h 2006-04-29 17:50:15 UTC (rev 22230)
+++ scummvm/trunk/engines/scumm/sound.h 2006-04-29 22:33:31 UTC (rev 22231)
@@ -136,7 +136,7 @@
* An audio stream to which additional data can be appended on-the-fly.
* Used by SMUSH and iMuseDigital.
*/
-class AppendableAudioStream : public AudioStream {
+class AppendableAudioStream : public Audio::AudioStream {
public:
virtual void append(const byte *data, uint32 len) = 0;
virtual void finish() = 0;
Modified: scummvm/trunk/engines/simon/animation.cpp
===================================================================
--- scummvm/trunk/engines/simon/animation.cpp 2006-04-29 17:50:15 UTC (rev 22230)
+++ scummvm/trunk/engines/simon/animation.cpp 2006-04-29 22:33:31 UTC (rev 22231)
@@ -187,7 +187,7 @@
_fd.read(buffer, size);
Common::MemoryReadStream stream(buffer, size);
- _bgSoundStream = makeWAVStream(stream);
+ _bgSoundStream = Audio::makeWAVStream(stream);
_mixer->stopHandle(_bgSound);
_mixer->playInputStream(Audio::Mixer::kSFXSoundType, &_bgSound, _bgSoundStream);
free(buffer);
Modified: scummvm/trunk/engines/simon/animation.h
===================================================================
--- scummvm/trunk/engines/simon/animation.h 2006-04-29 17:50:15 UTC (rev 22230)
+++ scummvm/trunk/engines/simon/animation.h 2006-04-29 22:33:31 UTC (rev 22231)
@@ -38,7 +38,7 @@
Audio::Mixer *_mixer;
Audio::SoundHandle _bgSound;
- AudioStream *_bgSoundStream;
+ Audio::AudioStream *_bgSoundStream;
bool _omniTV;
bool _playing;
Modified: scummvm/trunk/engines/simon/sound.cpp
===================================================================
--- scummvm/trunk/engines/simon/sound.cpp 2006-04-29 17:50:15 UTC (rev 22230)
+++ scummvm/trunk/engines/simon/sound.cpp 2006-04-29 22:33:31 UTC (rev 22231)
@@ -133,7 +133,7 @@
byte wavFlags;
int size, rate;
- if (!loadWAVFromStream(*_file, size, rate, wavFlags)) {
+ if (!Audio::loadWAVFromStream(*_file, size, rate, wavFlags)) {
error("playSound: Not a valid WAV file");
}
@@ -151,7 +151,7 @@
_file->seek(_offsets[sound], SEEK_SET);
int size, rate;
- byte *buffer = loadVOCFromStream(*_file, size, rate);
+ byte *buffer = Audio::loadVOCFromStream(*_file, size, rate);
_mixer->playRaw(handle, buffer, size, rate, flags | Audio::Mixer::FLAG_AUTOFREE);
}
@@ -187,7 +187,7 @@
uint32 size = _offsets[sound + i] - _offsets[sound];
- _mixer->playInputStream(Audio::Mixer::kSFXSoundType, handle, makeMP3Stream(_file, size));
+ _mixer->playInputStream(Audio::Mixer::kSFXSoundType, handle, Audio::makeMP3Stream(_file, size));
}
#endif
@@ -211,7 +211,7 @@
uint32 size = _offsets[sound + i] - _offsets[sound];
- _mixer->playInputStream(Audio::Mixer::kSFXSoundType, handle, makeVorbisStream(_file, size));
+ _mixer->playInputStream(Audio::Mixer::kSFXSoundType, handle, Audio::makeVorbisStream(_file, size));
}
#endif
@@ -235,7 +235,7 @@
uint32 size = _offsets[sound + i] - _offsets[sound];
- _mixer->playInputStream(Audio::Mixer::kSFXSoundType, handle, makeFlacStream(_file, size));
+ _mixer->playInputStream(Audio::Mixer::kSFXSoundType, handle, Audio::makeFlacStream(_file, size));
}
#endif
@@ -588,7 +588,7 @@
int size = READ_LE_UINT32(soundData + 4);
Common::MemoryReadStream stream(soundData, size);
- if (!loadWAVFromStream(stream, size, rate, flags, &compType, &blockAlign)) {
+ if (!Audio::loadWAVFromStream(stream, size, rate, flags, &compType, &blockAlign)) {
error("playSoundData: Not a valid WAV data");
}
@@ -628,7 +628,7 @@
flags |= Audio::Mixer::FLAG_LOOP;
if (compType == 2) {
- AudioStream *sndStream = makeADPCMStream(&stream, size, kADPCMMS, rate, (flags & Audio::Mixer::FLAG_STEREO) ? 2 : 1, blockAlign);
+ Audio::AudioStream *sndStream = Audio::makeADPCMStream(&stream, size, Audio::kADPCMMS, rate, (flags & Audio::Mixer::FLAG_STEREO) ? 2 : 1, blockAlign);
buffer = (byte *)malloc(size * 4);
size = sndStream->readBuffer((int16*)buffer, size * 2);
size *= 2; // 16bits.
Modified: scummvm/trunk/engines/sky/music/adlibmusic.h
===================================================================
--- scummvm/trunk/engines/sky/music/adlibmusic.h 2006-04-29 17:50:15 UTC (rev 22230)
+++ scummvm/trunk/engines/sky/music/adlibmusic.h 2006-04-29 22:33:31 UTC (rev 22231)
@@ -33,7 +33,7 @@
namespace Sky {
-class AdlibMusic : public AudioStream, public MusicBase {
+class AdlibMusic : public Audio::AudioStream, public MusicBase {
public:
AdlibMusic(Audio::Mixer *pMixer, Disk *pDisk);
~AdlibMusic(void);
Modified: scummvm/trunk/engines/sword1/animation.cpp
===================================================================
--- scummvm/trunk/engines/sword1/animation.cpp 2006-04-29 17:50:15 UTC (rev 22230)
+++ scummvm/trunk/engines/sword1/animation.cpp 2006-04-29 22:33:31 UTC (rev 22231)
@@ -74,11 +74,11 @@
return !_snd->isSoundHandleActive(_bgSound);
}
-AudioStream *AnimationState::createAudioStream(const char *name, void *arg) {
+Audio::AudioStream *AnimationState::createAudioStream(const char *name, void *arg) {
if (arg)
- return (AudioStream*)arg;
+ return (Audio::AudioStream*)arg;
else
- return AudioStream::openStreamFile(name);
+ return Audio::AudioStream::openStreamFile(name);
}
MoviePlayer::MoviePlayer(Screen *scr, Audio::Mixer *snd, OSystem *sys)
@@ -103,7 +103,7 @@
void MoviePlayer::play(uint32 id) {
#if defined(USE_MPEG2) && defined(USE_VORBIS)
AnimationState *anim = new AnimationState(_scr, _snd, _sys);
- AudioStream *stream = NULL;
+ Audio::AudioStream *stream = NULL;
if (SwordEngine::_systemVars.cutscenePackVersion == 1) {
if ((id == SEQ_INTRO) || (id == SEQ_FINALE) || (id == SEQ_HISTORY) || (id == SEQ_FERRARI)) {
// these sequences are language specific
@@ -120,7 +120,7 @@
for (uint32 segCnt = 0; segCnt < numSegs; segCnt++) {
oggSource->seek( header[SwordEngine::_systemVars.language * 2 + 0 + segCnt * 14]);
uint32 segSize = header[SwordEngine::_systemVars.language * 2 + 1 + segCnt * 14];
- AudioStream *apStream = makeVorbisStream(oggSource, segSize);
+ Audio::AudioStream *apStream = Audio::makeVorbisStream(oggSource, segSize);
if (!apStream)
error("Can't create Vorbis Stream from file %s", sndName);
sStream->appendStream(apStream);
@@ -240,7 +240,7 @@
return 22050;
}
-void SplittedAudioStream::appendStream(AudioStream *stream) {
+void SplittedAudioStream::appendStream(Audio::AudioStream *stream) {
FileQueue **que = &_queue;
while (*que)
que = &((*que)->next);
Modified: scummvm/trunk/engines/sword1/animation.h
===================================================================
--- scummvm/trunk/engines/sword1/animation.h 2006-04-29 17:50:15 UTC (rev 22230)
+++ scummvm/trunk/engines/sword1/animation.h 2006-04-29 22:33:31 UTC (rev 22231)
@@ -76,7 +76,7 @@
#endif
protected:
- virtual AudioStream *createAudioStream(const char *name, void *arg);
+ virtual Audio::AudioStream *createAudioStream(const char *name, void *arg);
};
class MoviePlayer {
@@ -98,15 +98,15 @@
};
struct FileQueue {
- AudioStream *stream;
+ Audio::AudioStream *stream;
FileQueue *next;
};
-class SplittedAudioStream : public AudioStream {
+class SplittedAudioStream : public Audio::AudioStream {
public:
SplittedAudioStream(void);
~SplittedAudioStream(void);
- void appendStream(AudioStream *stream);
+ void appendStream(Audio::AudioStream *stream);
virtual int readBuffer(int16 *buffer, const int numSamples);
virtual bool isStereo(void) const;
virtual bool endOfData(void) const;
Modified: scummvm/trunk/engines/sword1/credits.cpp
===================================================================
--- scummvm/trunk/engines/sword1/credits.cpp 2006-04-29 17:50:15 UTC (rev 22230)
+++ scummvm/trunk/engines/sword1/credits.cpp 2006-04-29 22:33:31 UTC (rev 22231)
@@ -86,7 +86,7 @@
}
void CreditsPlayer::play(void) {
- AudioStream *bgSoundStream = AudioStream::openStreamFile("credits");
+ Audio::AudioStream *bgSoundStream = Audio::AudioStream::openStreamFile("credits");
if (bgSoundStream == NULL) {
warning("\"credits.ogg\" not found, skipping credits sequence");
return;
Modified: scummvm/trunk/engines/sword1/music.cpp
===================================================================
--- scummvm/trunk/engines/sword1/music.cpp 2006-04-29 17:50:15 UTC (rev 22230)
+++ scummvm/trunk/engines/sword1/music.cpp 2006-04-29 22:33:31 UTC (rev 22231)
@@ -47,7 +47,7 @@
_sourceFile = source;
_sampleBuf = (uint8*)malloc(SMP_BUFSIZE);
_sourceFile->incRef();
- if (_sourceFile->isOpen() && loadWAVFromStream(*_sourceFile, size, rate, flags)) {
+ if (_sourceFile->isOpen() && Audio::loadWAVFromStream(*_sourceFile, size, rate, flags)) {
_isStereo = (flags & Audio::Mixer::FLAG_STEREO) != 0;
_rate = rate;
if (pSize && (int)pSize < size)
@@ -107,16 +107,16 @@
// These functions are only called from Music, so I'm just going to
// assume that if locking is needed it has already been taken care of.
-AudioStream *MusicHandle::createAudioSource(void) {
+Audio::AudioStream *MusicHandle::createAudioSource(void) {
_file.seek(0);
switch (_musicMode) {
#ifdef USE_MAD
case MusicMp3:
- return makeMP3Stream(&_file, _file.size());
+ return Audio::makeMP3Stream(&_file, _file.size());
#endif
#ifdef USE_VORBIS
case MusicVorbis:
- return makeVorbisStream(&_file, _file.size());
+ return Audio::makeVorbisStream(&_file, _file.size());
#endif
case MusicWave:
return makeWaveStream(&_file, 0);
Modified: scummvm/trunk/engines/sword1/music.h
===================================================================
--- scummvm/trunk/engines/sword1/music.h 2006-04-29 17:50:15 UTC (rev 22230)
+++ scummvm/trunk/engines/sword1/music.h 2006-04-29 22:33:31 UTC (rev 22231)
@@ -44,7 +44,7 @@
MusicVorbis
};
-class WaveAudioStream : public AudioStream {
+class WaveAudioStream : public Audio::AudioStream {
public:
WaveAudioStream(Common::File *source, uint32 pSize);
virtual ~WaveAudioStream();
@@ -61,15 +61,15 @@
uint16 _bitsPerSample;
};
-class MusicHandle : public AudioStream {
+class MusicHandle : public Audio::AudioStream {
private:
Common::File _file;
bool _looping;
int32 _fading;
int32 _fadeSamples;
MusicMode _musicMode;
- AudioStream *_audioSource;
- AudioStream *createAudioSource(void);
+ Audio::AudioStream *_audioSource;
+ Audio::AudioStream *createAudioSource(void);
public:
MusicHandle() : _looping(false), _fading(0), _audioSource(NULL) {}
virtual int readBuffer(int16 *buffer, const int numSamples);
@@ -85,7 +85,7 @@
int getRate() const;
};
-class Music : public AudioStream {
+class Music : public Audio::AudioStream {
public:
Music(Audio::Mixer *pMixer);
~Music();
Modified: scummvm/trunk/engines/sword1/sound.cpp
===================================================================
--- scummvm/trunk/engines/sword1/sound.cpp 2006-04-29 17:50:15 UTC (rev 22230)
+++ scummvm/trunk/engines/sword1/sound.cpp 2006-04-29 22:33:31 UTC (rev 22231)
@@ -201,7 +201,7 @@
#ifdef USE_MAD
else if (_cowMode == CowMp3) {
_cowFile.seek(index);
- _mixer->playInputStream(Audio::Mixer::kSFXSoundType, &_speechHandle, makeMP3Stream(&_cowFile, sampleSize), SOUND_SPEECH_ID, speechVol, speechPan);
+ _mixer->playInputStream(Audio::Mixer::kSFXSoundType, &_speechHandle, Audio::makeMP3Stream(&_cowFile, sampleSize), SOUND_SPEECH_ID, speechVol, speechPan);
// with compressed audio, we can't calculate the wave volume.
// so default to talking.
for (int cnt = 0; cnt < 480; cnt++)
@@ -212,7 +212,7 @@
#ifdef USE_VORBIS
else if (_cowMode == CowVorbis) {
_cowFile.seek(index);
- _mixer->playInputStream(Audio::Mixer::kSFXSoundType, &_speechHandle, makeVorbisStream(&_cowFile, sampleSize), SOUND_SPEECH_ID, speechVol, speechPan);
+ _mixer->playInputStream(Audio::Mixer::kSFXSoundType, &_speechHandle, Audio::makeVorbisStream(&_cowFile, sampleSize), SOUND_SPEECH_ID, speechVol, speechPan);
for (int cnt = 0; cnt < 480; cnt++)
_waveVolume[cnt] = true;
_waveVolPos = 0;
Modified: scummvm/trunk/engines/sword2/music.cpp
===================================================================
--- scummvm/trunk/engines/sword2/music.cpp 2006-04-29 17:50:15 UTC (rev 22230)
+++ scummvm/trunk/engines/sword2/music.cpp 2006-04-29 22:33:31 UTC (rev 22231)
@@ -43,9 +43,9 @@
namespace Sword2 {
-static AudioStream *makeCLUStream(Common::File *fp, int size);
+static Audio::AudioStream *makeCLUStream(Common::File *fp, int size);
-static AudioStream *getAudioStream(SoundFileHandle *fh, const char *base, int cd, uint32 id, uint32 *numSamples) {
+static Audio::AudioStream *getAudioStream(SoundFileHandle *fh, const char *base, int cd, uint32 id, uint32 *numSamples) {
debug(3, "Playing %s from CD %d", base, cd);
if (!fh->file.isOpen()) {
@@ -139,15 +139,15 @@
return makeCLUStream(&fh->file, enc_len);
#ifdef USE_MAD
case kMP3Mode:
- return makeMP3Stream(&fh->file, enc_len);
+ return Audio::makeMP3Stream(&fh->file, enc_len);
#endif
#ifdef USE_VORBIS
case kVorbisMode:
- return makeVorbisStream(&fh->file, enc_len);
+ return Audio::makeVorbisStream(&fh->file, enc_len);
#endif
#ifdef USE_FLAC
case kFlacMode:
- return makeFlacStream(&fh->file, enc_len);
+ return Audio::makeFlacStream(&fh->file, enc_len);
#endif
default:
return NULL;
@@ -232,7 +232,7 @@
_bufferEnd = out;
}
-AudioStream *makeCLUStream(Common::File *file, int size) {
+Audio::AudioStream *makeCLUStream(Common::File *file, int size) {
return new CLUInputStream(file, size);
}
@@ -718,7 +718,7 @@
SoundFileHandle *fh = (cd == 1) ? &_speechFile[0] : &_speechFile[1];
- AudioStream *input = getAudioStream(fh, "speech", cd, speechId, &numSamples);
+ Audio::AudioStream *input = getAudioStream(fh, "speech", cd, speechId, &numSamples);
if (!input)
return 0;
@@ -762,7 +762,7 @@
int cd = _vm->_resman->getCD();
SoundFileHandle *fh = (cd == 1) ? &_speechFile[0] : &_speechFile[1];
- AudioStream *input = getAudioStream(fh, "speech", cd, speechId, NULL);
+ Audio::AudioStream *input = getAudioStream(fh, "speech", cd, speechId, NULL);
if (!input)
return RDERR_INVALIDID;
Modified: scummvm/trunk/engines/sword2/sound.cpp
===================================================================
--- scummvm/trunk/engines/sword2/sound.cpp 2006-04-29 17:50:15 UTC (rev 22230)
+++ scummvm/trunk/engines/sword2/sound.cpp 2006-04-29 22:33:31 UTC (rev 22231)
@@ -265,7 +265,7 @@
int rate, size;
byte flags;
- if (!loadWAVFromStream(stream, size, rate, flags)) {
+ if (!Audio::loadWAVFromStream(stream, size, rate, flags)) {
warning("playFX: Not a valid WAV file");
return RDERR_INVALIDWAV;
}
Modified: scummvm/trunk/engines/sword2/sound.h
===================================================================
--- scummvm/trunk/engines/sword2/sound.h 2006-04-29 17:50:15 UTC (rev 22230)
+++ scummvm/trunk/engines/sword2/sound.h 2006-04-29 22:33:31 UTC (rev 22231)
@@ -79,7 +79,7 @@
RDSE_SPEAKING = 0
};
-class CLUInputStream : public AudioStream {
+class CLUInputStream : public Audio::AudioStream {
private:
Common::File *_file;
bool _firstTime;
@@ -118,12 +118,12 @@
volatile bool inUse;
};
-class MusicInputStream : public AudioStream {
+class MusicInputStream : public Audio::AudioStream {
private:
int _cd;
SoundFileHandle *_fh;
uint32 _musicId;
- AudioStream *_decoder;
+ Audio::AudioStream *_decoder;
int16 _buffer[BUFFER_SIZE];
const int16 *_bufferEnd;
const int16 *_pos;
@@ -165,7 +165,7 @@
int32 getTimeRemaining();
};
-class Sound : public AudioStream {
+class Sound : public Audio::AudioStream {
private:
Sword2Engine *_vm;
Modified: scummvm/trunk/graphics/animation.cpp
===================================================================
--- scummvm/trunk/graphics/animation.cpp 2006-04-29 17:50:15 UTC (rev 22230)
+++ scummvm/trunk/graphics/animation.cpp 2006-04-29 22:33:31 UTC (rev 22231)
@@ -155,8 +155,8 @@
#endif
}
-AudioStream *BaseAnimationState::createAudioStream(const char *name, void *arg) {
- return AudioStream::openStreamFile(name);
+Audio::AudioStream *BaseAnimationState::createAudioStream(const char *name, void *arg) {
+ return Audio::AudioStream::openStreamFile(name);
}
bool BaseAnimationState::decodeFrame() {
Modified: scummvm/trunk/graphics/animation.h
===================================================================
--- scummvm/trunk/graphics/animation.h 2006-04-29 17:50:15 UTC (rev 22230)
+++ scummvm/trunk/graphics/animation.h 2006-04-29 22:33:31 UTC (rev 22231)
@@ -26,7 +26,9 @@
#include "common/scummsys.h"
#include "sound/mixer.h"
-class AudioStream;
+namespace Audio {
+ class AudioStream;
+}
// Uncomment this if you are using libmpeg2 0.3.1.
// #define USE_MPEG2_0_3_1
@@ -91,7 +93,7 @@
Common::File *_mpegFile;
Audio::SoundHandle _bgSound;
- AudioStream *_bgSoundStream;
+ Audio::AudioStream *_bgSoundStream;
#ifdef BACKEND_8BIT
int _palNum;
@@ -132,7 +134,7 @@
protected:
bool checkPaletteSwitch();
virtual void drawYUV(int width, int height, byte *const *dat) = 0;
- virtual AudioStream *createAudioStream(const char *name, void *arg);
+ virtual Audio::AudioStream *createAudioStream(const char *name, void *arg);
#ifdef BACKEND_8BIT
void buildLookup(int p, int lines);
Modified: scummvm/trunk/sound/adpcm.cpp
===================================================================
--- scummvm/trunk/sound/adpcm.cpp 2006-04-29 17:50:15 UTC (rev 22230)
+++ scummvm/trunk/sound/adpcm.cpp 2006-04-29 22:33:31 UTC (rev 22231)
@@ -28,6 +28,8 @@
#include "sound/audiostream.h"
+namespace Audio {
+
// TODO: Switch from a SeekableReadStream to a plain ReadStream. This requires
// some internal refactoring but is definitely possible and will increase the
// flexibility of this code.
@@ -353,3 +355,5 @@
AudioStream *makeADPCMStream(Common::SeekableReadStream *stream, uint32 size, typesADPCM type, int rate, int channels, uint32 blockAlign) {
return new ADPCMInputStream(stream, size, type, rate, channels, blockAlign);
}
+
+} // End of namespace Audio
Modified: scummvm/trunk/sound/adpcm.h
===================================================================
--- scummvm/trunk/sound/adpcm.h 2006-04-29 17:50:15 UTC (rev 22230)
+++ scummvm/trunk/sound/adpcm.h 2006-04-29 22:33:31 UTC (rev 22231)
@@ -27,6 +27,9 @@
#include "common/scummsys.h"
#include "common/stream.h"
+
+namespace Audio {
+
class AudioStream;
enum typesADPCM {
@@ -37,5 +40,6 @@
AudioStream *makeADPCMStream(Common::SeekableReadStream *stream, uint32 size, typesADPCM type, int rate = 22050, int channels = 2, uint32 blockAlign = 0);
+} // End of namespace Audio
#endif
Modified: scummvm/trunk/sound/audiocd.cpp
===================================================================
--- scummvm/trunk/sound/audiocd.cpp 2006-04-29 17:50:15 UTC (rev 22230)
+++ scummvm/trunk/sound/audiocd.cpp 2006-04-29 22:33:31 UTC (rev 22231)
@@ -31,6 +31,8 @@
#include "common/util.h"
#include "common/system.h"
+namespace Audio {
+
struct TrackFormat {
/** Decodername */
const char* decoderName;
@@ -165,3 +167,5 @@
debug(2, "Track %d not available in compressed format", track);
return -1;
}
+
+} // End of namespace Audio
Modified: scummvm/trunk/sound/audiocd.h
===================================================================
--- scummvm/trunk/sound/audiocd.h 2006-04-29 17:50:15 UTC (rev 22230)
+++ scummvm/trunk/sound/audiocd.h 2006-04-29 22:33:31 UTC (rev 22231)
@@ -28,6 +28,9 @@
#include "common/singleton.h"
#include "sound/mixer.h"
+
+namespace Audio {
+
class DigitalTrackInfo {
public:
virtual bool error() = 0;
@@ -82,6 +85,8 @@
};
/** Shortcut for accessing the audio CD manager. */
-#define AudioCD AudioCDManager::instance()
+#define AudioCD Audio::AudioCDManager::instance()
+} // End of namespace Audio
+
#endif
Modified: scummvm/trunk/sound/audiostream.cpp
===================================================================
--- scummvm/trunk/sound/audiostream.cpp 2006-04-29 17:50:15 UTC (rev 22230)
+++ scummvm/trunk/sound/audiostream.cpp 2006-04-29 22:33:31 UTC (rev 22231)
@@ -31,6 +31,9 @@
#include "sound/vorbis.h"
#include "sound/flac.h"
+
+namespace Audio {
+
struct StreamFileFormat {
/** Decodername */
const char* decoderName;
@@ -209,3 +212,6 @@
}
}
}
+
+
+} // End of namespace Audio
Modified: scummvm/trunk/sound/audiostream.h
===================================================================
--- scummvm/trunk/sound/audiostream.h 2006-04-29 17:50:15 UTC (rev 22230)
+++ scummvm/trunk/sound/audiostream.h 2006-04-29 22:33:31 UTC (rev 22231)
@@ -28,6 +28,8 @@
#include "common/scummsys.h"
+namespace Audio {
+
/**
* Generic input stream for the resampling code.
*/
@@ -116,11 +118,10 @@
// us to go with the macro approach. So far this is
// the only template function that MSVC6 seemed to
// compile incorrectly. Knock on wood.
-#define READSAMPLE(is16Bit, isUnsigned, ptr) \
- ((is16Bit ? READ_BE_UINT16(ptr) : (*ptr << 8)) ^ (isUnsigned ? 0x8000 : 0))
-
#define READ_ENDIAN_SAMPLE(is16Bit, isUnsigned, ptr, isLE) \
((is16Bit ? (isLE ? READ_LE_UINT16(ptr) : READ_BE_UINT16(ptr)) : (*ptr << 8)) ^ (isUnsigned ? 0x8000 : 0))
+} // End of namespace Audio
+
#endif
Modified: scummvm/trunk/sound/flac.cpp
===================================================================
--- scummvm/trunk/sound/flac.cpp 2006-04-29 17:50:15 UTC (rev 22230)
+++ scummvm/trunk/sound/flac.cpp 2006-04-29 22:33:31 UTC (rev 22231)
@@ -37,6 +37,8 @@
using Common::File;
+namespace Audio {
+
#pragma mark -
#pragma mark --- Flac stream ---
#pragma mark -
@@ -849,4 +851,6 @@
}
+} // End of namespace Audio
+
#endif // #ifdef USE_FLAC
Modified: scummvm/trunk/sound/flac.h
===================================================================
--- scummvm/trunk/sound/flac.h 2006-04-29 17:50:15 UTC (rev 22230)
+++ scummvm/trunk/sound/flac.h 2006-04-29 22:33:31 UTC (rev 22231)
@@ -28,12 +28,15 @@
#ifdef USE_FLAC
-class AudioStream;
-class DigitalTrackInfo;
namespace Common {
class File;
}
+namespace Audio {
+
+class AudioStream;
+class DigitalTrackInfo;
+
DigitalTrackInfo *getFlacTrack(int track);
/**
@@ -44,5 +47,7 @@
*/
AudioStream *makeFlacStream(Common::File *file, uint32 size);
+} // End of namespace Audio
+
#endif // #ifdef USE_FLAC
#endif // #ifndef SOUND_FLAC_H
Modified: scummvm/trunk/sound/mixer.h
===================================================================
--- scummvm/trunk/sound/mixer.h 2006-04-29 17:50:15 UTC (rev 22230)
+++ scummvm/trunk/sound/mixer.h 2006-04-29 22:33:31 UTC (rev 22231)
@@ -29,12 +29,12 @@
#include "common/mutex.h"
-class AudioStream;
class OSystem;
namespace Audio {
+class AudioStream;
class Channel;
class Mixer;
Modified: scummvm/trunk/sound/mp3.cpp
===================================================================
--- scummvm/trunk/sound/mp3.cpp 2006-04-29 17:50:15 UTC (rev 22230)
+++ scummvm/trunk/sound/mp3.cpp 2006-04-29 22:33:31 UTC (rev 22231)
@@ -36,6 +36,8 @@
using Common::File;
+namespace Audio {
+
#pragma mark -
#pragma mark --- MP3 (MAD) stream ---
#pragma mark -
@@ -487,4 +489,6 @@
}
-#endif
+} // End of namespace Audio
+
+#endif // #ifdef USE_MAD
Modified: scummvm/trunk/sound/mp3.h
===================================================================
--- scummvm/trunk/sound/mp3.h 2006-04-29 17:50:15 UTC (rev 22230)
+++ scummvm/trunk/sound/mp3.h 2006-04-29 22:33:31 UTC (rev 22231)
@@ -28,12 +28,15 @@
#ifdef USE_MAD
-class AudioStream;
-class DigitalTrackInfo;
namespace Common {
class File;
}
+namespace Audio {
+
+class AudioStream;
+class DigitalTrackInfo;
+
DigitalTrackInfo *getMP3Track(int track);
/**
@@ -44,6 +47,7 @@
*/
AudioStream *makeMP3Stream(Common::File *file, uint32 size);
-#endif
+} // End of namespace Audio
-#endif
+#endif // #ifdef USE_MAD
+#endif // #ifndef SOUND_MP3_H
Modified: scummvm/trunk/sound/softsynth/emumidi.h
===================================================================
--- scummvm/trunk/sound/softsynth/emumidi.h 2006-04-29 17:50:15 UTC (rev 22230)
+++ scummvm/trunk/sound/softsynth/emumidi.h 2006-04-29 22:33:31 UTC (rev 22231)
@@ -26,7 +26,7 @@
#define FIXP_SHIFT 16
-class MidiDriver_Emulated : public AudioStream, public MidiDriver {
+class MidiDriver_Emulated : public Audio::AudioStream, public MidiDriver {
protected:
bool _isOpen;
Audio::Mixer *_mixer;
Modified: scummvm/trunk/sound/voc.cpp
===================================================================
--- scummvm/trunk/sound/voc.cpp 2006-04-29 17:50:15 UTC (rev 22230)
+++ scummvm/trunk/sound/voc.cpp 2006-04-29 22:33:31 UTC (rev 22231)
@@ -31,6 +31,8 @@
#include "sound/voc.h"
+namespace Audio {
+
int getSampleRateFromVOCRate(int vocSR) {
if (vocSR == 0xa5 || vocSR == 0xa6) {
return 11025;
@@ -140,3 +142,5 @@
return makeLinearInputStream(rate, Audio::Mixer::FLAG_AUTOFREE | Audio::Mixer::FLAG_UNSIGNED, data, size, 0, 0);
}
+
+} // End of namespace Audio
Modified: scummvm/trunk/sound/voc.h
===================================================================
--- scummvm/trunk/sound/voc.h 2006-04-29 17:50:15 UTC (rev 22230)
+++ scummvm/trunk/sound/voc.h 2006-04-29 22:33:31 UTC (rev 22231)
@@ -27,9 +27,13 @@
#include "common/stdafx.h"
#include "common/scummsys.h"
-class AudioStream;
namespace Common { class ReadStream; }
+namespace Audio {
+
+class AudioStream;
+
+
#if !defined(__GNUC__)
#pragma START_PACK_STRUCTS
#endif
@@ -81,4 +85,6 @@
*/
AudioStream *makeVOCStream(Common::ReadStream &stream);
+} // End of namespace Audio
+
#endif
Modified: scummvm/trunk/sound/vorbis.cpp
===================================================================
--- scummvm/trunk/sound/vorbis.cpp 2006-04-29 17:50:15 UTC (rev 22230)
+++ scummvm/trunk/sound/vorbis.cpp 2006-04-29 22:33:31 UTC (rev 22231)
@@ -44,6 +44,8 @@
using Common::File;
+namespace Audio {
+
static AudioStream *makeVorbisStream(OggVorbis_File *file, int duration);
#pragma mark -
@@ -134,7 +136,7 @@
f->curr_pos = f->file->pos() - f->start;
#ifdef __SYMBIAN32__
- // For symbian we now store the last read position and then close the file
+ // For symbian we now store the last read position and then close the file
if (f->file) {
f->file->close();
}
@@ -208,7 +210,7 @@
#ifndef __SYMBIAN32__
_file->incRef();
#endif
- }
+ }
return err;
}
@@ -233,7 +235,7 @@
ov_time_seek(&_ov_file, (ogg_int64_t)(startFrame / 75.0 * 1000));
#endif
#else
- ov_time_seek(&_ov_file, startFrame / 75.0);
+ ov_time_seek(&_ov_file, startFrame / 75.0);
#endif
AudioStream *input = makeVorbisStream(&_ov_file, duration * ov_info(&_ov_file, -1)->rate / 75);
@@ -392,7 +394,7 @@
#else
f->file = file;
#endif
- f->start = file->pos();
+ f->start = file->pos();
f->len = size;
f->curr_pos = 0;
@@ -400,12 +402,16 @@
warning("Invalid file format");
delete ov_file;
delete f;
- return 0;
- } else {
+ return 0;
+ } else {
#ifndef __SYMBIAN32__
file->incRef();
#endif
return new VorbisInputStream(ov_file, 0, true);
- }
}
-#endif
+}
+
+
+} // End of namespace Audio
+
+#endif // #ifdef USE_VORBIS
Modified: scummvm/trunk/sound/vorbis.h
===================================================================
--- scummvm/trunk/sound/vorbis.h 2006-04-29 17:50:15 UTC (rev 22230)
+++ scummvm/trunk/sound/vorbis.h 2006-04-29 22:33:31 UTC (rev 22231)
@@ -28,12 +28,15 @@
#ifdef USE_VORBIS
-class AudioStream;
-class DigitalTrackInfo;
namespace Common {
class File;
}
+namespace Audio {
+
+class AudioStream;
+class DigitalTrackInfo;
+
DigitalTrackInfo *getVorbisTrack(int track);
/**
@@ -44,6 +47,7 @@
*/
AudioStream *makeVorbisStream(Common::File *file, uint32 size);
-#endif
+} // End of namespace Audio
-#endif
+#endif // #ifdef USE_VORBIS
+#endif // #ifndef SOUND_VORBIS_H
Modified: scummvm/trunk/sound/wave.cpp
===================================================================
--- scummvm/trunk/sound/wave.cpp 2006-04-29 17:50:15 UTC (rev 22230)
+++ scummvm/trunk/sound/wave.cpp 2006-04-29 22:33:31 UTC (rev 22231)
@@ -29,6 +29,8 @@
#include "sound/wave.h"
#include "sound/adpcm.h"
+namespace Audio {
+
bool loadWAVFromStream(Common::SeekableReadStream &stream, int &size, int &rate, byte &flags, uint16 *wavType, int *blockAlign_) {
const uint32 initialPos = stream.pos();
byte buf[4+1];
@@ -181,3 +183,5 @@
return makeLinearInputStream(rate, flags, data, size, 0, 0);
}
+
+} // End of namespace Audio
Modified: scummvm/trunk/sound/wave.h
===================================================================
--- scummvm/trunk/sound/wave.h 2006-04-29 17:50:15 UTC (rev 22230)
+++ scummvm/trunk/sound/wave.h 2006-04-29 22:33:31 UTC (rev 22231)
@@ -26,9 +26,12 @@
#include "common/stdafx.h"
#include "common/scummsys.h"
-class AudioStream;
namespace Common { class SeekableReadStream; }
+namespace Audio {
+
+class AudioStream;
+
/**
* Try to load a WAVE from the given seekable stream. Returns true if
* successful. In that case, the stream's seek position will be set to the
@@ -47,4 +50,6 @@
*/
AudioStream *makeWAVStream(Common::SeekableReadStream &stream);
+} // End of namespace Audio
+
#endif
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
More information about the Scummvm-git-logs
mailing list