commit 1ffd53f26f768b3294d56e84b293f2f6c4224007
parent 5b3824f7e94c1ef02b181352c753e57e4461fa5d
Author: Johannes Lorenz <j.git@lorenz-ho.me>
Date: Sat, 21 Nov 2020 22:07:07 +0100
HDDRecorder: Move ports into Recorder class
This is required because oscprompt can not handle the ports as they are
in MW before this commit (as `rtosc::path_search` uses
`rtosc::Ports::apropos`, wich decends into one HDDrecorder subport and
thus hides the other ones).
Diffstat:
3 files changed, 27 insertions(+), 12 deletions(-)
diff --git a/src/Misc/Master.cpp b/src/Misc/Master.cpp
@@ -388,6 +388,7 @@ static const Ports master_ports = {
rRecursp(part, 16, "Part"),//NUM_MIDI_PARTS
rRecursp(sysefx, 4, "System Effect"),//NUM_SYS_EFX
rRecursp(insefx, 8, "Insertion Effect"),//NUM_INS_EFX
+ rRecur(HDDRecorder, "HDD recorder"),
rRecur(microtonal, "Microtonal Mapping Functionality"),
rRecur(ctl, "Controller"),
rArrayOption(Pinsparts, NUM_INS_EFX, rOpt(-2, Master), rOpt(-1, Off),
@@ -569,18 +570,6 @@ static const Ports master_ports = {
SNIP
preset_ports.dispatch(msg, data);
rBOIL_END},
- {"HDDRecorder/preparefile:s", rDoc("Init WAV file"), 0, [](const char *msg, RtData &d) {
- Master *m = (Master*)d.obj;
- m->HDDRecorder.preparefile(rtosc_argument(msg, 0).s, 1);}},
- {"HDDRecorder/start:", rDoc("Start recording"), 0, [](const char *, RtData &d) {
- Master *m = (Master*)d.obj;
- m->HDDRecorder.start();}},
- {"HDDRecorder/stop:", rDoc("Stop recording"), 0, [](const char *, RtData &d) {
- Master *m = (Master*)d.obj;
- m->HDDRecorder.stop();}},
- {"HDDRecorder/pause:", rDoc("Pause recording"), 0, [](const char *, RtData &d) {
- Master *m = (Master*)d.obj;
- m->HDDRecorder.pause();}},
{"watch/", rDoc("Interface to grab out live synthesis state"), &watchPorts,
rBOIL_BEGIN;
SNIP;
diff --git a/src/Misc/Recorder.cpp b/src/Misc/Recorder.cpp
@@ -11,6 +11,8 @@
of the License, or (at your option) any later version.
*/
+#include <rtosc/ports.h>
+#include <rtosc/port-sugar.h>
#include <sys/stat.h>
#include "Recorder.h"
#include "WavFile.h"
@@ -19,6 +21,27 @@
namespace zyn {
+#define rObject Recorder
+const rtosc::Ports Recorder::ports = {
+ {"preparefile:s", rDoc("Init WAV file"), 0,
+ rBOIL_BEGIN
+ obj->preparefile(rtosc_argument(msg, 0).s, 1);
+ rBOIL_END },
+ {"start:", rDoc("Start recording"), 0,
+ rBOIL_BEGIN
+ obj->start();
+ rBOIL_END },
+ {"stop:", rDoc("Stop recording"), 0,
+ rBOIL_BEGIN
+ obj->stop();
+ rBOIL_END },
+ {"pause:", rDoc("Pause recording"), 0,
+ rBOIL_BEGIN;
+ obj->pause();
+ rBOIL_END}
+};
+#undef rObject
+
Recorder::Recorder(const SYNTH_T &synth_)
:status(0), notetrigger(0),synth(synth_)
{}
diff --git a/src/Misc/Recorder.h b/src/Misc/Recorder.h
@@ -13,6 +13,7 @@
#ifndef RECORDER_H
#define RECORDER_H
+#include <rtosc/ports.h>
#include <string>
namespace zyn {
@@ -40,6 +41,8 @@ class Recorder
* 2 - recording */
int status;
+ static const rtosc::Ports ports;
+
private:
int notetrigger;
const SYNTH_T &synth;