From 101d355b4a14cb14b23435a69fb1d687bfad2c92 Mon Sep 17 00:00:00 2001 From: D G Turner Date: Sun, 16 Dec 2012 13:42:28 +0000 Subject: TOUCHE: Add commands to play and stop music tracks to engine console. --- engines/touche/console.cpp | 19 +++++++++++++++++++ engines/touche/console.h | 3 +++ engines/touche/touche.h | 2 ++ 3 files changed, 24 insertions(+) (limited to 'engines/touche') 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 \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); -- cgit v1.2.3