-/* Faderport 8 Control Surface
- * This is the button "View" of the MVC surface inteface,
- * see actions.cc for the "Controller"
- *
+/*
* Copyright (C) 2017 Robin Gareus <robin@gareus.org>
*
- * 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 the Free Software Foundation; either version 2
- * of the License, or (at your option) any later version.
+ * 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
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ * You should have received a copy of the GNU General Public License along
+ * with this program; if not, write to the Free Software Foundation, Inc.,
+ * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
+ */
+
+/* Faderport 8 Control Surface
+ * This is the button "View" of the MVC surface inteface,
+ * see actions.cc for the "Controller"
*/
#include "ardour/plugin_insert.h"
#include "pbd/i18n.h"
using namespace ARDOUR;
-using namespace ArdourSurface;
-using namespace ArdourSurface::FP8Types;
+using namespace ArdourSurface::FP_NAMESPACE;
+using namespace ArdourSurface::FP_NAMESPACE::FP8Types;
void
FaderPort8::connect_session_signals ()
notify_mute_changed ();
notify_parameter_changed ("clicking");
- notify_automation_mode_changed (); // XXX (stip specific, see below)
+ notify_route_state_changed (); // XXX (stip specific, see below)
}
-// TODO: AutomationState display of plugin & send automation ?!
+// TODO: AutomationState display of plugin & send automation
+// TODO: link/lock control AS.
void
-FaderPort8::notify_automation_mode_changed ()
+FaderPort8::notify_route_state_changed ()
{
boost::shared_ptr<Stripable> s = first_selected_stripable();
boost::shared_ptr<AutomationControl> ac;
_ctrls.button (FP8Controls::BtnATouch).set_active (false);
_ctrls.button (FP8Controls::BtnARead).set_active (false);
_ctrls.button (FP8Controls::BtnAWrite).set_active (false);
+#ifdef FADERPORT2
+ _ctrls.button (FP8Controls::BtnArm).set_active (false);
+#endif
return;
}
_ctrls.button (FP8Controls::BtnATouch).set_active (as == Touch);
_ctrls.button (FP8Controls::BtnARead).set_active (as == Play);
_ctrls.button (FP8Controls::BtnAWrite).set_active (as == Write);
+ _ctrls.button (FP8Controls::BtnALatch).set_active (as == Latch);
+
+#ifdef FADERPORT2
+ /* handle the Faderport's track-arm button */
+ ac = s->rec_enable_control ();
+ _ctrls.button (FP8Controls::BtnArm).set_active (ac ? ac->get_value() : false);
+#endif
}
void
FaderPort8::notify_solo_changed ()
{
bool soloing = session->soloing() || session->listening();
+#ifdef MIXBUS
+ soloing |= session->mixbus_soloed();
+#endif
_ctrls.button (FP8Controls::BtnSoloClear).set_active (soloing);
#ifdef FP8_MUTESOLO_UNDO
if (soloing) {
_ctrls.button (FP8Controls::BtnBypass).set_color (0x888888ff);
}
}
+
+void
+FaderPort8::nofity_focus_control (boost::weak_ptr<PBD::Controllable> c)
+{
+ assert (_link_enabled && !_link_locked);
+ // TODO consider subscribing to c's DropReferences
+ // (in case the control goes away while it has focus, update the BtnColor)
+ _link_control = c;
+ if (c.expired () || 0 == boost::dynamic_pointer_cast<AutomationControl> (_link_control.lock ())) {
+ _ctrls.button (FP8Controls::BtnLink).set_color (0xff8800ff);
+ _ctrls.button (FP8Controls::BtnLock).set_color (0xff0000ff);
+ } else {
+ _ctrls.button (FP8Controls::BtnLink).set_color (0x88ff00ff);
+ _ctrls.button (FP8Controls::BtnLock).set_color (0x00ff88ff);
+ }
+}