diff options
author | Len Ovens <len@ovenwerks.net> | 2018-09-10 09:57:19 -0700 |
---|---|---|
committer | Len Ovens <len@ovenwerks.net> | 2018-09-10 09:58:15 -0700 |
commit | a96aa4e1fdc69da01c30ddd22176b03de39c0016 (patch) | |
tree | c8b4b44cb5766f87512fa60885e516d4569088fa /libs/surfaces/osc/osc.cc | |
parent | 79f01bc889d6c928345214eaba9016c6396bcfca (diff) |
OSC: Personal monitoring can add a new aux
Diffstat (limited to 'libs/surfaces/osc/osc.cc')
-rw-r--r-- | libs/surfaces/osc/osc.cc | 42 |
1 files changed, 42 insertions, 0 deletions
diff --git a/libs/surfaces/osc/osc.cc b/libs/surfaces/osc/osc.cc index 95905df87b..689f2a67bf 100644 --- a/libs/surfaces/osc/osc.cc +++ b/libs/surfaces/osc/osc.cc @@ -6368,6 +6368,21 @@ OSC::cue_parse (const char *path, const char* types, lo_arg **argv, int argc, lo ret = 0; } } + else if (!strncmp (path, X_("/cue/new_aux"), 12)) { + // Create new Aux bus + string name = ""; + string dest = ""; + if (argc == 2 && types[0] == 's' && types[1] == 's') { + name = &argv[0]->s; + dest = &argv[1]->s; + ret = cue_new_aux (name, dest, msg); + } else if (argc == 1 && types[0] == 's') { + name = &argv[0]->s; + ret = cue_new_aux (name, dest, msg); + } else { + PBD::warning << "OSC: new_aux has wrong number or type of parameters." << endmsg; + } + } else if (!strncmp (path, X_("/cue/next_aux"), 13)) { // switch to next Aux bus if ((!argc) || argv[0]->f || argv[0]->i) { @@ -6465,6 +6480,33 @@ OSC::_cue_set (uint32_t aux, lo_address addr) } int +OSC::cue_new_aux (string name, string dest, lo_message msg) +{ + // create a new bus named name - monitor + RouteList list; + boost::shared_ptr<Stripable> aux; + name = string_compose ("%1 - monitor", name); + list = session->new_audio_route (1, 1, 0, 1, name, PresentationInfo::AudioBus, (uint32_t) -1); + aux = *(list.begin()); + if (aux) { + boost::shared_ptr<Route> r = boost::dynamic_pointer_cast<Route>(aux); + r->output()->disconnect (this); + if (dest.size()) { + if (atoi( dest.c_str())) { + dest = string_compose ("system:playback_%1", dest); + } + PortSet& ports = r->output()->ports (); + r->output ()->connect (*(ports.begin()), dest, this); + } + aux->presentation_info().set_hidden (true); + + cue_set ((uint32_t) -1, msg); + return 0; + } + return -1; +} + +int OSC::cue_next (lo_message msg) { OSCSurface *s = get_surface(get_address (msg), true); |