diff options
author | Robin Haberkorn <robin.haberkorn@googlemail.com> | 2012-10-03 15:49:34 +0200 |
---|---|---|
committer | Robin Haberkorn <robin.haberkorn@googlemail.com> | 2012-10-03 15:49:34 +0200 |
commit | 920067622e7ba72dd6947eb8e7875719315872b9 (patch) | |
tree | da28a7ec77d8c63e3fa74c18baf08a71c27ec9ee | |
parent | c61253adbd5bed1d7393a3153f9c865517280431 (diff) | |
download | osc-graphics-920067622e7ba72dd6947eb8e7875719315872b9.tar.gz |
allow to stop video recoding via (/recorder/start s "") and OSCGraphics.record()
-rw-r--r-- | chuck/OSCGraphics.ck | 5 | ||||
-rw-r--r-- | src/recorder.cpp | 5 |
2 files changed, 8 insertions, 2 deletions
diff --git a/chuck/OSCGraphics.ck b/chuck/OSCGraphics.ck index 82da22e..49a8003 100644 --- a/chuck/OSCGraphics.ck +++ b/chuck/OSCGraphics.ck @@ -16,10 +16,11 @@ public class OSCGraphics { return file; } - fun static void - stopRecord() + fun static string + record() { osc_send.startMsg("/recorder/stop", ""); + return ""; } fun static OSCGraphicsImage @ diff --git a/src/recorder.cpp b/src/recorder.cpp index 13e2b13..6859f1b 100644 --- a/src/recorder.cpp +++ b/src/recorder.cpp @@ -69,6 +69,11 @@ Recorder::start(const char *filename) -1, 0, -1, -1, -1, -1 /* no audio */ }; + if (!filename || !*filename) { + stop(); + return; + } + lock(); SDL_FFMPEGFREE_SAFE(file); |