#include <glibmm.h>
#include "pbd/control_math.h"
+#include "pbd/controllable.h"
#include <pbd/convert.h>
#include <pbd/pthread_utils.h>
#include <pbd/file_utils.h>
#include "ardour/dB.h"
#include "ardour/filesystem_paths.h"
#include "ardour/panner.h"
+#include "ardour/panner_shell.h"
+#include "ardour/pannable.h"
#include "ardour/plugin.h"
#include "ardour/plugin_insert.h"
#include "ardour/presentation_info.h"
REGISTER_CALLBACK (serv, X_("/select/db_delta"), "f", sel_dB_delta);
REGISTER_CALLBACK (serv, X_("/select/trimdB"), "f", sel_trim);
REGISTER_CALLBACK (serv, X_("/select/hide"), "i", sel_hide);
+ REGISTER_CALLBACK (serv, X_("/select/bus/only"), "f", sel_bus_only);
+ REGISTER_CALLBACK (serv, X_("/select/bus/only"), "", sel_bus_only);
+ REGISTER_CALLBACK (serv, X_("/select/previous"), "f", sel_previous);
+ REGISTER_CALLBACK (serv, X_("/select/previous"), "", sel_previous);
+ REGISTER_CALLBACK (serv, X_("/select/next"), "f", sel_next);
+ REGISTER_CALLBACK (serv, X_("/select/next"), "", sel_next);
REGISTER_CALLBACK (serv, X_("/select/pan_stereo_position"), "f", sel_pan_position);
REGISTER_CALLBACK (serv, X_("/select/pan_stereo_width"), "f", sel_pan_width);
REGISTER_CALLBACK (serv, X_("/select/send_gain"), "if", sel_sendgain);
REGISTER_CALLBACK (serv, X_("/strip/polarity"), "ii", strip_phase);
REGISTER_CALLBACK (serv, X_("/strip/gain"), "if", route_set_gain_dB);
REGISTER_CALLBACK (serv, X_("/strip/fader"), "if", route_set_gain_fader);
+ REGISTER_CALLBACK (serv, X_("/strip/db_delta"), "if", strip_db_delta);
REGISTER_CALLBACK (serv, X_("/strip/trimdB"), "if", route_set_trim_dB);
REGISTER_CALLBACK (serv, X_("/strip/pan_stereo_position"), "if", route_set_pan_stereo_position);
REGISTER_CALLBACK (serv, X_("/strip/pan_stereo_width"), "if", route_set_pan_stereo_width);
set = &(link_sets[ls]);
sur->custom_mode = set->custom_mode;
sur->custom_strips = set->custom_strips;
+ sur->temp_mode = set->temp_mode;
sur->temp_strips = set->temp_strips;
}
if (strcmp (path, X_("/strip/listen")) == 0) {
if (argc <= 0) {
PBD::warning << "OSC: Wrong number of parameters." << endmsg;
- } else if (sur->custom_mode) {
+ } else if (sur->custom_mode && !sur->temp_mode) {
PBD::warning << "OSC: Can't add strips with custom enabled." << endmsg;
} else {
for (int n = 0; n < argc; ++n) {
if (strcmp (path, X_("/strip/ignore")) == 0) {
if (argc <= 0) {
PBD::warning << "OSC: Wrong number of parameters." << endmsg;
- } else if (!sur->custom_mode) {
+ } else if (!sur->custom_mode || sur->temp_mode) {
PBD::warning << "OSC: Can't remove strips without custom enabled." << endmsg;
} else {
for (int n = 0; n < argc; ++n) {
PBD::info << string_compose ("\n Surface: %1 - URL: %2 %3\n", it, sur->remote_url, port);
PBD::info << string_compose (" Number of strips: %1 Bank size: %2 Current Bank %3\n", sur->nstrips, sur->bank_size, sur->bank);
PBD::info << string_compose (" Use Custom: %1 Custom Strips: %2\n", sur->custom_mode, sur->custom_strips.size ());
+ PBD::info << string_compose (" Temp Mode: %1 Temp Strips: %2\n", sur->temp_mode, sur->temp_strips.size ());
bool ug = false;
if (sur->usegroup == PBD::Controllable::UseGroup) {
ug = true;
PBD::info << string_compose (" Bank size: %1 Current bank: %2 Strip Types: %3\n", set->banksize, set->bank, set->strip_types.to_ulong());
PBD::info << string_compose (" Auto bank sizing: %1 Linkset not ready flag: %2\n", set->autobank, set->not_ready);
PBD::info << string_compose (" Use Custom: %1 Number of Custom Strips: %2\n", set->custom_mode, set->custom_strips.size ());
+ PBD::info << string_compose (" Temp Mode: %1 Number of Temp Strips: %2\n", set->temp_mode, set->temp_strips.size ());
}
PBD::info << endmsg;
}
int
OSC::custom_mode (float state, lo_message msg)
+{
+ return _custom_mode ((uint32_t) state, get_address (msg));
+}
+
+int
+OSC::_custom_mode (uint32_t state, lo_address addr)
{
if (!session) {
return 0;
}
- OSCSurface *sur = get_surface(get_address (msg), true);
+ OSCSurface *sur = get_surface(addr, true);
LinkSet *set;
uint32_t ls = sur->linkset;
return -1;
} else {
if (sur->bank_size) {
- sur->custom_mode = (uint32_t) state | 0x4;
+ sur->custom_mode = state | 0x4;
} else {
- sur->custom_mode = (uint32_t) state;
+ sur->custom_mode = state;
}
sur->strips = get_sorted_stripables(sur->strip_types, sur->cue, sur->custom_mode, sur->custom_strips);
sur->nstrips = sur->custom_strips.size();
set->custom_mode = sur->custom_mode;
set->strips = sur->strips;
}
- return set_bank (1, msg);
+ return _set_bank (1, addr);
}
int
new_ls.strips = sur->strips;
new_ls.custom_strips = sur->custom_strips;
new_ls.custom_mode = sur->custom_mode;
+ new_ls.temp_mode = sur->temp_mode;
new_ls.urls.resize (2);
link_sets[set] = new_ls;
}
} else {
linkid = argv[8]->i;
}
+ [[fallthrough]];
case 8:
if (types[7] == 'f') {
linkset = (int) argv[7]->f;
} else {
linkset = argv[7]->i;
}
+ [[fallthrough]];
case 7:
if (types[6] == 'f') {
port = (int) argv[6]->f;
} else {
port = argv[6]->i;
}
+ [[fallthrough]];
case 6:
if (types[5] == 'f') {
pi_page = (int) argv[5]->f;
} else {
pi_page = argv[5]->i;
}
+ [[fallthrough]];
case 5:
if (types[4] == 'f') {
se_page = (int) argv[4]->f;
} else {
se_page = argv[4]->i;
}
+ [[fallthrough]];
case 4:
if (types[3] == 'f') {
fadermode = (int) argv[3]->f;
} else {
fadermode = argv[3]->i;
}
+ [[fallthrough]];
case 3:
if (types[2] == 'f') {
feedback = (int) argv[2]->f;
} else {
feedback = argv[2]->i;
}
+ [[fallthrough]];
case 2:
if (types[1] == 'f') {
strip_types = (int) argv[1]->f;
} else {
strip_types = argv[1]->i;
}
+ [[fallthrough]];
case 1:
if (types[0] == 'f') {
bank_size = (int) argv[0]->f;
}
OSCSurface *s = get_surface(get_address (msg), true);
s->bank_size = b_size;
- s->custom_mode = 0;
s->strip_types = strips;
s->feedback = fb;
s->gainmode = gm;
}
s->send_page_size = se_size;
s->plug_page_size = pi_size;
+ if (s->temp_mode) {
+ s->temp_mode = TempOff;
+ }
if (s->linkset) {
set_link (s->linkset, s->linkid, get_address (msg));
link_strip_types (s->linkset, s->strip_types.to_ulong());
// set bank and strip feedback
strip_feedback(s, true);
_set_bank (1, get_address (msg));
+ _strip_select (boost::shared_ptr<Stripable> (), get_address (msg));
}
global_feedback (s);
}
OSCSurface *s = get_surface(get_address (msg), true);
s->strip_types = st;
- s->custom_mode = 0;
+ s->temp_mode = TempOff;
if (s->strip_types[10]) {
s->usegroup = PBD::Controllable::UseGroup;
} else {
if (s->linkset) {
link_strip_types (s->linkset, st);
}
-
// set bank and strip feedback
- _set_bank (1, get_address (msg));
+ strip_feedback(s, false);
+ set_bank (1, msg);
+ _strip_select (boost::shared_ptr<Stripable> (), get_address (msg));
return 0;
}
it++;
}
}
- refresh_surface (msg);
+ if (sur->feedback.to_ulong()) {
+ refresh_surface (msg);
+ }
return 0;
}
}
s.usegroup = PBD::Controllable::NoGroup;
s.custom_strips.clear ();
s.custom_mode = 0;
+ s.temp_mode = TempOff;
s.sel_obs = 0;
s.expand = 0;
s.expand_enable = false;
+ s.expand_strip = boost::shared_ptr<Stripable> ();
s.cue = false;
s.aux = 0;
s.cue_obs = 0;
OSC::global_feedback (OSCSurface* sur)
{
OSCGlobalObserver* o = sur->global_obs;
- delete o;
+ if (o) {
+ delete o;
+ }
if (sur->feedback[4] || sur->feedback[3] || sur->feedback[5] || sur->feedback[6]) {
// create a new Global Observer for this surface
}
sur->custom_mode = set->custom_mode;
sur->custom_strips = set->custom_strips;
+ sur->temp_mode = set->temp_mode;
sur->temp_strips = set->temp_strips;
}
- if (sur->custom_mode < 7) {
+ if (!sur->temp_mode) {
sur->strips = get_sorted_stripables(sur->strip_types, sur->cue, sur->custom_mode, sur->custom_strips);
} else {
sur->strips = get_sorted_stripables(sur->strip_types, sur->cue, 1, sur->temp_strips);
for (uint32_t i = 0; i < bank_size; i++) {
OSCRouteObserver* o = new OSCRouteObserver (*this, i + 1, sur);
sur->observers.push_back (o);
+ if (sur->temp_mode == BusOnly) {
+ boost::shared_ptr<ARDOUR::Stripable> str = get_strip (i + 1, lo_address_new_from_url (sur->remote_url.c_str()));
+ boost::shared_ptr<ARDOUR::Send> send = get_send (str, lo_address_new_from_url (sur->remote_url.c_str()));
+ if (send) {
+ o->refresh_send (send, true);
+ }
+ }
+
}
}
} else {
for (uint32_t i = 0; i < sur->observers.size(); i++) {
boost::shared_ptr<ARDOUR::Stripable> str = get_strip (i + 1, lo_address_new_from_url (sur->remote_url.c_str()));
sur->observers[i]->refresh_strip(str, true);
+ if (sur->temp_mode == BusOnly) {
+ boost::shared_ptr<ARDOUR::Send> send = get_send (str, lo_address_new_from_url (sur->remote_url.c_str()));
+ if (send) {
+ sur->observers[i]->refresh_send (send, true);
+ }
+ }
}
}
}
OSC::parse_sel_group (const char *path, const char* types, lo_arg **argv, int argc, lo_message msg)
{
OSCSurface *sur = get_surface(get_address (msg));
- boost::shared_ptr<Stripable> s;
- if (sur->expand_enable) {
- s = get_strip (sur->expand, get_address (msg));
- } else {
- s = _select;
- }
+ boost::shared_ptr<Stripable> s = sur->select;
int ret = 1; /* unhandled */
if (s) {
if (!strncmp (path, X_("/select/group"), 13)) {
RouteGroup *rg = rt->route_group();
if (!rg) {
PBD::warning << "OSC: This strip is not part of a group." << endmsg;
- return ret;
}
float value = 0;
if (argc == 1) {
value = (uint32_t) argv[0]->i;
}
}
- if (!strncmp (path, X_("/select/group/enable"), 20)) {
- if (argc == 1) {
- rg->set_active (value, this);
- ret = 0;
+ if (!strncmp (path, X_("/select/group/only"), 18)) {
+ if (!rg) {
+ return ret;
}
- }
- else if (!strncmp (path, X_("/select/group/only"), 18)) {
if ((argc == 1 && value) || !argc) {
// fill sur->strips with routes from this group and hit bank1
- sur->temp_strips.clear();
- boost::shared_ptr<RouteList> rl = rg->route_list();
- for (RouteList::iterator it = rl->begin(); it != rl->end(); ++it) {
- boost::shared_ptr<Route> r = *it;
- boost::shared_ptr<Stripable> s = boost::dynamic_pointer_cast<Stripable> (r);
- sur->temp_strips.push_back(s);
- }
- sur->custom_mode = 7;
+ sur->temp_mode = GroupOnly;
+ ret = set_temp_mode (get_address (msg));
set_bank (1, msg);
- ret = 0;
} else {
// key off is ignored
ret = 0;
}
}
+ else if (!strncmp (path, X_("/select/group/enable"), 20)) {
+ if (rg) {
+ if (argc == 1) {
+ rg->set_active (value, this);
+ ret = 0;
+ }
+ } else {
+ int_message (X_("/select/group/enable"), 0, get_address (msg));
+ }
+ }
else if (strcmp (path, X_("/select/group/gain")) == 0) {
- if (argc == 1) {
- rg->set_gain ((bool) value);
- ret = 0;
+ if (rg) {
+ if (argc == 1) {
+ rg->set_gain ((bool) value);
+ ret = 0;
+ }
+ } else {
+ int_message (X_("/select/group/gain"), 0, get_address (msg));
}
}
else if (strcmp (path, X_("/select/group/relative")) == 0) {
- if (argc == 1) {
- rg->set_relative ((bool) value, this);
- ret = 0;
+ if (rg) {
+ if (argc == 1) {
+ rg->set_relative ((bool) value, this);
+ ret = 0;
+ }
+ } else {
+ int_message (X_("/select/group/relative"), 0, get_address (msg));
}
}
else if (strcmp (path, X_("/select/group/mute")) == 0) {
- if (argc == 1) {
- rg->set_mute ((bool) value);
- ret = 0;
+ if (rg) {
+ if (argc == 1) {
+ rg->set_mute ((bool) value);
+ ret = 0;
+ }
+ } else {
+ int_message (X_("/select/group/mute"), 0, get_address (msg));
}
}
else if (strcmp (path, X_("/select/group/solo")) == 0) {
- if (argc == 1) {
- rg->set_solo ((bool) value);
- ret = 0;
+ if (rg) {
+ if (argc == 1) {
+ rg->set_solo ((bool) value);
+ ret = 0;
+ }
+ } else {
+ int_message (X_("/select/group/solo"), 0, get_address (msg));
}
}
else if (strcmp (path, X_("/select/group/recenable")) == 0) {
- if (argc == 1) {
- rg->set_recenable ((bool) value);
- ret = 0;
+ if (rg) {
+ if (argc == 1) {
+ rg->set_recenable ((bool) value);
+ ret = 0;
+ }
+ } else {
+ int_message (X_("/select/group/recenable"), 0, get_address (msg));
}
}
else if (strcmp (path, X_("/select/group/select")) == 0) {
- if (argc == 1) {
- rg->set_select ((bool) value);
- ret = 0;
+ if (rg) {
+ if (argc == 1) {
+ rg->set_select ((bool) value);
+ ret = 0;
+ }
+ } else {
+ int_message (X_("/select/group/select"), 0, get_address (msg));
}
}
else if (strcmp (path, X_("/select/group/active")) == 0) {
- if (argc == 1) {
- rg->set_route_active ((bool) value);
- ret = 0;
+ if (rg) {
+ if (argc == 1) {
+ rg->set_route_active ((bool) value);
+ ret = 0;
+ }
+ } else {
+ int_message (X_("/select/group/active"), 0, get_address (msg));
}
}
else if (strcmp (path, X_("/select/group/color")) == 0) {
- if (argc == 1) {
- rg->set_color ((bool) value);
- ret = 0;
+ if (rg) {
+ if (argc == 1) {
+ rg->set_color ((bool) value);
+ ret = 0;
+ }
+ } else {
+ int_message (X_("/select/group/color"), 0, get_address (msg));
}
}
else if (strcmp (path, X_("/select/group/monitoring")) == 0) {
- if (argc == 1) {
- rg->set_monitoring ((bool) value);
- ret = 0;
+ if (rg) {
+ if (argc == 1) {
+ rg->set_monitoring ((bool) value);
+ ret = 0;
+ }
+ } else {
+ int_message (X_("/select/group/monitoring"), 0, get_address (msg));
}
}
}
{
OSCSurface *sur = get_surface(get_address (msg));
boost::shared_ptr<Stripable> s;
- if (sur->expand_enable) {
- s = get_strip (sur->expand, get_address (msg));
- } else {
- s = _select;
- }
+ s = sur->select;
int ret = 1; /* unhandled */
if (s) {
string svalue = "";
boost::shared_ptr<VCA> vca = boost::dynamic_pointer_cast<VCA> (s);
if (vca) {
if ((argc == 1 && ivalue) || !argc) {
- sur->temp_strips.clear();
- StripableList stripables;
- session->get_stripables (stripables);
- for (StripableList::iterator it = stripables.begin(); it != stripables.end(); ++it) {
- boost::shared_ptr<Stripable> st = *it;
- if (st->slaved_to (vca)) {
- sur->temp_strips.push_back(st);
- }
- }
- sur->temp_strips.push_back(s);
- sur->custom_mode = 7;
+ sur->temp_mode = VCAOnly;
+ ret = set_temp_mode (get_address (msg));
set_bank (1, msg);
- ret = 0;
} else {
// key off is ignored
ret = 0;
return boost::shared_ptr<VCA>();
}
+int
+OSC::sel_bus_only (lo_message msg)
+{
+ OSCSurface *sur = get_surface(get_address (msg));
+ boost::shared_ptr<Stripable> s = sur->select;
+ if (s) {
+ boost::shared_ptr<Route> rt = boost::dynamic_pointer_cast<Route> (s);
+ if (rt) {
+ if (!rt->is_track () && rt->can_solo ()) {
+ // this is a bus, but not master, monitor or audition
+ sur->temp_mode = BusOnly;
+ set_temp_mode (get_address (msg));
+ set_bank (1, msg);
+ return 0;
+ }
+ }
+ }
+ return 1;
+}
+
+int
+OSC::set_temp_mode (lo_address addr)
+{
+ bool ret = 1;
+ OSCSurface *sur = get_surface(addr);
+ boost::shared_ptr<Stripable> s = sur->select;
+ if (s) {
+ if (sur->temp_mode == GroupOnly) {
+ boost::shared_ptr<Route> rt = boost::dynamic_pointer_cast<Route> (s);
+ if (rt) {
+ RouteGroup *rg = rt->route_group();
+ if (rg) {
+ sur->temp_strips.clear();
+ boost::shared_ptr<RouteList> rl = rg->route_list();
+ for (RouteList::iterator it = rl->begin(); it != rl->end(); ++it) {
+ boost::shared_ptr<Route> r = *it;
+ boost::shared_ptr<Stripable> st = boost::dynamic_pointer_cast<Stripable> (r);
+ sur->temp_strips.push_back(st);
+ }
+ sur->strips = get_sorted_stripables(sur->strip_types, sur->cue, 1, sur->temp_strips);
+ sur->nstrips = sur->temp_strips.size();
+ LinkSet *set;
+ uint32_t ls = sur->linkset;
+ if (ls) {
+ set = &(link_sets[ls]);
+ set->temp_mode = GroupOnly;
+ set->temp_strips.clear ();
+ set->temp_strips = sur->temp_strips;
+ set->strips = sur->strips;
+ }
+ ret = 0;
+ }
+ }
+ } else if (sur->temp_mode == VCAOnly) {
+ boost::shared_ptr<VCA> vca = boost::dynamic_pointer_cast<VCA> (s);
+ if (vca) {
+ sur->temp_strips.clear();
+ StripableList stripables;
+ session->get_stripables (stripables);
+ for (StripableList::iterator it = stripables.begin(); it != stripables.end(); ++it) {
+ boost::shared_ptr<Stripable> st = *it;
+ if (st->slaved_to (vca)) {
+ sur->temp_strips.push_back(st);
+ }
+ }
+ sur->temp_strips.push_back(s);
+ sur->strips = get_sorted_stripables(sur->strip_types, sur->cue, 1, sur->temp_strips);
+ sur->nstrips = sur->temp_strips.size();
+ LinkSet *set;
+ uint32_t ls = sur->linkset;
+ if (ls) {
+ set = &(link_sets[ls]);
+ set->temp_mode = VCAOnly;
+ set->temp_strips.clear ();
+ set->temp_strips = sur->temp_strips;
+ set->strips = sur->strips;
+ }
+ ret = 0;
+ }
+ } else if (sur->temp_mode == BusOnly) {
+ boost::shared_ptr<Route> rt = boost::dynamic_pointer_cast<Route> (s);
+ if (rt) {
+ if (!rt->is_track () && rt->can_solo ()) {
+ // this is a bus, but not master, monitor or audition
+ sur->temp_strips.clear();
+ StripableList stripables;
+ session->get_stripables (stripables);
+ for (StripableList::iterator it = stripables.begin(); it != stripables.end(); ++it) {
+ boost::shared_ptr<Stripable> st = *it;
+ boost::shared_ptr<Route> ri = boost::dynamic_pointer_cast<Route> (st);
+ bool sends = true;
+ if (ri && ri->direct_feeds_according_to_graph (rt, &sends)) {
+ sur->temp_strips.push_back(st);
+ }
+ }
+ sur->temp_strips.push_back(s);
+ sur->strips = get_sorted_stripables(sur->strip_types, sur->cue, 1, sur->temp_strips);
+ sur->nstrips = sur->temp_strips.size();
+ LinkSet *set;
+ uint32_t ls = sur->linkset;
+ if (ls) {
+ set = &(link_sets[ls]);
+ set->temp_mode = BusOnly;
+ set->temp_strips.clear ();
+ set->temp_strips = sur->temp_strips;
+ set->strips = sur->strips;
+ }
+ ret = 0;
+ }
+ }
+ } else if (sur->temp_mode == TempOff) {
+ sur->temp_mode = TempOff;
+ ret = 0;
+ }
+ }
+ if (ret) {
+ sur->temp_mode = TempOff;
+ }
+ return ret;
+}
+
+boost::shared_ptr<Send>
+OSC::get_send (boost::shared_ptr<Stripable> st, lo_address addr)
+{
+ OSCSurface *sur = get_surface(addr);
+ boost::shared_ptr<Stripable> s = sur->select;
+ if (st && s && (st != s)) {
+ boost::shared_ptr<Route> rt = boost::dynamic_pointer_cast<Route> (s);
+ boost::shared_ptr<Route> rst = boost::dynamic_pointer_cast<Route> (st);
+ //find what send number feeds s
+ return rst->internal_send_for (rt);
+ }
+ return boost::shared_ptr<Send> ();
+}
+
int
OSC::name_session (char *n, lo_message msg)
{
}
}
}
- // failsafe... should never get here.
+ // strip not in current bank
return 0;
}
boost::shared_ptr<Processor> proc = r->nth_plugin (sur->plugins[sur->plugin_id - 1]);
boost::shared_ptr<PluginInsert> pi;
if (!(pi = boost::dynamic_pointer_cast<PluginInsert>(proc))) {
- PBD::warning << "OSC: Plugin: " << sur->plugin_id << " does not seem to be a plugin" << endmsg;
+ PBD::warning << "OSC: Plugin: " << sur->plugin_id << " does not seem to be a plugin" << endmsg;
return 1;
}
boost::shared_ptr<ARDOUR::Plugin> pip = pi->plugin();
uint32_t ctr = 0;
uint32_t aut = 0;
uint32_t ssid;
+ boost::shared_ptr<Send> send = boost::shared_ptr<Send> ();
if (argc) {
if (types[argc - 1] == 'f') {
ssid = atoi (&(strrchr (path, '/' ))[1]);
strp = get_strip (ssid, get_address (msg));
}
+ send = get_send (strp, get_address (msg));
ctr = 7;
} else if (!strncmp (path, X_("/select/"), 8)) {
- if (sur->expand_enable && sur->expand) {
- strp = get_strip (sur->expand, get_address (msg));
- } else {
- strp = _select;
- }
+ strp = sur->select;
ctr = 8;
} else {
return ret;
} else {
PBD::warning << "No fader for this strip" << endmsg;
}
+ if (send) {
+ control = send->gain_control ();
+ }
} else {
PBD::warning << "Automation not available for " << path << endmsg;
}
control->set_automation_state (ARDOUR::Touch);
ret = 0;
break;
+ case 4:
+ control->set_automation_state (ARDOUR::Latch);
+ ret = 0;
+ break;
default:
break;
}
int ret = 1;
OSCSurface *sur = get_surface(get_address (msg));
boost::shared_ptr<Stripable> strp = boost::shared_ptr<Stripable>();
+ boost::shared_ptr<Send> send = boost::shared_ptr<Send> ();
uint32_t ctr = 0;
uint32_t touch = 0;
uint32_t ssid;
ssid = atoi (&(strrchr (path, '/' ))[1]);
strp = get_strip (ssid, get_address (msg));
}
+ send = get_send (strp, get_address (msg));
ctr = 7;
} else if (!strncmp (path, X_("/select/"), 8)) {
- if (sur->expand_enable && sur->expand) {
- strp = get_strip (sur->expand, get_address (msg));
- } else {
- strp = _select;
- }
+ strp = sur->select;
ctr = 8;
} else {
return ret;
} else {
PBD::warning << "No fader for this strip" << endmsg;
}
+ if (send) {
+ control = send->gain_control ();
+ }
} else {
PBD::warning << "Automation not available for " << path << endmsg;
}
OSCSurface *sur = get_surface(get_address (msg));
if (s) {
+ if ((sur->temp_mode == BusOnly) && (s != sur->select)) {
+ return float_message_with_id (X_("/strip/mute"), ssid, 0, sur->feedback[2], get_address (msg));
+ }
if (s->mute_control()) {
s->mute_control()->set_value (yn ? 1.0 : 0.0, sur->usegroup);
return 0;
{
OSCSurface *sur = get_surface(get_address (msg));
boost::shared_ptr<Stripable> s;
- if (sur->expand_enable) {
- s = get_strip (sur->expand, get_address (msg));
- } else {
- s = _select;
- }
+ s = sur->select;
if (s) {
if (s->mute_control()) {
s->mute_control()->set_value (yn ? 1.0 : 0.0, PBD::Controllable::NoGroup);
OSCSurface *sur = get_surface(get_address (msg));
if (s) {
+ if ((sur->temp_mode == BusOnly) && (s != sur->select)) {
+ return float_message_with_id (X_("/strip/solo"), ssid, 0, sur->feedback[2], get_address (msg));
+ }
if (s->solo_control()) {
s->solo_control()->set_value (yn ? 1.0 : 0.0, sur->usegroup);
}
OSCSurface *sur = get_surface(get_address (msg));
if (s) {
+ if ((sur->temp_mode == BusOnly) && (s != sur->select)) {
+ return float_message_with_id (X_("/strip/solo_iso"), ssid, 0, sur->feedback[2], get_address (msg));
+ }
if (s->solo_isolate_control()) {
s->solo_isolate_control()->set_value (yn ? 1.0 : 0.0, sur->usegroup);
return 0;
OSCSurface *sur = get_surface(get_address (msg));
if (s) {
+ if ((sur->temp_mode == BusOnly) && (s != sur->select)) {
+ return float_message_with_id (X_("/strip/solo_safe"), ssid, 0, sur->feedback[2], get_address (msg));
+ }
if (s->solo_safe_control()) {
s->solo_safe_control()->set_value (yn ? 1.0 : 0.0, sur->usegroup);
return 0;
{
OSCSurface *sur = get_surface(get_address (msg));
boost::shared_ptr<Stripable> s;
- if (sur->expand_enable) {
- s = get_strip (sur->expand, get_address (msg));
- } else {
- s = _select;
- }
+ s = sur->select;
if (s) {
if (s->solo_control()) {
session->set_control (s->solo_control(), yn ? 1.0 : 0.0, PBD::Controllable::NoGroup);
{
OSCSurface *sur = get_surface(get_address (msg));
boost::shared_ptr<Stripable> s;
- if (sur->expand_enable) {
- s = get_strip (sur->expand, get_address (msg));
- } else {
- s = _select;
- }
+ s = sur->select;
if (s) {
if (s->solo_isolate_control()) {
s->solo_isolate_control()->set_value (yn ? 1.0 : 0.0, PBD::Controllable::NoGroup);
{
OSCSurface *sur = get_surface(get_address (msg));
boost::shared_ptr<Stripable> s;
- if (sur->expand_enable) {
- s = get_strip (sur->expand, get_address (msg));
- } else {
- s = _select;
- }
+ s = sur->select;
if (s) {
if (s->solo_safe_control()) {
s->solo_safe_control()->set_value (yn ? 1.0 : 0.0, PBD::Controllable::NoGroup);
{
OSCSurface *sur = get_surface(get_address (msg));
boost::shared_ptr<Stripable> s;
- if (sur->expand_enable) {
- s = get_strip (sur->expand, get_address (msg));
- } else {
- s = _select;
- }
+ s = sur->select;
if (s) {
if (s->rec_enable_control()) {
s->rec_enable_control()->set_value (yn ? 1.0 : 0.0, PBD::Controllable::NoGroup);
OSCSurface *sur = get_surface(get_address (msg));
if (s) {
+ if ((sur->temp_mode == BusOnly) && (s != sur->select)) {
+ return float_message_with_id (X_("/strip/recenable"), ssid, 0, sur->feedback[2], get_address (msg));
+ }
if (s->rec_enable_control()) {
s->rec_enable_control()->set_value (yn, sur->usegroup);
if (s->rec_enable_control()->get_value()) {
if (!session) {
return -1;
}
-
+ OSCSurface *sur = get_surface(get_address (msg));
boost::shared_ptr<Stripable> s = get_strip(ssid, get_address(msg));
if (s) {
+ if ((sur->temp_mode == BusOnly) && (s != sur->select)) {
+ text_message_with_id (X_("/strip/name"), ssid, string_compose ("%1-Send", s->name()), sur->feedback[2], get_address(msg));
+ return 1;
+ }
s->set_name(std::string(newname));
}
OSCSurface *sur = get_surface(get_address (msg));
boost::shared_ptr<Stripable> s;
- if (sur->expand_enable) {
- s = get_strip (sur->expand, get_address (msg));
- } else {
- s = _select;
- }
+ s = sur->select;
if (s) {
s->set_name(std::string(newname));
}
OSCSurface *sur = get_surface(get_address (msg));
boost::shared_ptr<Stripable> s;
- if (sur->expand_enable) {
- s = get_strip (sur->expand, get_address (msg));
- } else {
- s = _select;
- }
+ s = sur->select;
if (s) {
boost::shared_ptr<Route> rt = boost::dynamic_pointer_cast<Route> (s);
if (!rt) {
}
OSCSurface *sur = get_surface(get_address (msg));
boost::shared_ptr<Stripable> s;
- if (sur->expand_enable) {
- s = get_strip (sur->expand, get_address (msg));
- } else {
- s = _select;
- }
+ s = sur->select;
return strip_select_group (s, group);
}
{
OSCSurface *sur = get_surface(get_address (msg));
boost::shared_ptr<Stripable> s;
- if (sur->expand_enable) {
- s = get_strip (sur->expand, get_address (msg));
- } else {
- s = _select;
- }
+ s = sur->select;
if (s) {
if (s->rec_safe_control()) {
s->rec_safe_control()->set_value (yn ? 1.0 : 0.0, PBD::Controllable::NoGroup);
boost::shared_ptr<Stripable> s = get_strip (ssid, get_address (msg));
OSCSurface *sur = get_surface(get_address (msg));
if (s) {
+ if ((sur->temp_mode == BusOnly) && (s != sur->select)) {
+ return float_message_with_id (X_("/strip/record_safe"), ssid, 0, sur->feedback[2], get_address (msg));
+ }
if (s->rec_safe_control()) {
s->rec_safe_control()->set_value (yn, sur->usegroup);
if (s->rec_safe_control()->get_value()) {
OSCSurface *sur = get_surface(get_address (msg));
if (s) {
+ if ((sur->temp_mode == BusOnly) && (s != sur->select)) {
+ return float_message_with_id (X_("/strip/monitor_input"), ssid, 0, sur->feedback[2], get_address (msg));
+ }
boost::shared_ptr<Track> track = boost::dynamic_pointer_cast<Track> (s);
if (track) {
if (track->monitoring_control()) {
{
OSCSurface *sur = get_surface(get_address (msg));
boost::shared_ptr<Stripable> s;
- if (sur->expand_enable) {
- s = get_strip (sur->expand, get_address (msg));
- } else {
- s = _select;
- }
+ s = sur->select;
if (s) {
boost::shared_ptr<Track> track = boost::dynamic_pointer_cast<Track> (s);
if (track) {
OSCSurface *sur = get_surface(get_address (msg));
if (s) {
+ if ((sur->temp_mode == BusOnly) && (s != sur->select)) {
+ return float_message_with_id (X_("/strip/monitor_disk"), ssid, 0, sur->feedback[2], get_address (msg));
+ }
boost::shared_ptr<Track> track = boost::dynamic_pointer_cast<Track> (s);
if (track) {
if (track->monitoring_control()) {
{
OSCSurface *sur = get_surface(get_address (msg));
boost::shared_ptr<Stripable> s;
- if (sur->expand_enable) {
- s = get_strip (sur->expand, get_address (msg));
- } else {
- s = _select;
- }
+ s = sur->select;
if (s) {
boost::shared_ptr<Track> track = boost::dynamic_pointer_cast<Track> (s);
if (track) {
OSCSurface *sur = get_surface(get_address (msg));
if (s) {
+ if ((sur->temp_mode == BusOnly) && (s != sur->select)) {
+ return float_message_with_id (X_("/strip/polarity"), ssid, 0, sur->feedback[2], get_address (msg));
+ }
if (s->phase_control()) {
s->phase_control()->set_value (yn ? 1.0 : 0.0, sur->usegroup);
return 0;
{
OSCSurface *sur = get_surface(get_address (msg));
boost::shared_ptr<Stripable> s;
- if (sur->expand_enable) {
- s = get_strip (sur->expand, get_address (msg));
- } else {
- s = _select;
- }
+ s = sur->select;
if (s) {
if (s->phase_control()) {
s->phase_control()->set_value (yn ? 1.0 : 0.0, PBD::Controllable::NoGroup);
OSC::strip_expand (int ssid, int yn, lo_message msg)
{
OSCSurface *sur = get_surface(get_address (msg));
+ boost::shared_ptr<Stripable> s = get_strip (ssid, get_address (msg));
+ if (s) {
+ if ((sur->temp_mode == BusOnly)/* && (s != sur->select)*/) {
+ uint32_t val = 0;
+ if (ssid == (int) sur->expand) {
+ val = 1;
+ }
+ return float_message_with_id (X_("/strip/expand"), ssid, val, sur->feedback[2], get_address (msg));
+ } else {
+ sur->expand_strip = s;
+ }
+ }
sur->expand_enable = (bool) yn;
sur->expand = ssid;
- boost::shared_ptr<Stripable> s;
+ boost::shared_ptr<Stripable> sel;
if (yn) {
- s = get_strip (ssid, get_address (msg));
+ sel = get_strip (ssid, get_address (msg));
} else {
- s = _select;
+ sel = boost::shared_ptr<Stripable> ();
}
- return _strip_select (s, get_address (msg));
+ return _strip_select (sel, get_address (msg));
}
int
OSC::strip_hide (int ssid, int state, lo_message msg)
{
boost::shared_ptr<Stripable> s = get_strip (ssid, get_address (msg));
+ OSCSurface *sur = get_surface(get_address (msg));
if (s) {
+ if ((sur->temp_mode == BusOnly) && (s != sur->select)) {
+ return float_message_with_id (X_("/strip/hide"), ssid, 0, sur->feedback[2], get_address (msg));
+ }
if (state != s->is_hidden ()) {
s->presentation_info().set_hidden ((bool) state);
}
return -1;
}
OSCSurface *sur = get_surface(addr, true);
+ boost::weak_ptr<Stripable> o_sel = sur->select;
+ boost::shared_ptr<Stripable> old_sel= o_sel.lock ();
+ boost::weak_ptr<Stripable> o_expand = sur->expand_strip;
+ boost::shared_ptr<Stripable> old_expand= o_expand.lock ();
+
+ // we got a null strip check that old strips are valid
+ if (!s) {
+ if (old_expand && sur->expand_enable) {
+ sur->expand = get_sid (old_expand, addr);
+ if (sur->strip_types[11] || sur->expand) {
+ s = old_expand;
+ } else {
+ sur->expand_strip = boost::shared_ptr<Stripable> ();
+ }
+ }
+ }
if (!s) {
- // expand doesn't point to a stripable, turn it off and use select
sur->expand = 0;
sur->expand_enable = false;
if (ControlProtocol::first_selected_stripable()) {
} else {
s = session->master_out ();
}
- _select = s;
+ _select = s;
+ }
+ if (s != old_sel) {
+ sur->select = s;
}
- sur->select = s;
bool sends;
uint32_t nsends = 0;
do {
sur->sel_obs = sel_fb;
}
sur->sel_obs->set_expand (sur->expand_enable);
+ } else {
+ if (so != 0) {
+ delete so;
+ sur->sel_obs = 0;
+ }
+ }
+ if (sur->feedback[0] || sur->feedback[1]) {
uint32_t obs_expand = 0;
if (sur->expand_enable) {
+ sur->expand = get_sid (s, addr);
obs_expand = sur->expand;
} else {
obs_expand = 0;
for (uint32_t i = 0; i < sur->observers.size(); i++) {
sur->observers[i]->set_expand (obs_expand);
}
- } else {
- if (so != 0) {
- delete so;
- sur->sel_obs = 0;
+ }
+ if (s != old_sel) {
+ if (sur->temp_mode) {
+ set_temp_mode (addr);
+ if (sur->temp_mode > GroupOnly) {
+ sur->bank = 1;
+ strip_feedback (sur, false);
+ }
}
}
// need to set monitor for processor changed signal (for paging)
return -1;
}
OSCSurface *sur = get_surface(get_address (msg));
- sur->expand_enable = false;
boost::shared_ptr<Stripable> s = get_strip (ssid, get_address (msg));
if (s) {
+ if ((sur->temp_mode == BusOnly) && (s != sur->select)) {
+ return -1;
+ }
+ sur->expand_enable = false;
SetStripableSelection (s);
} else {
if ((int) (sur->feedback.to_ulong())) {
{
OSCSurface *sur = get_surface(get_address (msg));
boost::shared_ptr<Stripable> s;
- if (state && sur->expand) {
+ if (!sur->expand_strip) {
+ state = 0;
+ float_message (X_("/select/expand"), 0.0, get_address (msg));
+ }
+ if (state) {
sur->expand_enable = (bool) state;
- s = get_strip (sur->expand, get_address (msg));
+ s = boost::shared_ptr<Stripable> ();
} else {
sur->expand_enable = false;
- s = _select;
+ s = boost::shared_ptr<Stripable> ();
}
return _strip_select (s, get_address (msg));
}
+int
+OSC::sel_previous (lo_message msg)
+{
+ return sel_delta (-1, msg);
+}
+
+int
+OSC::sel_next (lo_message msg)
+{
+ return sel_delta (1, msg);
+}
+
+int
+OSC::sel_delta (int delta, lo_message msg)
+{
+ if (!delta) {
+ return 0;
+ }
+ OSCSurface *sur = get_surface(get_address (msg));
+ Sorted sel_strips;
+ if (sur->temp_mode < VCAOnly) {
+ sel_strips = sur->strips;
+ } else if (sur->temp_mode == VCAOnly) {
+ sel_strips = get_sorted_stripables(16, false, 0, sur->strips);
+ } else if (sur->temp_mode == BusOnly) {
+ sel_strips = get_sorted_stripables(132, false, 0, sur->strips);
+ } else {
+ return -1;
+ }
+ // the current selected strip _should_ be in sel_strips
+ uint32_t nstps = sel_strips.size ();
+ if (!nstps) {
+ return -1;
+ }
+ boost::shared_ptr<Stripable> new_sel = boost::shared_ptr<Stripable> ();
+ boost::weak_ptr<Stripable> o_sel = sur->select;
+ boost::shared_ptr<Stripable> old_sel= o_sel.lock ();
+ for (uint32_t i = 0; i < nstps; i++) {
+ if (old_sel == sel_strips[i]) {
+ if (i && delta < 0) {
+ // i is > 0 and delta is -1
+ new_sel = sel_strips[i - 1];
+ } else if ((i + 1) < nstps && delta > 0) {
+ // i is at least 1 less than greatest and delta = 1
+ new_sel = sel_strips[i + 1];
+ } else if ((i + 1) >= nstps && delta > 0) {
+ // i is greatest strip and delta 1
+ new_sel = sel_strips[0];
+ } else if (!i && delta < 0) {
+ // i = 0 and delta -1
+ new_sel = sel_strips[nstps - 1];
+ } else {
+ // should not happen
+ return -1;
+ }
+ }
+ }
+ if (!new_sel) {
+ // our selected strip has vanished use the first one
+ new_sel = sel_strips[0];
+ }
+ if (new_sel) {
+ if (!sur->expand_enable) {
+ SetStripableSelection (new_sel);
+ } else {
+ _strip_select (new_sel, get_address (msg));
+ }
+ return 0;
+ }
+ return -1;
+}
+
int
OSC::route_set_gain_dB (int ssid, float dB, lo_message msg)
{
OSCSurface *sur = get_surface(get_address (msg));
boost::shared_ptr<Stripable> s = get_strip (ssid, get_address (msg));
if (s) {
+ boost::shared_ptr<GainControl> gain_control;
+ if (sur->temp_mode == BusOnly && get_send (s, get_address (msg))) {
+ gain_control = get_send(s, get_address (msg))->gain_control();
+ } else {
+ gain_control = s->gain_control();
+ }
float abs;
- if (s->gain_control()) {
+ if (gain_control) {
if (dB < -192) {
abs = 0;
} else {
abs = dB_to_coefficient (dB);
- float top = s->gain_control()->upper();
+ float top = gain_control->upper();
if (abs > top) {
abs = top;
}
}
- fake_touch (s->gain_control());
- s->gain_control()->set_value (abs, sur->usegroup);
+ fake_touch (gain_control);
+ gain_control->set_value (abs, sur->usegroup);
return 0;
}
}
{
OSCSurface *sur = get_surface(get_address (msg));
boost::shared_ptr<Stripable> s;
- if (sur->expand_enable) {
- s = get_strip (sur->expand, get_address (msg));
- } else {
- s = _select;
- }
+ s = sur->select;
if (s) {
float abs;
if (s->gain_control()) {
{
OSCSurface *sur = get_surface(get_address (msg));
boost::shared_ptr<Stripable> s;
- if (sur->expand_enable) {
- s = get_strip (sur->expand, get_address (msg));
- } else {
- s = _select;
- }
+ s = sur->select;
if (s) {
if (s->gain_control()) {
float dB = accurate_coefficient_to_dB (s->gain_control()->get_value()) + delta;
OSCSurface *sur = get_surface(get_address (msg));
if (s) {
- if (s->gain_control()) {
- fake_touch (s->gain_control());
- s->gain_control()->set_value (s->gain_control()->interface_to_internal (pos), sur->usegroup);
+ boost::shared_ptr<GainControl> gain_control;
+ if (sur->temp_mode == BusOnly && get_send (s, get_address (msg))) {
+ gain_control = get_send(s, get_address (msg))->gain_control();
+ } else {
+ gain_control = s->gain_control();
+ }
+ if (gain_control) {
+ fake_touch (gain_control);
+ gain_control->set_value (gain_control->interface_to_internal (pos), sur->usegroup);
} else {
return float_message_with_id (X_("/strip/fader"), ssid, 0, sur->feedback[2], get_address (msg));
}
boost::shared_ptr<Stripable> s = get_strip (ssid, get_address (msg));
OSCSurface *sur = get_surface(get_address (msg));
if (s) {
- float db = accurate_coefficient_to_dB (s->gain_control()->get_value()) + delta;
+ boost::shared_ptr<GainControl> gain_control;
+ if (sur->temp_mode == BusOnly && get_send (s, get_address (msg))) {
+ gain_control = get_send(s, get_address (msg))->gain_control();
+ } else {
+ gain_control = s->gain_control();
+ }
+ float db = accurate_coefficient_to_dB (gain_control->get_value()) + delta;
float abs;
if (db < -192) {
abs = 0;
} else {
abs = dB_to_coefficient (db);
- float top = s->gain_control()->upper();
+ float top = gain_control->upper();
if (abs > top) {
abs = top;
}
}
- s->gain_control()->set_value (abs, sur->usegroup);
+ gain_control->set_value (abs, sur->usegroup);
return 0;
}
return -1;
{
OSCSurface *sur = get_surface(get_address (msg));
boost::shared_ptr<Stripable> s;
- if (sur->expand_enable) {
- s = get_strip (sur->expand, get_address (msg));
- } else {
- s = _select;
- }
+ s = sur->select;
if (s) {
if (s->gain_control()) {
fake_touch (s->gain_control());
OSCSurface *sur = get_surface(get_address (msg));
if (s) {
+ if ((sur->temp_mode == BusOnly) && (s != sur->select)) {
+ return float_message_with_id (X_("/strip/trimdB"), ssid, 0, sur->feedback[2], get_address (msg));
+ }
if (s->trim_control()) {
s->trim_control()->set_value (level, sur->usegroup);
return 0;
{
OSCSurface *sur = get_surface(get_address (msg));
boost::shared_ptr<Stripable> s;
- if (sur->expand_enable) {
- s = get_strip (sur->expand, get_address (msg));
- } else {
- s = _select;
- }
+ s = sur->select;
if (s) {
if (s->trim_control()) {
s->trim_control()->set_value (dB_to_coefficient (val), PBD::Controllable::NoGroup);
{
OSCSurface *sur = get_surface(get_address (msg));
boost::shared_ptr<Stripable> s;
- if (sur->expand_enable) {
- s = get_strip (sur->expand, get_address (msg));
- } else {
- s = _select;
- }
+ s = sur->select;
if (s) {
if (state != s->is_hidden ()) {
s->presentation_info().set_hidden ((bool) state);
{
OSCSurface *sur = get_surface(get_address (msg));
boost::shared_ptr<Stripable> s;
- if (sur->expand_enable) {
- s = get_strip (sur->expand, get_address (msg));
- } else {
- s = _select;
- }
+ s = sur->select;
if (s) {
if(s->pan_azimuth_control()) {
s->pan_azimuth_control()->set_value (s->pan_azimuth_control()->interface_to_internal (val), PBD::Controllable::NoGroup);
{
OSCSurface *sur = get_surface(get_address (msg));
boost::shared_ptr<Stripable> s;
- if (sur->expand_enable) {
- s = get_strip (sur->expand, get_address (msg));
- } else {
- s = _select;
- }
+ s = sur->select;
if (s) {
if (s->pan_width_control()) {
s->pan_width_control()->set_value (s->pan_width_control()->interface_to_internal (val), PBD::Controllable::NoGroup);
OSCSurface *sur = get_surface(get_address (msg));
if (s) {
- if(s->pan_azimuth_control()) {
- s->pan_azimuth_control()->set_value (s->pan_azimuth_control()->interface_to_internal (pos), sur->usegroup);
+ boost::shared_ptr<PBD::Controllable> pan_control = boost::shared_ptr<PBD::Controllable>();
+ if (sur->temp_mode == BusOnly && get_send (s, get_address (msg))) {
+ boost::shared_ptr<ARDOUR::Send> send = get_send (s, get_address (msg));
+ if (send->pan_outs() > 1) {
+ pan_control = send->panner_shell()->panner()->pannable()->pan_azimuth_control;
+ }
+ } else {
+ pan_control = s->pan_azimuth_control();
+ }
+ if(pan_control) {
+ pan_control->set_value (s->pan_azimuth_control()->interface_to_internal (pos), sur->usegroup);
return 0;
}
}
OSCSurface *sur = get_surface(get_address (msg));
if (s) {
+ if ((sur->temp_mode == BusOnly) && (s != sur->select)) {
+ return float_message_with_id (X_("/strip/pan_stereo_width"), ssid, 1, sur->feedback[2], get_address (msg));
+ }
if (s->pan_width_control()) {
s->pan_width_control()->set_value (pos, sur->usegroup);
return 0;
return float_message_with_id (X_("/select/send_gain"), id, -193, sur->feedback[2], get_address (msg));
}
boost::shared_ptr<Stripable> s;
- if (sur->expand_enable) {
- s = get_strip (sur->expand, get_address (msg));
- } else {
- s = _select;
- }
+ s = sur->select;
float abs;
int send_id = 0;
if (s) {
return float_message_with_id (X_("/select/send_fader"), id, 0, sur->feedback[2], get_address (msg));
}
boost::shared_ptr<Stripable> s;
- if (sur->expand_enable) {
- s = get_strip (sur->expand, get_address (msg));
- } else {
- s = _select;
- }
+ s = sur->select;
float abs;
int send_id = 0;
if (s) {
return float_message_with_id (X_("/select/send_enable"), id, 0, sur->feedback[2], get_address (msg));
}
boost::shared_ptr<Stripable> s;
- if (sur->expand_enable) {
- s = get_strip (sur->expand, get_address (msg));
- } else {
- s = _select;
- }
+ s = sur->select;
int send_id = 0;
if (s) {
if (id > 0) {
{
OSCSurface *sur = get_surface(get_address (msg));
boost::shared_ptr<Stripable> s;
- if (sur->expand_enable) {
- s = get_strip (sur->expand, get_address (msg));
- } else {
- s = _select;
- }
+ s = sur->select;
if (s) {
if (s->master_send_enable_controllable ()) {
s->master_send_enable_controllable()->set_value (state, PBD::Controllable::NoGroup);
{
OSCSurface *sur = get_surface(get_address (msg));
boost::shared_ptr<Stripable> s;
- if (sur->expand_enable) {
- s = get_strip (sur->expand, get_address (msg));
- } else {
- s = _select;
- }
+ s = sur->select;
if (s) {
if (s->pan_elevation_control()) {
s->pan_elevation_control()->set_value (s->pan_elevation_control()->interface_to_internal (val), PBD::Controllable::NoGroup);
{
OSCSurface *sur = get_surface(get_address (msg));
boost::shared_ptr<Stripable> s;
- if (sur->expand_enable) {
- s = get_strip (sur->expand, get_address (msg));
- } else {
- s = _select;
- }
+ s = sur->select;
if (s) {
if (s->pan_frontback_control()) {
s->pan_frontback_control()->set_value (s->pan_frontback_control()->interface_to_internal (val), PBD::Controllable::NoGroup);
{
OSCSurface *sur = get_surface(get_address (msg));
boost::shared_ptr<Stripable> s;
- if (sur->expand_enable) {
- s = get_strip (sur->expand, get_address (msg));
- } else {
- s = _select;
- }
+ s = sur->select;
if (s) {
if (s->pan_lfe_control()) {
s->pan_lfe_control()->set_value (s->pan_lfe_control()->interface_to_internal (val), PBD::Controllable::NoGroup);
{
OSCSurface *sur = get_surface(get_address (msg));
boost::shared_ptr<Stripable> s;
- if (sur->expand_enable) {
- s = get_strip (sur->expand, get_address (msg));
- } else {
- s = _select;
- }
+ s = sur->select;
if (s) {
if (s->comp_enable_controllable()) {
s->comp_enable_controllable()->set_value (s->comp_enable_controllable()->interface_to_internal (val), PBD::Controllable::NoGroup);
{
OSCSurface *sur = get_surface(get_address (msg));
boost::shared_ptr<Stripable> s;
- if (sur->expand_enable) {
- s = get_strip (sur->expand, get_address (msg));
- } else {
- s = _select;
- }
+ s = sur->select;
if (s) {
if (s->comp_threshold_controllable()) {
s->comp_threshold_controllable()->set_value (s->comp_threshold_controllable()->interface_to_internal (val), PBD::Controllable::NoGroup);
{
OSCSurface *sur = get_surface(get_address (msg));
boost::shared_ptr<Stripable> s;
- if (sur->expand_enable) {
- s = get_strip (sur->expand, get_address (msg));
- } else {
- s = _select;
- }
+ s = sur->select;
if (s) {
if (s->comp_speed_controllable()) {
s->comp_speed_controllable()->set_value (s->comp_speed_controllable()->interface_to_internal (val), PBD::Controllable::NoGroup);
{
OSCSurface *sur = get_surface(get_address (msg));
boost::shared_ptr<Stripable> s;
- if (sur->expand_enable) {
- s = get_strip (sur->expand, get_address (msg));
- } else {
- s = _select;
- }
+ s = sur->select;
if (s) {
if (s->comp_mode_controllable()) {
s->comp_mode_controllable()->set_value (s->comp_mode_controllable()->interface_to_internal (val), PBD::Controllable::NoGroup);
{
OSCSurface *sur = get_surface(get_address (msg));
boost::shared_ptr<Stripable> s;
- if (sur->expand_enable) {
- s = get_strip (sur->expand, get_address (msg));
- } else {
- s = _select;
- }
+ s = sur->select;
if (s) {
if (s->comp_makeup_controllable()) {
s->comp_makeup_controllable()->set_value (s->comp_makeup_controllable()->interface_to_internal (val), PBD::Controllable::NoGroup);
{
OSCSurface *sur = get_surface(get_address (msg));
boost::shared_ptr<Stripable> s;
- if (sur->expand_enable) {
- s = get_strip (sur->expand, get_address (msg));
- } else {
- s = _select;
- }
+ s = sur->select;
if (s) {
if (s->eq_enable_controllable()) {
s->eq_enable_controllable()->set_value (s->eq_enable_controllable()->interface_to_internal (val), PBD::Controllable::NoGroup);
{
OSCSurface *sur = get_surface(get_address (msg));
boost::shared_ptr<Stripable> s;
- if (sur->expand_enable) {
- s = get_strip (sur->expand, get_address (msg));
- } else {
- s = _select;
- }
+ s = sur->select;
if (s) {
if (s->filter_freq_controllable(true)) {
s->filter_freq_controllable(true)->set_value (s->filter_freq_controllable(true)->interface_to_internal (val), PBD::Controllable::NoGroup);
{
OSCSurface *sur = get_surface(get_address (msg));
boost::shared_ptr<Stripable> s;
- if (sur->expand_enable) {
- s = get_strip (sur->expand, get_address (msg));
- } else {
- s = _select;
- }
+ s = sur->select;
if (s) {
if (s->filter_freq_controllable(false)) {
s->filter_freq_controllable(false)->set_value (s->filter_freq_controllable(false)->interface_to_internal (val), PBD::Controllable::NoGroup);
{
OSCSurface *sur = get_surface(get_address (msg));
boost::shared_ptr<Stripable> s;
- if (sur->expand_enable) {
- s = get_strip (sur->expand, get_address (msg));
- } else {
- s = _select;
- }
+ s = sur->select;
if (s) {
if (s->filter_enable_controllable(true)) {
s->filter_enable_controllable(true)->set_value (s->filter_enable_controllable(true)->interface_to_internal (val), PBD::Controllable::NoGroup);
{
OSCSurface *sur = get_surface(get_address (msg));
boost::shared_ptr<Stripable> s;
- if (sur->expand_enable) {
- s = get_strip (sur->expand, get_address (msg));
- } else {
- s = _select;
- }
+ s = sur->select;
if (s) {
if (s->filter_enable_controllable(false)) {
s->filter_enable_controllable(false)->set_value (s->filter_enable_controllable(false)->interface_to_internal (val), PBD::Controllable::NoGroup);
{
OSCSurface *sur = get_surface(get_address (msg));
boost::shared_ptr<Stripable> s;
- if (sur->expand_enable) {
- s = get_strip (sur->expand, get_address (msg));
- } else {
- s = _select;
- }
+ s = sur->select;
if (s) {
if (s->filter_slope_controllable(true)) {
s->filter_slope_controllable(true)->set_value (s->filter_slope_controllable(true)->interface_to_internal (val), PBD::Controllable::NoGroup);
{
OSCSurface *sur = get_surface(get_address (msg));
boost::shared_ptr<Stripable> s;
- if (sur->expand_enable) {
- s = get_strip (sur->expand, get_address (msg));
- } else {
- s = _select;
- }
+ s = sur->select;
if (s) {
if (s->filter_slope_controllable(false)) {
s->filter_slope_controllable(false)->set_value (s->filter_slope_controllable(false)->interface_to_internal (val), PBD::Controllable::NoGroup);
{
OSCSurface *sur = get_surface(get_address (msg));
boost::shared_ptr<Stripable> s;
- if (sur->expand_enable) {
- s = get_strip (sur->expand, get_address (msg));
- } else {
- s = _select;
- }
+ s = sur->select;
if (s) {
if (id > 0) {
--id;
{
OSCSurface *sur = get_surface(get_address (msg));
boost::shared_ptr<Stripable> s;
- if (sur->expand_enable) {
- s = get_strip (sur->expand, get_address (msg));
- } else {
- s = _select;
- }
+ s = sur->select;
if (s) {
if (id > 0) {
--id;
{
OSCSurface *sur = get_surface(get_address (msg));
boost::shared_ptr<Stripable> s;
- if (sur->expand_enable) {
- s = get_strip (sur->expand, get_address (msg));
- } else {
- s = _select;
- }
+ s = sur->select;
if (s) {
if (id > 0) {
--id;
{
OSCSurface *sur = get_surface(get_address (msg));
boost::shared_ptr<Stripable> s;
- if (sur->expand_enable) {
- s = get_strip (sur->expand, get_address (msg));
- } else {
- s = _select;
- }
+ s = sur->select;
if (s) {
if (id > 0) {
--id;
int
OSC::float_message (string path, float val, lo_address addr)
{
+ _lo_lock.lock ();
lo_message reply;
reply = lo_message_new ();
lo_message_add_float (reply, (float) val);
lo_send_message (addr, path.c_str(), reply);
+ Glib::usleep(1);
lo_message_free (reply);
+ _lo_lock.unlock ();
return 0;
}
int
OSC::float_message_with_id (std::string path, uint32_t ssid, float value, bool in_line, lo_address addr)
{
+ _lo_lock.lock ();
lo_message msg = lo_message_new ();
if (in_line) {
path = string_compose ("%1/%2", path, ssid);
lo_message_add_float (msg, value);
lo_send_message (addr, path.c_str(), msg);
+ Glib::usleep(1);
lo_message_free (msg);
+ _lo_lock.unlock ();
return 0;
}
int
OSC::int_message (string path, int val, lo_address addr)
{
+ _lo_lock.lock ();
lo_message reply;
reply = lo_message_new ();
lo_message_add_int32 (reply, (float) val);
lo_send_message (addr, path.c_str(), reply);
+ Glib::usleep(1);
lo_message_free (reply);
+ _lo_lock.unlock ();
return 0;
}
int
OSC::int_message_with_id (std::string path, uint32_t ssid, int value, bool in_line, lo_address addr)
{
+ _lo_lock.lock ();
lo_message msg = lo_message_new ();
if (in_line) {
path = string_compose ("%1/%2", path, ssid);
lo_message_add_int32 (msg, value);
lo_send_message (addr, path.c_str(), msg);
+ Glib::usleep(1);
lo_message_free (msg);
+ _lo_lock.unlock ();
return 0;
}
int
OSC::text_message (string path, string val, lo_address addr)
{
+ _lo_lock.lock ();
lo_message reply;
reply = lo_message_new ();
lo_message_add_string (reply, val.c_str());
lo_send_message (addr, path.c_str(), reply);
+ Glib::usleep(1);
lo_message_free (reply);
+ _lo_lock.unlock ();
return 0;
}
int
OSC::text_message_with_id (std::string path, uint32_t ssid, std::string val, bool in_line, lo_address addr)
{
+ _lo_lock.lock ();
lo_message msg = lo_message_new ();
if (in_line) {
path = string_compose ("%1/%2", path, ssid);
lo_message_add_string (msg, val.c_str());
lo_send_message (addr, path.c_str(), msg);
+ Glib::usleep(1);
lo_message_free (msg);
+ _lo_lock.unlock ();
return 0;
}