aboutsummaryrefslogtreecommitdiff
path: root/engines/sci/sfx
diff options
context:
space:
mode:
Diffstat (limited to 'engines/sci/sfx')
-rw-r--r--engines/sci/sfx/midiparser.cpp4
-rw-r--r--engines/sci/sfx/music.cpp18
-rw-r--r--engines/sci/sfx/music.h17
-rw-r--r--engines/sci/sfx/soundcmd.cpp20
4 files changed, 28 insertions, 31 deletions
diff --git a/engines/sci/sfx/midiparser.cpp b/engines/sci/sfx/midiparser.cpp
index 58c1fb8e0a..dd7c9ad4e9 100644
--- a/engines/sci/sfx/midiparser.cpp
+++ b/engines/sci/sfx/midiparser.cpp
@@ -204,10 +204,10 @@ void MidiParser_SCI::parseNextEvent(EventInfo &info) {
jumpToTick(_loopTick);
_pSnd->loop--;
} else {
- _pSnd->status = kSndStatusStopped;
+ _pSnd->status = kSoundStopped;
PUT_SEL32V(segMan, _pSnd->soundObj, signal, 0xFFFF);
if (_soundVersion <= SCI_VERSION_0_LATE)
- PUT_SEL32V(segMan, _pSnd->soundObj, state, kSndStatusStopped);
+ PUT_SEL32V(segMan, _pSnd->soundObj, state, kSoundStopped);
debugC(2, kDebugLevelSound, "signal EOT");
}
}
diff --git a/engines/sci/sfx/music.cpp b/engines/sci/sfx/music.cpp
index e0f9111088..f54b1c43c2 100644
--- a/engines/sci/sfx/music.cpp
+++ b/engines/sci/sfx/music.cpp
@@ -138,7 +138,7 @@ void SciMusic::stopAll() {
for (uint32 i = 0; i < _playList.size(); i++) {
if (_soundVersion <= SCI_VERSION_0_LATE)
- PUT_SEL32V(segMan, _playList[i]->soundObj, state, kSndStatusStopped);
+ PUT_SEL32V(segMan, _playList[i]->soundObj, state, kSoundStopped);
else
PUT_SEL32V(segMan, _playList[i]->soundObj, signal, SIGNAL_OFFSET);
@@ -353,7 +353,7 @@ void SciMusic::onTimer() {
uint sz = _playList.size();
for (uint i = 0; i < sz; i++) {
- if (_playList[i]->status != kSndStatusPlaying)
+ if (_playList[i]->status != kSoundPlaying)
continue;
if (_playList[i]->pMidiParser) {
if (_playList[i]->fadeStep)
@@ -363,14 +363,14 @@ void SciMusic::onTimer() {
} else if (_playList[i]->pStreamAud) {
if (!_pMixer->isSoundHandleActive(_playList[i]->hCurrentAud)) {
_playList[i]->ticker = 0xFFFF;
- _playList[i]->status = kSndStatusStopped;
+ _playList[i]->status = kSoundStopped;
// Signal the engine scripts that the sound is done playing
// FIXME: is there any other place this can be triggered properly?
SegManager *segMan = ((SciEngine *)g_engine)->getEngineState()->_segMan; // HACK
PUT_SEL32V(segMan, _playList[i]->soundObj, signal, SIGNAL_OFFSET);
if (_soundVersion <= SCI_VERSION_0_LATE)
- PUT_SEL32V(segMan, _playList[i]->soundObj, state, kSndStatusStopped);
+ PUT_SEL32V(segMan, _playList[i]->soundObj, state, kSoundStopped);
} else {
_playList[i]->ticker = (uint16)(_pMixer->getSoundElapsedTime(
_playList[i]->hCurrentAud) * 0.06);
@@ -412,15 +412,15 @@ void SciMusic::soundPlay(MusicEntry *pSnd) {
pSnd->pStreamAud, -1, pSnd->volume, 0, false);
} else if (pSnd->pMidiParser) {
pSnd->pMidiParser->setVolume(pSnd->volume);
- if (pSnd->status == kSndStatusStopped)
+ if (pSnd->status == kSoundStopped)
pSnd->pMidiParser->jumpToTick(0);
}
- pSnd->status = kSndStatusPlaying;
+ pSnd->status = kSoundPlaying;
}
//---------------------------------------------
void SciMusic::soundStop(MusicEntry *pSnd) {
- pSnd->status = kSndStatusStopped;
+ pSnd->status = kSoundStopped;
if (pSnd->pStreamAud)
_pMixer->stopHandle(pSnd->hCurrentAud);
if (pSnd->pMidiParser)
@@ -440,7 +440,7 @@ void SciMusic::soundSetPriority(MusicEntry *pSnd, byte prio) {
}
//---------------------------------------------
void SciMusic::soundKill(MusicEntry *pSnd) {
- pSnd->status = kSndStatusStopped;
+ pSnd->status = kSoundStopped;
if (pSnd->pMidiParser) {
pSnd->pMidiParser->unloadMusic();
@@ -465,7 +465,7 @@ void SciMusic::soundKill(MusicEntry *pSnd) {
}
//---------------------------------------------
void SciMusic::soundPause(MusicEntry *pSnd) {
- pSnd->status = kSndStatusPaused;
+ pSnd->status = kSoundPaused;
if (pSnd->pStreamAud)
_pMixer->pauseHandle(pSnd->hCurrentAud, true);
else if (pSnd->pMidiParser)
diff --git a/engines/sci/sfx/music.h b/engines/sci/sfx/music.h
index 605eaa061c..9b4b25268c 100644
--- a/engines/sci/sfx/music.h
+++ b/engines/sci/sfx/music.h
@@ -41,10 +41,7 @@
namespace Sci {
-typedef uint16 SCIHANDLE;
-typedef uint16 HEAPHANDLE;
-
-enum kTrackType {
+enum TrackType {
kTrackAdlib = 0,
kTrackGameBlaster = 9,
kTrackMT32 = 12,
@@ -52,11 +49,11 @@ enum kTrackType {
kTrackTandy = 19
};
-enum kSndStatus {
- kSndStatusStopped = 0,
- kSndStatusInitialized = 1,
- kSndStatusPaused = 2,
- kSndStatusPlaying = 3
+enum SoundStatus {
+ kSoundStopped = 0,
+ kSoundInitialized = 1,
+ kSoundPaused = 2,
+ kSoundPlaying = 3
};
class MidiParser_SCI;
@@ -81,7 +78,7 @@ struct MusicEntry {
MidiParser_SCI *pMidiParser;
Audio::AudioStream* pStreamAud;
Audio::SoundHandle hCurrentAud;
- kSndStatus status;
+ SoundStatus status;
};
typedef Common::Array<MusicEntry *> MusicList;
diff --git a/engines/sci/sfx/soundcmd.cpp b/engines/sci/sfx/soundcmd.cpp
index d876437672..f7ed18968b 100644
--- a/engines/sci/sfx/soundcmd.cpp
+++ b/engines/sci/sfx/soundcmd.cpp
@@ -114,7 +114,7 @@ void process_sound_events(EngineState *s) { /* Get all sound events, apply their
debugC(2, kDebugLevelSound, "[process-sound] Song %04x:%04x finished\n",
PRINT_REG(obj));
PUT_SEL32V(segMan, obj, signal, SIGNAL_OFFSET);
- PUT_SEL32V(segMan, obj, state, kSndStatusStopped);
+ PUT_SEL32V(segMan, obj, state, kSoundStopped);
break;
default:
@@ -275,7 +275,7 @@ void SoundCommandParser::cmdInitHandle(reg_t obj, int16 value) {
#endif
if (_soundVersion <= SCI_VERSION_0_LATE)
- PUT_SEL32V(_segMan, obj, state, kSndStatusInitialized);
+ PUT_SEL32V(_segMan, obj, state, kSoundInitialized);
else
PUT_SEL32(_segMan, obj, nodePtr, obj);
@@ -299,7 +299,7 @@ void SoundCommandParser::cmdInitHandle(reg_t obj, int16 value) {
newSound->fadeStep = 0;
newSound->fadeTicker = 0;
newSound->fadeTickerStep = 0;
- newSound->status = kSndStatusStopped;
+ newSound->status = kSoundStopped;
// Check if a track with the same sound object is already playing
MusicEntry *oldSound = _music->getSlot(obj);
@@ -335,7 +335,7 @@ void SoundCommandParser::cmdPlayHandle(reg_t obj, int16 value) {
if (_soundVersion <= SCI_VERSION_0_LATE) {
_state->sfx_song_set_status(handle, SOUND_STATUS_PLAYING);
_state->sfx_song_set_loops(handle, GET_SEL32V(_segMan, obj, loop));
- PUT_SEL32V(_segMan, obj, state, kSndStatusPlaying);
+ PUT_SEL32V(_segMan, obj, state, kSoundPlaying);
} else if (_soundVersion == SCI_VERSION_1_EARLY) {
_state->sfx_song_set_status(handle, SOUND_STATUS_PLAYING);
_state->sfx_song_set_loops(handle, GET_SEL32V(_segMan, obj, loop));
@@ -418,7 +418,7 @@ void SoundCommandParser::cmdPlayHandle(reg_t obj, int16 value) {
PUT_SEL32V(_segMan, obj, frame, 0);
PUT_SEL32V(_segMan, obj, signal, 0);
} else {
- PUT_SEL32V(_segMan, obj, state, kSndStatusPlaying);
+ PUT_SEL32V(_segMan, obj, state, kSoundPlaying);
}
musicSlot->loop = GET_SEL32V(_segMan, obj, loop) == 0xFFFF ? 1 : 0;
@@ -478,7 +478,7 @@ void SoundCommandParser::cmdDisposeHandle(reg_t obj, int16 value) {
if (_soundVersion >= SCI_VERSION_1_EARLY)
PUT_SEL32(_segMan, obj, nodePtr, NULL_REG);
else
- PUT_SEL32V(_segMan, obj, state, kSndStatusStopped);
+ PUT_SEL32V(_segMan, obj, state, kSoundStopped);
#endif
}
@@ -500,7 +500,7 @@ void SoundCommandParser::cmdStopHandle(reg_t obj, int16 value) {
PUT_SEL32V(_segMan, obj, handle, 0);
if (_soundVersion <= SCI_VERSION_0_LATE)
- PUT_SEL32V(_segMan, obj, state, kSndStatusStopped);
+ PUT_SEL32V(_segMan, obj, state, kSoundStopped);
else
PUT_SEL32V(_segMan, obj, signal, SIGNAL_OFFSET);
@@ -521,7 +521,7 @@ void SoundCommandParser::cmdPauseHandle(reg_t obj, int16 value) {
#else
MusicEntry *musicSlot = _music->getSlot(obj);
- if (musicSlot->status == kSndStatusStopped) {
+ if (musicSlot->status == kSoundStopped) {
// WORKAROUND for the Sierra logo screen in Castle of Dr. Brain, where the
// game tries to pause/unpause the wrong sound in the playlist
if (!strcmp(_segMan->getObjectName(obj), "cMusic2"))
@@ -534,7 +534,7 @@ void SoundCommandParser::cmdPauseHandle(reg_t obj, int16 value) {
}
if (_soundVersion <= SCI_VERSION_0_LATE) {
- PUT_SEL32V(_segMan, obj, state, kSndStatusPaused);
+ PUT_SEL32V(_segMan, obj, state, kSoundPaused);
_music->soundPause(musicSlot);
} else {
if (value)
@@ -560,7 +560,7 @@ void SoundCommandParser::cmdResumeHandle(reg_t obj, int16 value) {
return;
}
- PUT_SEL32V(_segMan, obj, state, kSndStatusPlaying);
+ PUT_SEL32V(_segMan, obj, state, kSoundPlaying);
_music->soundPlay(musicSlot);
#endif
}