summaryrefslogtreecommitdiff
path: root/libs
diff options
context:
space:
mode:
authorBen Loftis <ben@harrisonconsoles.com>2015-11-25 17:33:42 -0600
committerBen Loftis <ben@harrisonconsoles.com>2015-11-25 17:33:49 -0600
commitd138f8981d063a58b49be20fe890748591e81c2f (patch)
treed4dfcaad19c0ca61877cca6d43e0189f40a5a53c /libs
parentd6186fba3257b205fb2c4c10ba17364d0489e83c (diff)
implement more Faderport buttons (window and fader automation). ToDo: automation LEDs, fader banking
Diffstat (limited to 'libs')
-rw-r--r--libs/surfaces/faderport/faderport.cc22
-rw-r--r--libs/surfaces/faderport/faderport.h17
-rw-r--r--libs/surfaces/faderport/operations.cc68
3 files changed, 99 insertions, 8 deletions
diff --git a/libs/surfaces/faderport/faderport.cc b/libs/surfaces/faderport/faderport.cc
index a8f8938069..7d97e351e9 100644
--- a/libs/surfaces/faderport/faderport.cc
+++ b/libs/surfaces/faderport/faderport.cc
@@ -100,10 +100,10 @@ FaderPort::FaderPort (Session& s)
buttons.insert (std::make_pair (Bank, ButtonInfo (*this, _("Bank"), Bank, 19)));
buttons.insert (std::make_pair (Right, ButtonInfo (*this, _("Right"), Right, 18)));
buttons.insert (std::make_pair (Output, ButtonInfo (*this, _("Output"), Output, 17)));
- buttons.insert (std::make_pair (Read, ButtonInfo (*this, _("Read"), Read, 13)));
- buttons.insert (std::make_pair (Write, ButtonInfo (*this, _("Write"), Write, 14)));
- buttons.insert (std::make_pair (Touch, ButtonInfo (*this, _("Touch"), Touch, 15)));
- buttons.insert (std::make_pair (Off, ButtonInfo (*this, _("Off"), Off, 16)));
+ buttons.insert (std::make_pair (FP_Read, ButtonInfo (*this, _("Read"), FP_Read, 13)));
+ buttons.insert (std::make_pair (FP_Write, ButtonInfo (*this, _("Write"), FP_Write, 14)));
+ buttons.insert (std::make_pair (FP_Touch, ButtonInfo (*this, _("Touch"), FP_Touch, 15)));
+ buttons.insert (std::make_pair (FP_Off, ButtonInfo (*this, _("Off"), FP_Off, 16)));
buttons.insert (std::make_pair (Mix, ButtonInfo (*this, _("Mix"), Mix, 12)));
buttons.insert (std::make_pair (Proj, ButtonInfo (*this, _("Proj"), Proj, 11)));
buttons.insert (std::make_pair (Trns, ButtonInfo (*this, _("Trns"), Trns, 10)));
@@ -119,10 +119,22 @@ FaderPort::FaderPort (Session& s)
buttons.insert (std::make_pair (RecEnable, ButtonInfo (*this, _("RecEnable"), RecEnable, 0)));
buttons.insert (std::make_pair (FaderTouch, ButtonInfo (*this, _("Fader (touch)"), FaderTouch, -1)));
+ button_info (Mix).set_action ( string("Common/toggle-editor-mixer"), true);
+ button_info (Proj).set_action ( string("Common/toggle-meterbridge"), true);
+ button_info (Trns).set_action ( string("Window/toggle-locations"), true);
+
+ button_info (Left).set_action ( boost::bind (&FaderPort::left, this), true);
+ button_info (Right).set_action ( boost::bind (&FaderPort::right, this), true);
+
button_info (Undo).set_action (boost::bind (&FaderPort::undo, this), true);
button_info (Undo).set_action (boost::bind (&FaderPort::redo, this), true, ShiftDown);
button_info (Undo).set_flash (true);
+ button_info (FP_Read).set_action (boost::bind (&FaderPort::read, this), true);
+ button_info (FP_Write).set_action (boost::bind (&FaderPort::write, this), true);
+ button_info (FP_Touch).set_action (boost::bind (&FaderPort::touch, this), true);
+ button_info (FP_Off).set_action (boost::bind (&FaderPort::off, this), true);
+
button_info (Play).set_action (boost::bind (&BasicUI::transport_play, this, true), true);
button_info (RecEnable).set_action (boost::bind (&BasicUI::rec_enable_toggle, this), true);
/* Stop is a modifier, so we have to use its own button state to get
@@ -796,6 +808,8 @@ FaderPort::set_current_route (boost::shared_ptr<Route> r)
mp->cut_control()->Changed.connect (route_connections, MISSING_INVALIDATOR, boost::bind (&FaderPort::map_cut, this), this);
}
}
+
+ //ToDo: subscribe to the fader automation modes so we can light the LEDs
map_route_state ();
}
diff --git a/libs/surfaces/faderport/faderport.h b/libs/surfaces/faderport/faderport.h
index cec673c743..cb5330f1c0 100644
--- a/libs/surfaces/faderport/faderport.h
+++ b/libs/surfaces/faderport/faderport.h
@@ -148,10 +148,10 @@ class FaderPort : public ARDOUR::ControlProtocol, public AbstractUI<FaderPortReq
Bank = 20,
Right = 21,
Output = 22,
- Read = 10,
- Write = 9,
- Touch = 8,
- Off = 23,
+ FP_Read = 10,
+ FP_Write = 9,
+ FP_Touch = 8,
+ FP_Off = 23,
Mix = 11,
Proj = 12,
Trns = 13,
@@ -264,6 +264,15 @@ class FaderPort : public ARDOUR::ControlProtocol, public AbstractUI<FaderPortReq
/* operations (defined in operations.cc) */
+ void read ();
+ void write ();
+
+ void left ();
+ void right ();
+
+ void touch ();
+ void off ();
+
void undo ();
void redo ();
void solo ();
diff --git a/libs/surfaces/faderport/operations.cc b/libs/surfaces/faderport/operations.cc
index 3c4d27a345..fd9930be0c 100644
--- a/libs/surfaces/faderport/operations.cc
+++ b/libs/surfaces/faderport/operations.cc
@@ -22,6 +22,7 @@
#include "ardour/rc_configuration.h"
#include "ardour/session.h"
#include "ardour/track.h"
+#include "ardour/types.h"
#include "faderport.h"
@@ -29,6 +30,73 @@ using namespace ARDOUR;
using namespace ArdourSurface;
void
+FaderPort::left ()
+{
+ access_action ("Editor/select-prev-route");
+
+ //ToDo: bank by 8?
+ //if ( (button_state & ShiftDown) == ShiftDown )
+
+}
+
+void
+FaderPort::right ()
+{
+ access_action ("Editor/select-next-route");
+
+ //ToDo: bank by 8?
+ //if ( (button_state & ShiftDown) == ShiftDown )
+}
+
+
+void
+FaderPort::read ()
+{
+ if (_current_route) {
+ boost::shared_ptr<AutomationControl> gain = _current_route->gain_control ();
+ if (gain) {
+ gain->set_automation_state( (ARDOUR::AutoState) ARDOUR::Play );
+ }
+ }
+}
+
+void
+FaderPort::write ()
+{
+ if (_current_route) {
+ boost::shared_ptr<AutomationControl> gain = _current_route->gain_control ();
+ if (gain) {
+ gain->set_automation_state( (ARDOUR::AutoState) ARDOUR::Write );
+ }
+ }
+}
+
+void
+FaderPort::touch ()
+{
+ if (_current_route) {
+ boost::shared_ptr<AutomationControl> gain = _current_route->gain_control ();
+ if (gain) {
+ gain->set_automation_state( (ARDOUR::AutoState) ARDOUR::Touch );
+ }
+ }
+}
+
+void
+FaderPort::off ()
+{
+ if (_current_route) {
+ boost::shared_ptr<AutomationControl> gain = _current_route->gain_control ();
+ if (gain) {
+ gain->set_automation_state( (ARDOUR::AutoState) ARDOUR::Off );
+ }
+ }
+}
+
+
+
+
+void
FaderPort::undo ()
{
ControlProtocol::Undo (); /* EMIT SIGNAL */