diff options
author | D G Turner | 2012-12-16 13:42:28 +0000 |
---|---|---|
committer | D G Turner | 2012-12-16 13:42:28 +0000 |
commit | 101d355b4a14cb14b23435a69fb1d687bfad2c92 (patch) | |
tree | 14f0135618cb2d51e40057c107037f2cadb866e0 /engines/touche | |
parent | 9986d73e474c7b54b80c53506c64e2c4044d8fb8 (diff) | |
download | scummvm-rg350-101d355b4a14cb14b23435a69fb1d687bfad2c92.tar.gz scummvm-rg350-101d355b4a14cb14b23435a69fb1d687bfad2c92.tar.bz2 scummvm-rg350-101d355b4a14cb14b23435a69fb1d687bfad2c92.zip |
TOUCHE: Add commands to play and stop music tracks to engine console.
Diffstat (limited to 'engines/touche')
-rw-r--r-- | engines/touche/console.cpp | 19 | ||||
-rw-r--r-- | engines/touche/console.h | 3 | ||||
-rw-r--r-- | engines/touche/touche.h | 2 |
3 files changed, 24 insertions, 0 deletions
diff --git a/engines/touche/console.cpp b/engines/touche/console.cpp index 51ef5fc639..2c4c6a0da1 100644 --- a/engines/touche/console.cpp +++ b/engines/touche/console.cpp @@ -26,9 +26,28 @@ namespace Touche { ToucheConsole::ToucheConsole(ToucheEngine *vm) : GUI::Debugger(), _vm(vm) { + DCmd_Register("startMusic", WRAP_METHOD(ToucheConsole, Cmd_StartMusic)); + DCmd_Register("stopMusic", WRAP_METHOD(ToucheConsole, Cmd_StopMusic)); } ToucheConsole::~ToucheConsole() { } +bool ToucheConsole::Cmd_StartMusic(int argc, const char **argv) { + if (argc != 2) { + DebugPrintf("Usage: startMusic <num>\n"); + return true; + } + + int num = atoi(argv[1]); + + _vm->startMusic(num); + return false; +} + +bool ToucheConsole::Cmd_StopMusic(int argc, const char **argv) { + _vm->stopMusic(); + return false; +} + } // End of namespace Touche diff --git a/engines/touche/console.h b/engines/touche/console.h index e3cdc9d48b..43a303ad77 100644 --- a/engines/touche/console.h +++ b/engines/touche/console.h @@ -36,6 +36,9 @@ public: private: ToucheEngine *_vm; + + bool Cmd_StartMusic(int argc, const char **argv); + bool Cmd_StopMusic(int argc, const char **argv); }; } // End of namespace Touche diff --git a/engines/touche/touche.h b/engines/touche/touche.h index 75d99c21d4..6b04dfbbea 100644 --- a/engines/touche/touche.h +++ b/engines/touche/touche.h @@ -652,8 +652,10 @@ protected: Common::File _extMusicFile; void initMusic(); +public: // To allow access from console void startMusic(int num); void stopMusic(); +protected: int getMusicVolume(); void setMusicVolume(int volume); void adjustMusicVolume(int diff); |