aboutsummaryrefslogtreecommitdiff
path: root/engines/touche
diff options
context:
space:
mode:
authorD G Turner2012-12-16 13:42:28 +0000
committerD G Turner2012-12-16 13:42:28 +0000
commit101d355b4a14cb14b23435a69fb1d687bfad2c92 (patch)
tree14f0135618cb2d51e40057c107037f2cadb866e0 /engines/touche
parent9986d73e474c7b54b80c53506c64e2c4044d8fb8 (diff)
downloadscummvm-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.cpp19
-rw-r--r--engines/touche/console.h3
-rw-r--r--engines/touche/touche.h2
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);