From d5016f80d31c90bbb657f685f978040ab1ed3b89 Mon Sep 17 00:00:00 2001 From: Len Ovens Date: Mon, 17 Aug 2020 10:38:16 -0700 Subject: [PATCH] Added automation control to the rest stripable controls Pan azimuth Pan Width trim mute --- libs/surfaces/osc/osc.cc | 39 ++++++++++++++++++++++-- libs/surfaces/osc/osc_route_observer.cc | 2 +- libs/surfaces/osc/osc_route_observer.h | 2 +- libs/surfaces/osc/osc_select_observer.cc | 2 +- 4 files changed, 40 insertions(+), 5 deletions(-) diff --git a/libs/surfaces/osc/osc.cc b/libs/surfaces/osc/osc.cc index 7f1606079a..6887722480 100644 --- a/libs/surfaces/osc/osc.cc +++ b/libs/surfaces/osc/osc.cc @@ -3811,14 +3811,49 @@ OSC::set_automation (const char *path, const char* types, lo_arg **argv, int arg boost::shared_ptr control = boost::shared_ptr(); // other automatable controls can be added by repeating the next 6.5 lines if ((!strncmp (&path[ctr], X_("fader"), 5)) || (!strncmp (&path[ctr], X_("gain"), 4))) { - if (strp->gain_control ()) { + if (send) { + control = send->gain_control (); + } else if (strp->gain_control ()) { control = strp->gain_control (); } else { PBD::warning << "No fader for this strip" << endmsg; } + } else if (!strncmp (&path[ctr], X_("pan"), 3)) { if (send) { - control = send->gain_control (); + if (send->panner_linked_to_route () || !send->has_panner ()) { + PBD::warning << "Send panner not available" << endmsg; + } else { + boost::shared_ptr _send_del = boost::dynamic_pointer_cast (send); + boost::shared_ptr pannable = _send_del->panner()->pannable(); + if (pannable->pan_azimuth_control) { + control = pannable->pan_azimuth_control; + } else { + PBD::warning << "Automation not available for " << path << endmsg; + } + } + } else if (strp->pan_azimuth_control ()) { + control = strp->pan_azimuth_control (); + } else { + PBD::warning << "Automation not available for " << path << endmsg; } + + } else if (!strncmp (&path[ctr], X_("trimdB"), 6)) { + if (send) { + PBD::warning << "Send trim not available" << endmsg; + } else if (strp->trim_control ()) { + control = strp->trim_control (); + } else { + PBD::warning << "No trim for this strip" << endmsg; + } + } else if (!strncmp (&path[ctr], X_("mute"), 4)) { + if (send) { + PBD::warning << "Send mute not automatable" << endmsg; + } else if (strp->mute_control ()) { + control = strp->mute_control (); + } else { + PBD::warning << "No trim for this strip" << endmsg; + } + } else { PBD::warning << "Automation not available for " << path << endmsg; } diff --git a/libs/surfaces/osc/osc_route_observer.cc b/libs/surfaces/osc/osc_route_observer.cc index 82c40d116e..13cfefa977 100644 --- a/libs/surfaces/osc/osc_route_observer.cc +++ b/libs/surfaces/osc/osc_route_observer.cc @@ -2,7 +2,7 @@ * Copyright (C) 2010-2016 Paul Davis * Copyright (C) 2011 Carl Hetherington * Copyright (C) 2015-2017 Robin Gareus - * Copyright (C) 2016-2018 Len Ovens + * Copyright (C) 2016-2020 Len Ovens * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by diff --git a/libs/surfaces/osc/osc_route_observer.h b/libs/surfaces/osc/osc_route_observer.h index 460ddaec7b..2990442d69 100644 --- a/libs/surfaces/osc/osc_route_observer.h +++ b/libs/surfaces/osc/osc_route_observer.h @@ -1,6 +1,6 @@ /* * Copyright (C) 2010-2015 Paul Davis - * Copyright (C) 2016-2018 Len Ovens + * Copyright (C) 2016-2020 Len Ovens * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by diff --git a/libs/surfaces/osc/osc_select_observer.cc b/libs/surfaces/osc/osc_select_observer.cc index 16b8f2e657..ffea877e31 100644 --- a/libs/surfaces/osc/osc_select_observer.cc +++ b/libs/surfaces/osc/osc_select_observer.cc @@ -1,6 +1,6 @@ /* * Copyright (C) 2016-2017 Robin Gareus - * Copyright (C) 2016-2018 Len Ovens + * Copyright (C) 2016-2020 Len Ovens * Copyright (C) 2016 Paul Davis * * This program is free software; you can redistribute it and/or modify