changing AudioDataType -> SoundType, so now the constant names match the name of the data type / the SoundMixer method names
svn-id: r17052
This commit is contained in:
parent
13b8f678fc
commit
0ec193b4be
30 changed files with 84 additions and 84 deletions
|
@ -143,7 +143,7 @@ bool BaseAnimationState::init(const char *name, void *audioArg) {
|
|||
bgSoundStream = createAudioStream(name, audioArg);
|
||||
|
||||
if (bgSoundStream != NULL) {
|
||||
_snd->playInputStream(SoundMixer::kSFXAudioDataType, &bgSound, bgSoundStream, -1, 255, 0, false);
|
||||
_snd->playInputStream(SoundMixer::kSFXSoundType, &bgSound, bgSoundStream, -1, 255, 0, false);
|
||||
} else {
|
||||
warning("Cutscene: Could not open Audio Track for %s", name);
|
||||
}
|
||||
|
|
|
@ -106,8 +106,8 @@ KyraEngine::KyraEngine(GameDetector *detector, OSystem *syst)
|
|||
warning("Sound initialization failed.");
|
||||
}
|
||||
|
||||
_mixer->setVolumeForSoundType(SoundMixer::kSFXAudioDataType, ConfMan.getInt("sfx_volume"));
|
||||
_mixer->setVolumeForSoundType(SoundMixer::kMusicAudioDataType, ConfMan.getInt("music_volume"));
|
||||
_mixer->setVolumeForSoundType(SoundMixer::kSFXSoundType, ConfMan.getInt("sfx_volume"));
|
||||
_mixer->setVolumeForSoundType(SoundMixer::kMusicSoundType, ConfMan.getInt("music_volume"));
|
||||
|
||||
// gets the game
|
||||
if (detector->_game.features & GF_KYRA1) {
|
||||
|
|
|
@ -405,9 +405,9 @@ int QueenEngine::init(GameDetector &detector) {
|
|||
|
||||
if (!_mixer->isReady())
|
||||
warning("Sound initialisation failed");
|
||||
_mixer->setVolumeForSoundType(SoundMixer::kSFXAudioDataType, ConfMan.getInt("sfx_volume"));
|
||||
_mixer->setVolumeForSoundType(SoundMixer::kSFXSoundType, ConfMan.getInt("sfx_volume"));
|
||||
// Set mixer music volume to maximum, since music volume is regulated by MusicPlayer's MIDI messages
|
||||
_mixer->setVolumeForSoundType(SoundMixer::kMusicAudioDataType, SoundMixer::kMaxMixerVolume);
|
||||
_mixer->setVolumeForSoundType(SoundMixer::kMusicSoundType, SoundMixer::kMaxMixerVolume);
|
||||
|
||||
int midiDriver = MidiDriver::detectMusicDriver(MDT_NATIVE | MDT_ADLIB | MDT_PREFER_NATIVE);
|
||||
MidiDriver *driver = MidiDriver::createMidi(midiDriver);
|
||||
|
|
|
@ -201,7 +201,7 @@ void SBSound::sfxPlay(const char *name, bool isSpeech) {
|
|||
void MP3Sound::sfxPlay(const char *name, bool isSpeech) {
|
||||
uint32 size;
|
||||
File *f = _vm->resource()->giveCompressedSound(name, &size);
|
||||
_mixer->playInputStream(SoundMixer::kSFXAudioDataType, isSpeech ? &_speechHandle : &_sfxHandle, makeMP3Stream(f, size));
|
||||
_mixer->playInputStream(SoundMixer::kSFXSoundType, isSpeech ? &_speechHandle : &_sfxHandle, makeMP3Stream(f, size));
|
||||
}
|
||||
#endif
|
||||
|
||||
|
@ -209,7 +209,7 @@ void MP3Sound::sfxPlay(const char *name, bool isSpeech) {
|
|||
void OGGSound::sfxPlay(const char *name, bool isSpeech) {
|
||||
uint32 size;
|
||||
File *f = _vm->resource()->giveCompressedSound(name, &size);
|
||||
_mixer->playInputStream(SoundMixer::kSFXAudioDataType, isSpeech ? &_speechHandle : &_sfxHandle, makeVorbisStream(f, size));
|
||||
_mixer->playInputStream(SoundMixer::kSFXSoundType, isSpeech ? &_speechHandle : &_sfxHandle, makeVorbisStream(f, size));
|
||||
}
|
||||
#endif
|
||||
|
||||
|
@ -217,7 +217,7 @@ void OGGSound::sfxPlay(const char *name, bool isSpeech) {
|
|||
void FLACSound::sfxPlay(const char *name, bool isSpeech) {
|
||||
uint32 size;
|
||||
File *f = _vm->resource()->giveCompressedSound(name, &size);
|
||||
_mixer->playInputStream(SoundMixer::kSFXAudioDataType, isSpeech ? &_speechHandle : &_sfxHandle, makeFlacStream(f, size));
|
||||
_mixer->playInputStream(SoundMixer::kSFXSoundType, isSpeech ? &_speechHandle : &_sfxHandle, makeFlacStream(f, size));
|
||||
}
|
||||
#endif
|
||||
|
||||
|
|
|
@ -295,7 +295,7 @@ void MusicPlayer::stopMusic() {
|
|||
Music::Music(SoundMixer *mixer, MidiDriver *driver, int enabled) : _mixer(mixer), _enabled(enabled), _adlib(false) {
|
||||
_player = new MusicPlayer(driver);
|
||||
_musicInitialized = 1;
|
||||
_mixer->setVolumeForSoundType(SoundMixer::kMusicAudioDataType, ConfMan.getInt("music_volume"));
|
||||
_mixer->setVolumeForSoundType(SoundMixer::kMusicSoundType, ConfMan.getInt("music_volume"));
|
||||
|
||||
if (_vm->getGameType() == GType_ITE) {
|
||||
File file;
|
||||
|
@ -448,7 +448,7 @@ int Music::play(uint32 music_rn, uint16 flags) {
|
|||
|
||||
if (audioStream) {
|
||||
debug(0, "Playing digitized music");
|
||||
_mixer->playInputStream(SoundMixer::kMusicAudioDataType, &_musicHandle, audioStream);
|
||||
_mixer->playInputStream(SoundMixer::kMusicSoundType, &_musicHandle, audioStream);
|
||||
return SUCCESS;
|
||||
}
|
||||
|
||||
|
|
|
@ -138,8 +138,8 @@ SagaEngine::SagaEngine(GameDetector *detector, OSystem *syst)
|
|||
warning("Sound initialization failed.");
|
||||
}
|
||||
|
||||
_mixer->setVolumeForSoundType(SoundMixer::kSFXAudioDataType, ConfMan.getInt("sfx_volume"));
|
||||
_mixer->setVolumeForSoundType(SoundMixer::kMusicAudioDataType, ConfMan.getInt("music_volume"));
|
||||
_mixer->setVolumeForSoundType(SoundMixer::kSFXSoundType, ConfMan.getInt("sfx_volume"));
|
||||
_mixer->setVolumeForSoundType(SoundMixer::kMusicSoundType, ConfMan.getInt("music_volume"));
|
||||
|
||||
_vm = this;
|
||||
}
|
||||
|
|
|
@ -221,7 +221,7 @@ int Sound::playVoxVoice(SOUNDBUFFER *buf) {
|
|||
AudioStream *audioStream;
|
||||
|
||||
audioStream = makeVOXStream(buf->s_buf, buf->s_buf_len);
|
||||
_mixer->playInputStream(SoundMixer::kSFXAudioDataType, &_voiceHandle, audioStream);
|
||||
_mixer->playInputStream(SoundMixer::kSFXSoundType, &_voiceHandle, audioStream);
|
||||
|
||||
return SUCCESS;
|
||||
}
|
||||
|
|
|
@ -187,14 +187,14 @@ void IMuseDigital::saveOrLoad(Serializer *ser) {
|
|||
|
||||
const int pan = (track->pan != 64) ? 2 * track->pan - 127 : 0;
|
||||
const int vol = track->vol / 1000;
|
||||
SoundMixer::SoundType type = SoundMixer::kPlainAudioDataType;
|
||||
SoundMixer::SoundType type = SoundMixer::kPlainSoundType;
|
||||
|
||||
if (track->volGroupId == 1)
|
||||
type = SoundMixer::kSpeechAudioDataType;
|
||||
type = SoundMixer::kSpeechSoundType;
|
||||
if (track->volGroupId == 2)
|
||||
type = SoundMixer::kSFXAudioDataType;
|
||||
type = SoundMixer::kSFXSoundType;
|
||||
if (track->volGroupId == 3)
|
||||
type = SoundMixer::kMusicAudioDataType;
|
||||
type = SoundMixer::kMusicSoundType;
|
||||
|
||||
_vm->_mixer->playInputStream(type, &track->handle, track->stream, -1, vol, pan, false);
|
||||
}
|
||||
|
@ -241,14 +241,14 @@ void IMuseDigital::callback() {
|
|||
|
||||
const int pan = (track->pan != 64) ? 2 * track->pan - 127 : 0;
|
||||
const int vol = track->vol / 1000;
|
||||
SoundMixer::SoundType type = SoundMixer::kPlainAudioDataType;
|
||||
SoundMixer::SoundType type = SoundMixer::kPlainSoundType;
|
||||
|
||||
if (track->volGroupId == 1)
|
||||
type = SoundMixer::kSpeechAudioDataType;
|
||||
type = SoundMixer::kSpeechSoundType;
|
||||
if (track->volGroupId == 2)
|
||||
type = SoundMixer::kSFXAudioDataType;
|
||||
type = SoundMixer::kSFXSoundType;
|
||||
if (track->volGroupId == 3)
|
||||
type = SoundMixer::kMusicAudioDataType;
|
||||
type = SoundMixer::kMusicSoundType;
|
||||
|
||||
if (track->stream) {
|
||||
byte *data = NULL;
|
||||
|
|
|
@ -163,14 +163,14 @@ void IMuseDigital::startSound(int soundId, const char *soundName, int soundType,
|
|||
} else {
|
||||
const int pan = (track->pan != 64) ? 2 * track->pan - 127 : 0;
|
||||
const int vol = track->vol / 1000;
|
||||
SoundMixer::SoundType type = SoundMixer::kPlainAudioDataType;
|
||||
SoundMixer::SoundType type = SoundMixer::kPlainSoundType;
|
||||
|
||||
if (track->volGroupId == 1)
|
||||
type = SoundMixer::kSpeechAudioDataType;
|
||||
type = SoundMixer::kSpeechSoundType;
|
||||
if (track->volGroupId == 2)
|
||||
type = SoundMixer::kSFXAudioDataType;
|
||||
type = SoundMixer::kSFXSoundType;
|
||||
if (track->volGroupId == 3)
|
||||
type = SoundMixer::kMusicAudioDataType;
|
||||
type = SoundMixer::kMusicSoundType;
|
||||
|
||||
// setup 1 second stream wrapped buffer
|
||||
int32 streamBufferSize = track->iteration;
|
||||
|
@ -303,14 +303,14 @@ IMuseDigital::Track *IMuseDigital::cloneToFadeOutTrack(Track *track, int fadeDel
|
|||
fadeTrack->volFadeStep = (fadeTrack->volFadeDest - fadeTrack->vol) * 60 * (1000 / _callbackFps) / (1000 * fadeDelay);
|
||||
fadeTrack->volFadeUsed = true;
|
||||
|
||||
SoundMixer::SoundType type = SoundMixer::kPlainAudioDataType;
|
||||
SoundMixer::SoundType type = SoundMixer::kPlainSoundType;
|
||||
|
||||
if (fadeTrack->volGroupId == 1)
|
||||
type = SoundMixer::kSpeechAudioDataType;
|
||||
type = SoundMixer::kSpeechSoundType;
|
||||
if (fadeTrack->volGroupId == 2)
|
||||
type = SoundMixer::kSFXAudioDataType;
|
||||
type = SoundMixer::kSFXSoundType;
|
||||
if (fadeTrack->volGroupId == 3)
|
||||
type = SoundMixer::kMusicAudioDataType;
|
||||
type = SoundMixer::kMusicSoundType;
|
||||
|
||||
// setup 1 second stream wrapped buffer
|
||||
int32 streamBufferSize = fadeTrack->iteration;
|
||||
|
|
|
@ -1384,13 +1384,13 @@ void ScummEngine_v8::o8_kernelGetFunctions() {
|
|||
}
|
||||
break;
|
||||
case 0xDD: // getGroupSfxVol
|
||||
push(_mixer->getVolumeForSoundType(SoundMixer::kSFXAudioDataType) / 2);
|
||||
push(_mixer->getVolumeForSoundType(SoundMixer::kSFXSoundType) / 2);
|
||||
break;
|
||||
case 0xDE: // getGroupVoiceVol
|
||||
push(_mixer->getVolumeForSoundType(SoundMixer::kSpeechAudioDataType) / 2);
|
||||
push(_mixer->getVolumeForSoundType(SoundMixer::kSpeechSoundType) / 2);
|
||||
break;
|
||||
case 0xDF: // getGroupMusicVol
|
||||
push(_mixer->getVolumeForSoundType(SoundMixer::kMusicAudioDataType) / 2);
|
||||
push(_mixer->getVolumeForSoundType(SoundMixer::kMusicSoundType) / 2);
|
||||
break;
|
||||
case 0xE0: // readRegistryValue
|
||||
{
|
||||
|
|
|
@ -1595,9 +1595,9 @@ void ScummEngine::setupVolumes() {
|
|||
_musicEngine->setMusicVolume(soundVolumeMusic);
|
||||
}
|
||||
|
||||
_mixer->setVolumeForSoundType(SoundMixer::kSFXAudioDataType, soundVolumeSfx);
|
||||
_mixer->setVolumeForSoundType(SoundMixer::kMusicAudioDataType, soundVolumeMusic);
|
||||
_mixer->setVolumeForSoundType(SoundMixer::kSpeechAudioDataType, soundVolumeSpeech);
|
||||
_mixer->setVolumeForSoundType(SoundMixer::kSFXSoundType, soundVolumeSfx);
|
||||
_mixer->setVolumeForSoundType(SoundMixer::kMusicSoundType, soundVolumeMusic);
|
||||
_mixer->setVolumeForSoundType(SoundMixer::kSpeechSoundType, soundVolumeSpeech);
|
||||
}
|
||||
|
||||
|
||||
|
|
|
@ -122,7 +122,7 @@ bool SmushMixer::handleFrame() {
|
|||
if (_mixer->isReady()) {
|
||||
if (!_channels[i].handle.isActive()) {
|
||||
_channels[i].stream = makeAppendableAudioStream(rate, flags, 500000);
|
||||
_mixer->playInputStream(SoundMixer::kSFXAudioDataType, &_channels[i].handle, _channels[i].stream);
|
||||
_mixer->playInputStream(SoundMixer::kSFXSoundType, &_channels[i].handle, _channels[i].stream);
|
||||
}
|
||||
_mixer->setChannelVolume(_channels[i].handle, vol);
|
||||
_mixer->setChannelBalance(_channels[i].handle, pan);
|
||||
|
|
|
@ -509,7 +509,7 @@ void SmushPlayer::handleIACT(Chunk &b) {
|
|||
|
||||
if (!_IACTchannel.isActive()) {
|
||||
_IACTstream = makeAppendableAudioStream(22050, SoundMixer::FLAG_STEREO | SoundMixer::FLAG_16BITS, 400000);
|
||||
_vm->_mixer->playInputStream(SoundMixer::kSFXAudioDataType, &_IACTchannel, _IACTstream);
|
||||
_vm->_mixer->playInputStream(SoundMixer::kSFXSoundType, &_IACTchannel, _IACTstream);
|
||||
}
|
||||
_IACTstream->append(output_data, 0x1000);
|
||||
|
||||
|
@ -1192,7 +1192,7 @@ void SmushPlayer::tryCmpFile(const char *filename) {
|
|||
if (_compressedFile.isOpen()) {
|
||||
int size = _compressedFile.size();
|
||||
_compressedFileMode = true;
|
||||
_vm->_mixer->playInputStream(SoundMixer::kSFXAudioDataType, &_compressedFileSoundHandle, makeMP3Stream(&_compressedFile, size));
|
||||
_vm->_mixer->playInputStream(SoundMixer::kSFXSoundType, &_compressedFileSoundHandle, makeMP3Stream(&_compressedFile, size));
|
||||
return;
|
||||
}
|
||||
#endif
|
||||
|
@ -1203,7 +1203,7 @@ void SmushPlayer::tryCmpFile(const char *filename) {
|
|||
if (_compressedFile.isOpen()) {
|
||||
int size = _compressedFile.size();
|
||||
_compressedFileMode = true;
|
||||
_vm->_mixer->playInputStream(SoundMixer::kSFXAudioDataType, &_compressedFileSoundHandle, makeVorbisStream(&_compressedFile, size));
|
||||
_vm->_mixer->playInputStream(SoundMixer::kSFXSoundType, &_compressedFileSoundHandle, makeVorbisStream(&_compressedFile, size));
|
||||
return;
|
||||
}
|
||||
#endif
|
||||
|
|
|
@ -772,7 +772,7 @@ void Sound::startTalkSound(uint32 offset, uint32 b, int mode, PlayingSoundHandle
|
|||
//_vm->_imuseDigital->stopSound(kTalkSoundID);
|
||||
_vm->_imuseDigital->startVoice(kTalkSoundID, input);
|
||||
} else {
|
||||
_vm->_mixer->playInputStream(SoundMixer::kSFXAudioDataType, handle, input, id);
|
||||
_vm->_mixer->playInputStream(SoundMixer::kSFXSoundType, handle, input, id);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -1139,7 +1139,7 @@ ScummFile *Sound::openSfxFile() {
|
|||
}
|
||||
|
||||
bool Sound::isSfxFinished() const {
|
||||
return !_vm->_mixer->hasActiveChannelOfType(SoundMixer::kSFXAudioDataType);
|
||||
return !_vm->_mixer->hasActiveChannelOfType(SoundMixer::kSFXSoundType);
|
||||
}
|
||||
|
||||
// We use a real timer in an attempt to get better sync with CD tracks. This is
|
||||
|
|
|
@ -666,7 +666,7 @@ int SimonEngine::init(GameDetector &detector) {
|
|||
warning("Sound initialization failed. "
|
||||
"Features of the game that depend on sound synchronization will most likely break");
|
||||
set_volume(ConfMan.getInt("sfx_volume"));
|
||||
_mixer->setVolumeForSoundType(SoundMixer::kMusicAudioDataType, ConfMan.getInt("music_volume"));
|
||||
_mixer->setVolumeForSoundType(SoundMixer::kMusicSoundType, ConfMan.getInt("music_volume"));
|
||||
|
||||
_system->beginGFXTransaction();
|
||||
initCommonGFX(detector);
|
||||
|
@ -4226,7 +4226,7 @@ void SimonEngine::dx_unlock_attached() {
|
|||
}
|
||||
|
||||
void SimonEngine::set_volume(int volume) {
|
||||
_mixer->setVolumeForSoundType(SoundMixer::kSFXAudioDataType, volume);
|
||||
_mixer->setVolumeForSoundType(SoundMixer::kSFXSoundType, volume);
|
||||
}
|
||||
|
||||
byte SimonEngine::getByte() {
|
||||
|
|
|
@ -129,7 +129,7 @@ void WavSound::playSound(uint sound, PlayingSoundHandle *handle, byte flags) {
|
|||
error("playWav(%d): can't read WAVE header", sound);
|
||||
}
|
||||
|
||||
_mixer->playInputStream(SoundMixer::kSFXAudioDataType, handle, stream);
|
||||
_mixer->playInputStream(SoundMixer::kSFXSoundType, handle, stream);
|
||||
}
|
||||
|
||||
void VocSound::playSound(uint sound, PlayingSoundHandle *handle, byte flags) {
|
||||
|
@ -177,7 +177,7 @@ void MP3Sound::playSound(uint sound, PlayingSoundHandle *handle, byte flags)
|
|||
|
||||
uint32 size = _offsets[sound + i] - _offsets[sound];
|
||||
|
||||
_mixer->playInputStream(SoundMixer::kSFXAudioDataType, handle, makeMP3Stream(_file, size));
|
||||
_mixer->playInputStream(SoundMixer::kSFXSoundType, handle, makeMP3Stream(_file, size));
|
||||
}
|
||||
#endif
|
||||
|
||||
|
@ -201,7 +201,7 @@ void VorbisSound::playSound(uint sound, PlayingSoundHandle *handle, byte flags)
|
|||
|
||||
uint32 size = _offsets[sound + i] - _offsets[sound];
|
||||
|
||||
_mixer->playInputStream(SoundMixer::kSFXAudioDataType, handle, makeVorbisStream(_file, size));
|
||||
_mixer->playInputStream(SoundMixer::kSFXSoundType, handle, makeVorbisStream(_file, size));
|
||||
}
|
||||
#endif
|
||||
|
||||
|
@ -225,7 +225,7 @@ void FlacSound::playSound(uint sound, PlayingSoundHandle *handle, byte flags)
|
|||
|
||||
uint32 size = _offsets[sound + i] - _offsets[sound];
|
||||
|
||||
_mixer->playInputStream(SoundMixer::kSFXAudioDataType, handle, makeFlacStream(_file, size));
|
||||
_mixer->playInputStream(SoundMixer::kSFXSoundType, handle, makeFlacStream(_file, size));
|
||||
}
|
||||
#endif
|
||||
|
||||
|
|
|
@ -240,8 +240,8 @@ int SkyEngine::init(GameDetector &detector) {
|
|||
if (!_mixer->isReady())
|
||||
warning("Sound initialisation failed");
|
||||
|
||||
_mixer->setVolumeForSoundType(SoundMixer::kSFXAudioDataType, ConfMan.getInt("sfx_volume"));
|
||||
_mixer->setVolumeForSoundType(SoundMixer::kMusicAudioDataType, ConfMan.getInt("music_volume"));
|
||||
_mixer->setVolumeForSoundType(SoundMixer::kSFXSoundType, ConfMan.getInt("sfx_volume"));
|
||||
_mixer->setVolumeForSoundType(SoundMixer::kMusicSoundType, ConfMan.getInt("music_volume"));
|
||||
_floppyIntro = ConfMan.getBool("alt_intro");
|
||||
|
||||
_skyDisk = new Disk(_gameDataPath);
|
||||
|
|
|
@ -783,7 +783,7 @@ void FlacTrackInfo::play(SoundMixer *mixer, PlayingSoundHandle *handle, int star
|
|||
flac->setLastSample(0);
|
||||
|
||||
if (flac->seekAbsolute(static_cast<FLAC__uint64>(startFrame) * (info.sample_rate / 75))) {
|
||||
mixer->playInputStream(SoundMixer::kMusicAudioDataType, handle, flac);
|
||||
mixer->playInputStream(SoundMixer::kMusicSoundType, handle, flac);
|
||||
return;
|
||||
}
|
||||
// startSample is beyond the existing Samples
|
||||
|
|
|
@ -71,11 +71,11 @@ public:
|
|||
};
|
||||
|
||||
enum SoundType {
|
||||
kPlainAudioDataType = 0,
|
||||
kPlainSoundType = 0,
|
||||
|
||||
kMusicAudioDataType = 1,
|
||||
kSFXAudioDataType = 2,
|
||||
kSpeechAudioDataType = 3
|
||||
kMusicSoundType = 1,
|
||||
kSFXSoundType = 2,
|
||||
kSpeechSoundType = 3
|
||||
};
|
||||
|
||||
enum {
|
||||
|
@ -126,7 +126,7 @@ public:
|
|||
* is not limited to it. The premix stream is invoked by the mixer whenever
|
||||
* it needs to generate any data, before any other mixing takes place.
|
||||
*/
|
||||
void setupPremix(AudioStream *stream, SoundType type = kPlainAudioDataType);
|
||||
void setupPremix(AudioStream *stream, SoundType type = kPlainSoundType);
|
||||
|
||||
|
||||
|
||||
|
@ -140,7 +140,7 @@ public:
|
|||
void *sound, uint32 size, uint rate, byte flags,
|
||||
int id = -1, byte volume = 255, int8 balance = 0,
|
||||
uint32 loopStart = 0, uint32 loopEnd = 0,
|
||||
SoundType type = kSFXAudioDataType);
|
||||
SoundType type = kSFXSoundType);
|
||||
|
||||
/**
|
||||
* Start playing the given audio input stream.
|
||||
|
@ -245,7 +245,7 @@ public:
|
|||
/**
|
||||
* Check whether any channel of the given sound type is active.
|
||||
* For example, this can be used to check whether any SFX sound
|
||||
* is currently playing, by checking for type kSFXAudioDataType.
|
||||
* is currently playing, by checking for type kSFXSoundType.
|
||||
*
|
||||
* @param type the sound type to look for
|
||||
* @return true if any channels of the specified type are active.
|
||||
|
|
|
@ -380,7 +380,7 @@ void MP3TrackInfo::play(SoundMixer *mixer, PlayingSoundHandle *handle, int start
|
|||
|
||||
// Play it
|
||||
AudioStream *input = new MP3InputStream(_file, durationTime);
|
||||
mixer->playInputStream(SoundMixer::kMusicAudioDataType, handle, input);
|
||||
mixer->playInputStream(SoundMixer::kMusicSoundType, handle, input);
|
||||
}
|
||||
|
||||
MP3TrackInfo::~MP3TrackInfo() {
|
||||
|
|
|
@ -269,7 +269,7 @@ int MidiDriver_MT32::open() {
|
|||
_initialising = false;
|
||||
g_system->clearScreen();
|
||||
g_system->updateScreen();
|
||||
_mixer->playInputStream(SoundMixer::kSFXAudioDataType, &_handle, this, -1, 255, 0, false, true);
|
||||
_mixer->playInputStream(SoundMixer::kSFXSoundType, &_handle, this, -1, 255, 0, false, true);
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
|
|
@ -178,7 +178,7 @@ void VorbisTrackInfo::play(SoundMixer *mixer, PlayingSoundHandle *handle, int st
|
|||
#endif
|
||||
|
||||
AudioStream *input = makeVorbisStream(&_ov_file, duration * ov_info(&_ov_file, -1)->rate / 75);
|
||||
mixer->playInputStream(SoundMixer::kMusicAudioDataType, handle, input);
|
||||
mixer->playInputStream(SoundMixer::kMusicSoundType, handle, input);
|
||||
}
|
||||
|
||||
DigitalTrackInfo *getVorbisTrack(int track) {
|
||||
|
|
|
@ -113,7 +113,7 @@ void CreditsPlayer::play(void) {
|
|||
|
||||
// everything's initialized, time to render and show the credits.
|
||||
PlayingSoundHandle bgSound;
|
||||
_mixer->playInputStream(SoundMixer::kMusicAudioDataType, &bgSound, bgSoundStream, 0);
|
||||
_mixer->playInputStream(SoundMixer::kMusicSoundType, &bgSound, bgSoundStream, 0);
|
||||
|
||||
int relDelay = 0;
|
||||
uint16 scrollY = 0;
|
||||
|
|
|
@ -195,7 +195,7 @@ bool Sound::startSpeech(uint16 roomNo, uint16 localNo) {
|
|||
#ifdef USE_MAD
|
||||
else if (_cowMode == CowMp3) {
|
||||
_cowFile.seek(index);
|
||||
_mixer->playInputStream(SoundMixer::kSFXAudioDataType, &_speechHandle, makeMP3Stream(&_cowFile, sampleSize), SOUND_SPEECH_ID, speechVol, speechPan);
|
||||
_mixer->playInputStream(SoundMixer::kSFXSoundType, &_speechHandle, 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++)
|
||||
|
@ -206,7 +206,7 @@ bool Sound::startSpeech(uint16 roomNo, uint16 localNo) {
|
|||
#ifdef USE_VORBIS
|
||||
else if (_cowMode == CowVorbis) {
|
||||
_cowFile.seek(index);
|
||||
_mixer->playInputStream(SoundMixer::kSFXAudioDataType, &_speechHandle, makeVorbisStream(&_cowFile, sampleSize), SOUND_SPEECH_ID, speechVol, speechPan);
|
||||
_mixer->playInputStream(SoundMixer::kSFXSoundType, &_speechHandle, makeVorbisStream(&_cowFile, sampleSize), SOUND_SPEECH_ID, speechVol, speechPan);
|
||||
for (int cnt = 0; cnt < 480; cnt++)
|
||||
_waveVolume[cnt] = true;
|
||||
_waveVolPos = 0;
|
||||
|
|
|
@ -166,8 +166,8 @@ int SwordEngine::init(GameDetector &detector) {
|
|||
_resMan = new ResMan("swordres.rif");
|
||||
debug(5, "Starting object manager");
|
||||
_objectMan = new ObjectMan(_resMan);
|
||||
_mixer->setVolumeForSoundType(SoundMixer::kSFXAudioDataType, SoundMixer::kMaxMixerVolume);
|
||||
_mixer->setVolumeForSoundType(SoundMixer::kMusicAudioDataType, SoundMixer::kMaxMixerVolume);
|
||||
_mixer->setVolumeForSoundType(SoundMixer::kSFXSoundType, SoundMixer::kMaxMixerVolume);
|
||||
_mixer->setVolumeForSoundType(SoundMixer::kMusicSoundType, SoundMixer::kMaxMixerVolume);
|
||||
_mouse = new Mouse(_system, _resMan, _objectMan);
|
||||
_screen = new Screen(_system, _resMan, _objectMan);
|
||||
_music = new Music(_mixer);
|
||||
|
|
|
@ -945,9 +945,9 @@ OptionsDialog::OptionsDialog(Sword2Engine *vm) : Dialog(vm) {
|
|||
_speechSwitch->setValue(!_vm->_sound->isSpeechMute());
|
||||
_fxSwitch->setValue(!_vm->_sound->isFxMute());
|
||||
|
||||
_musicSlider->setValue(_mixer->getVolumeForSoundType(SoundMixer::kMusicAudioDataType));
|
||||
_speechSlider->setValue(_mixer->getVolumeForSoundType(SoundMixer::kSpeechAudioDataType));
|
||||
_fxSlider->setValue(_mixer->getVolumeForSoundType(SoundMixer::kSFXAudioDataType));
|
||||
_musicSlider->setValue(_mixer->getVolumeForSoundType(SoundMixer::kMusicSoundType));
|
||||
_speechSlider->setValue(_mixer->getVolumeForSoundType(SoundMixer::kSpeechSoundType));
|
||||
_fxSlider->setValue(_mixer->getVolumeForSoundType(SoundMixer::kSFXSoundType));
|
||||
|
||||
_gfxSlider->setValue(_vm->_screen->getRenderLevel());
|
||||
_gfxPreview->setState(_vm->_screen->getRenderLevel());
|
||||
|
@ -997,7 +997,7 @@ void OptionsDialog::onAction(Widget *widget, int result) {
|
|||
if (widget == _musicSwitch) {
|
||||
_vm->_sound->muteMusic(result != 0);
|
||||
} else if (widget == _musicSlider) {
|
||||
_vm->_mixer->setVolumeForSoundType(SoundMixer::kMusicAudioDataType, result);
|
||||
_vm->_mixer->setVolumeForSoundType(SoundMixer::kMusicSoundType, result);
|
||||
_vm->_sound->muteMusic(result == 0);
|
||||
_musicSwitch->setValue(result != 0);
|
||||
} else if (widget == _speechSlider) {
|
||||
|
@ -1015,9 +1015,9 @@ void OptionsDialog::onAction(Widget *widget, int result) {
|
|||
_vm->_sound->muteSpeech(!_speechSwitch->getValue());
|
||||
_vm->_sound->muteFx(!_fxSwitch->getValue());
|
||||
_vm->_sound->setReverseStereo(_reverseStereoSwitch->getValue());
|
||||
_mixer->setVolumeForSoundType(SoundMixer::kMusicAudioDataType, _musicSlider->getValue());
|
||||
_mixer->setVolumeForSoundType(SoundMixer::kSpeechAudioDataType, _speechSlider->getValue());
|
||||
_mixer->setVolumeForSoundType(SoundMixer::kSFXAudioDataType, _fxSlider->getValue());
|
||||
_mixer->setVolumeForSoundType(SoundMixer::kMusicSoundType, _musicSlider->getValue());
|
||||
_mixer->setVolumeForSoundType(SoundMixer::kSpeechSoundType, _speechSlider->getValue());
|
||||
_mixer->setVolumeForSoundType(SoundMixer::kSFXSoundType, _fxSlider->getValue());
|
||||
_vm->_screen->setRenderLevel(_gfxSlider->getValue());
|
||||
|
||||
_vm->writeSettings();
|
||||
|
|
|
@ -182,7 +182,7 @@ int32 MoviePlayer::play(const char *filename, MovieTextObject *text[], int32 lea
|
|||
|
||||
leadIn += sizeof(StandardHeader);
|
||||
|
||||
_vm->_sound->playFx(&leadInHandle, leadIn, leadInLen, SoundMixer::kMaxChannelVolume, 0, false, SoundMixer::kMusicAudioDataType);
|
||||
_vm->_sound->playFx(&leadInHandle, leadIn, leadInLen, SoundMixer::kMaxChannelVolume, 0, false, SoundMixer::kMusicSoundType);
|
||||
}
|
||||
|
||||
byte *leadOut = NULL;
|
||||
|
@ -301,7 +301,7 @@ void MoviePlayer::playMPEG(const char *filename, MovieTextObject *text[], byte *
|
|||
frameCounter++;
|
||||
|
||||
if (frameCounter == leadOutFrame && leadOut)
|
||||
_vm->_sound->playFx(&_leadOutHandle, leadOut, leadOutLen, SoundMixer::kMaxChannelVolume, 0, false, SoundMixer::kMusicAudioDataType);
|
||||
_vm->_sound->playFx(&_leadOutHandle, leadOut, leadOutLen, SoundMixer::kMaxChannelVolume, 0, false, SoundMixer::kMusicSoundType);
|
||||
|
||||
OSystem::Event event;
|
||||
while (_sys->pollEvent(event)) {
|
||||
|
@ -516,7 +516,7 @@ void MoviePlayer::playDummy(const char *filename, MovieTextObject *text[], byte
|
|||
// subtitles.
|
||||
|
||||
if (!skipCutscene && leadOut)
|
||||
_vm->_sound->playFx(&_leadOutHandle, leadOut, leadOutLen, SoundMixer::kMaxChannelVolume, 0, false, SoundMixer::kMusicAudioDataType);
|
||||
_vm->_sound->playFx(&_leadOutHandle, leadOut, leadOutLen, SoundMixer::kMaxChannelVolume, 0, false, SoundMixer::kMusicSoundType);
|
||||
|
||||
_vm->_screen->setPalette(0, 256, oldPal, RDPAL_INSTANT);
|
||||
}
|
||||
|
|
|
@ -771,7 +771,7 @@ int32 Sound::playCompSpeech(uint32 speechId, uint8 vol, int8 pan) {
|
|||
p = -p;
|
||||
|
||||
// Start the speech playing
|
||||
_vm->_mixer->playInputStream(SoundMixer::kSpeechAudioDataType, &_soundHandleSpeech, input, -1, volume, p);
|
||||
_vm->_mixer->playInputStream(SoundMixer::kSpeechSoundType, &_soundHandleSpeech, input, -1, volume, p);
|
||||
return RD_OK;
|
||||
}
|
||||
|
||||
|
|
|
@ -81,7 +81,7 @@ Sound::Sound(Sword2Engine *vm) {
|
|||
_mixBuffer = NULL;
|
||||
_mixBufferLen = 0;
|
||||
|
||||
_vm->_mixer->setupPremix(this, SoundMixer::kMusicAudioDataType);
|
||||
_vm->_mixer->setupPremix(this, SoundMixer::kMusicSoundType);
|
||||
}
|
||||
|
||||
Sound::~Sound() {
|
||||
|
@ -247,7 +247,7 @@ void Sound::queueFx(int32 res, int32 type, int32 delay, int32 volume, int32 pan)
|
|||
}
|
||||
|
||||
int32 Sound::playFx(FxQueueEntry *fx) {
|
||||
return playFx(&fx->handle, fx->data, fx->len, fx->volume, fx->pan, (fx->type == FX_LOOP), SoundMixer::kSFXAudioDataType);
|
||||
return playFx(&fx->handle, fx->data, fx->len, fx->volume, fx->pan, (fx->type == FX_LOOP), SoundMixer::kSFXSoundType);
|
||||
}
|
||||
|
||||
int32 Sound::playFx(PlayingSoundHandle *handle, byte *data, uint32 len, uint8 vol, int8 pan, bool loop, SoundMixer::SoundType soundType) {
|
||||
|
|
|
@ -188,9 +188,9 @@ void Sword2Engine::registerDefaultSettings() {
|
|||
}
|
||||
|
||||
void Sword2Engine::readSettings() {
|
||||
_mixer->setVolumeForSoundType(SoundMixer::kMusicAudioDataType, ConfMan.getInt("music_volume"));
|
||||
_mixer->setVolumeForSoundType(SoundMixer::kSpeechAudioDataType, ConfMan.getInt("speech_volume"));
|
||||
_mixer->setVolumeForSoundType(SoundMixer::kSFXAudioDataType, ConfMan.getInt("sfx_volume"));
|
||||
_mixer->setVolumeForSoundType(SoundMixer::kMusicSoundType, ConfMan.getInt("music_volume"));
|
||||
_mixer->setVolumeForSoundType(SoundMixer::kSpeechSoundType, ConfMan.getInt("speech_volume"));
|
||||
_mixer->setVolumeForSoundType(SoundMixer::kSFXSoundType, ConfMan.getInt("sfx_volume"));
|
||||
setSubtitles(ConfMan.getBool("subtitles"));
|
||||
_sound->muteMusic(ConfMan.getBool("music_mute"));
|
||||
_sound->muteSpeech(ConfMan.getBool("speech_mute"));
|
||||
|
@ -201,9 +201,9 @@ void Sword2Engine::readSettings() {
|
|||
}
|
||||
|
||||
void Sword2Engine::writeSettings() {
|
||||
ConfMan.set("music_volume", _mixer->getVolumeForSoundType(SoundMixer::kMusicAudioDataType));
|
||||
ConfMan.set("speech_volume", _mixer->getVolumeForSoundType(SoundMixer::kSpeechAudioDataType));
|
||||
ConfMan.set("sfx_volume", _mixer->getVolumeForSoundType(SoundMixer::kSFXAudioDataType));
|
||||
ConfMan.set("music_volume", _mixer->getVolumeForSoundType(SoundMixer::kMusicSoundType));
|
||||
ConfMan.set("speech_volume", _mixer->getVolumeForSoundType(SoundMixer::kSpeechSoundType));
|
||||
ConfMan.set("sfx_volume", _mixer->getVolumeForSoundType(SoundMixer::kSFXSoundType));
|
||||
ConfMan.set("music_mute", _sound->isMusicMute());
|
||||
ConfMan.set("speech_mute", _sound->isSpeechMute());
|
||||
ConfMan.set("sfx_mute", _sound->isFxMute());
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue