make even more use of Scumm::_musicEngine; added MusicEngine::setMasterVolume

svn-id: r10097
This commit is contained in:
Max Horn 2003-09-08 17:06:44 +00:00
parent 07cfd2d0ee
commit 90ec1dc34e
9 changed files with 62 additions and 85 deletions

View file

@ -364,76 +364,63 @@ bool ScummDebugger::Cmd_Restart(int argc, const char **argv) {
return false;
}
bool ScummDebugger::Cmd_IMuse (int argc, const char **argv) {
bool ScummDebugger::Cmd_IMuse(int argc, const char **argv) {
if (!_s->_imuse && !_s->_playerV2) {
Debug_Printf ("No iMuse engine is active.\n");
Debug_Printf("No iMuse engine is active.\n");
return true;
}
if (argc > 1) {
if (!strcmp (argv[1], "panic")) {
if (_s->_imuse)
_s->_imuse->stopAllSounds();
if (_s->_playerV2)
_s->_playerV2->stopAllSounds();
Debug_Printf ("AAAIIIEEEEEE!\n");
Debug_Printf ("Shutting down all music tracks\n");
if (!strcmp(argv[1], "panic")) {
_s->_musicEngine->stopAllSounds();
Debug_Printf("AAAIIIEEEEEE!\n");
Debug_Printf("Shutting down all music tracks\n");
return true;
} else if (!strcmp (argv[1], "multimidi")) {
if (argc > 2 && (!strcmp (argv[2], "on") || !strcmp (argv[2], "off"))) {
if (argc > 2 && (!strcmp(argv[2], "on") || !strcmp(argv[2], "off"))) {
if (_s->_imuse)
_s->_imuse->property (IMuse::PROP_MULTI_MIDI, !strcmp (argv[2], "on"));
Debug_Printf ("MultiMidi mode switched %s.\n", argv[2]);
_s->_imuse->property(IMuse::PROP_MULTI_MIDI, !strcmp(argv[2], "on"));
Debug_Printf("MultiMidi mode switched %s.\n", argv[2]);
} else {
Debug_Printf ("Specify \"on\" or \"off\" to switch.\n");
Debug_Printf("Specify \"on\" or \"off\" to switch.\n");
}
return true;
} else if (!strcmp (argv[1], "play")) {
if (argc > 2 && (!strcmp (argv[2], "random") || atoi (argv[2]) != 0)) {
int sound = atoi (argv[2]);
if (!strcmp (argv[2], "random")) {
Debug_Printf ("Selecting from %d songs...\n", _s->getNumSounds());
sound = _s->_rnd.getRandomNumber (_s->getNumSounds());
} else if (!strcmp(argv[1], "play")) {
if (argc > 2 && (!strcmp(argv[2], "random") || atoi(argv[2]) != 0)) {
int sound = atoi(argv[2]);
if (!strcmp(argv[2], "random")) {
Debug_Printf("Selecting from %d songs...\n", _s->getNumSounds());
sound = _s->_rnd.getRandomNumber(_s->getNumSounds());
}
_s->ensureResourceLoaded(rtSound, sound);
if (_s->_imuse)
_s->_imuse->startSound(sound);
if (_s->_playerV2) {
_s->_playerV2->startSound(sound);
}
_s->_musicEngine->startSound(sound);
Debug_Printf ("Attempted to start music %d.\n", sound);
Debug_Printf("Attempted to start music %d.\n", sound);
} else {
Debug_Printf ("Specify a music resource # from 1-255.\n");
Debug_Printf("Specify a music resource # from 1-255.\n");
}
return true;
} else if (!strcmp (argv[1], "stop")) {
if (argc > 2 && (!strcmp (argv[2], "all") || atoi (argv[2]) != 0)) {
if (!strcmp (argv[2], "all")) {
if (_s->_imuse)
_s->_imuse->stopAllSounds();
if (_s->_playerV2)
_s->_playerV2->stopAllSounds();
Debug_Printf ("Shutting down all music tracks.\n");
} else if (!strcmp(argv[1], "stop")) {
if (argc > 2 && (!strcmp(argv[2], "all") || atoi(argv[2]) != 0)) {
if (!strcmp(argv[2], "all")) {
_s->_musicEngine->stopAllSounds();
Debug_Printf("Shutting down all music tracks.\n");
} else {
if (_s->_imuse)
_s->_imuse->stopSound(atoi (argv[2]));
if (_s->_playerV2)
_s->_playerV2->stopSound(atoi (argv[2]));
Debug_Printf ("Attempted to stop music %d.\n", atoi (argv[2]));
_s->_musicEngine->stopSound(atoi(argv[2]));
Debug_Printf("Attempted to stop music %d.\n", atoi(argv[2]));
}
} else {
Debug_Printf ("Specify a music resource # or \"all\".\n");
Debug_Printf("Specify a music resource # or \"all\".\n");
}
return true;
}
}
Debug_Printf ("Available iMuse commands:\n");
Debug_Printf (" panic - Stop all music tracks\n");
Debug_Printf (" multimidi on/off - Toggle dual MIDI drivers\n");
Debug_Printf (" play # - Play a music resource\n");
Debug_Printf (" stop # - Stop a music resource\n");
Debug_Printf("Available iMuse commands:\n");
Debug_Printf(" panic - Stop all music tracks\n");
Debug_Printf(" multimidi on/off - Toggle dual MIDI drivers\n");
Debug_Printf(" play # - Play a music resource\n");
Debug_Printf(" stop # - Stop a music resource\n");
return true;
}