summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPaul Davis <paul@linuxaudiosystems.com>2012-04-16 13:06:39 +0000
committerPaul Davis <paul@linuxaudiosystems.com>2012-04-16 13:06:39 +0000
commit02c498a8fa1c2e47988a256321bdcf5e9e869de1 (patch)
tree8a7d35722e55a25f32b18ec1934a3a423cfe8497
parent8367cacf150be852b9baf308caebe23603f36ff6 (diff)
MCP: make v-pot press work; work ongoing on general keybindings
git-svn-id: svn://localhost/ardour2/branches/3.0@11985 d708f5d6-7413-0410-9779-e7cbd77b26cf
-rw-r--r--libs/surfaces/mackie/device_info.h12
-rw-r--r--libs/surfaces/mackie/gui.cc2
-rw-r--r--libs/surfaces/mackie/mackie_control_protocol.cc42
-rw-r--r--libs/surfaces/mackie/mackie_control_protocol.h3
-rw-r--r--libs/surfaces/mackie/mcp_buttons.cc11
-rw-r--r--libs/surfaces/mackie/strip.cc49
6 files changed, 70 insertions, 49 deletions
diff --git a/libs/surfaces/mackie/device_info.h b/libs/surfaces/mackie/device_info.h
index e7f0bc7166..287bed5c0e 100644
--- a/libs/surfaces/mackie/device_info.h
+++ b/libs/surfaces/mackie/device_info.h
@@ -104,6 +104,18 @@ class DeviceProfile
const std::string& get_f_action (uint32_t fn, int modifier_state);
void set_f_action (uint32_t fn, int modifier_state, const std::string&);
+
+ private:
+ struct KeyActions {
+ std::string plain;
+ std::string control;
+ std::string shift;
+ std::string option;
+ std::string cmdalt;
+ std::string shiftcontrol;
+ };
+
+ typedef std::map<Button::ID,KeyActions> KeyActionMap;
};
}
diff --git a/libs/surfaces/mackie/gui.cc b/libs/surfaces/mackie/gui.cc
index 6ca76d4c0e..1086e44bfb 100644
--- a/libs/surfaces/mackie/gui.cc
+++ b/libs/surfaces/mackie/gui.cc
@@ -240,7 +240,7 @@ MackieControlProtocolGUI::rebuild_function_key_editor ()
row = *(function_key_model->append());
row[function_key_columns.name] = string_compose ("F%1", n+1);
row[function_key_columns.number] = n;
- row[function_key_columns.plain] = _cp.f_action (n, 0);
+ row[function_key_columns.plain] = ""; // _cp.f_action (n, 0);
row[function_key_columns.control] = "c";
row[function_key_columns.option] = "o";
row[function_key_columns.shift] = "s";
diff --git a/libs/surfaces/mackie/mackie_control_protocol.cc b/libs/surfaces/mackie/mackie_control_protocol.cc
index c0ad5fde1f..c681d5ac89 100644
--- a/libs/surfaces/mackie/mackie_control_protocol.cc
+++ b/libs/surfaces/mackie/mackie_control_protocol.cc
@@ -615,12 +615,6 @@ MackieControlProtocol::get_state()
os << _current_initial_bank;
node->add_property (X_("bank"), os.str());
- for (uint32_t n = 0; n < 16; ++n) {
- ostringstream s;
- s << string_compose ("f%1-action", n+1);
- node->add_property (s.str().c_str(), f_action (n));
- }
-
return *node;
}
@@ -642,23 +636,6 @@ MackieControlProtocol::set_state (const XMLNode & node, int /*version*/)
}
}
- _f_actions.clear ();
- _f_actions.resize (16);
-
- for (uint32_t n = 0; n < 16; ++n) {
- string action;
- if ((prop = node.property (string_compose ("f%1-action", n+1))) != 0) {
- action = prop->value();
- }
-
- if (action.empty()) {
- /* default action if nothing is specified */
- action = string_compose ("Editor/goto-visual-state-%1", n+1);
- }
-
- _f_actions[n] = action;
- }
-
return retval;
}
@@ -1140,25 +1117,6 @@ MackieControlProtocol::clear_ports ()
port_sources.clear ();
}
-string
-MackieControlProtocol::f_action (uint32_t fn, uint32_t /* modifier */)
-{
- if (fn >= _f_actions.size()) {
- return string();
- }
-
- return _f_actions[fn];
-}
-
-void
-MackieControlProtocol::f_press (uint32_t fn)
-{
- string action = f_action (0);
- if (!action.empty()) {
- access_action (action);
- }
-}
-
void
MackieControlProtocol::set_view_mode (ViewMode m)
{
diff --git a/libs/surfaces/mackie/mackie_control_protocol.h b/libs/surfaces/mackie/mackie_control_protocol.h
index cab0521a54..ea3e69d9a7 100644
--- a/libs/surfaces/mackie/mackie_control_protocol.h
+++ b/libs/surfaces/mackie/mackie_control_protocol.h
@@ -191,8 +191,6 @@ class MackieControlProtocol
void remove_down_select_button (int surface, int strip);
void select_range ();
- std::string f_action (uint32_t fn, uint32_t modifier = 0);
-
protected:
// shut down the surface
void close();
@@ -279,7 +277,6 @@ class MackieControlProtocol
int _current_selected_track;
int _modifier_state;
PortSources port_sources;
- std::vector<std::string> _f_actions;
ButtonMap button_map;
void create_surfaces ();
diff --git a/libs/surfaces/mackie/mcp_buttons.cc b/libs/surfaces/mackie/mcp_buttons.cc
index 5999220c52..4032785a3b 100644
--- a/libs/surfaces/mackie/mcp_buttons.cc
+++ b/libs/surfaces/mackie/mcp_buttons.cc
@@ -663,6 +663,17 @@ MackieControlProtocol::enter_release (Button &)
{
return off;
}
+
+void
+MackieControlProtocol::f_press (uint32_t fn)
+{
+#if 0
+ string action = f_action (0);
+ if (!action.empty()) {
+ access_action (action);
+ }
+#endif
+}
LedState
MackieControlProtocol::F1_press (Button &)
{
diff --git a/libs/surfaces/mackie/strip.cc b/libs/surfaces/mackie/strip.cc
index a00a75dffd..e8a2415cfe 100644
--- a/libs/surfaces/mackie/strip.cc
+++ b/libs/surfaces/mackie/strip.cc
@@ -399,7 +399,19 @@ Strip::handle_button (Button& button, ButtonState bs)
return;
}
-
+
+ if (button.bid() == Button::VSelect) {
+ if (bs == press) {
+ /* swap controls on the vpot */
+ boost::shared_ptr<AutomationControl> ac = button.control (true);
+ button.set_modified_control (button.control (false));
+ button.set_normal_control (ac);
+ _surface->write (display (1, static_display_string ()));
+ }
+
+ return;
+ }
+
if (button.bid() == Button::FaderTouch) {
DEBUG_TRACE (DEBUG::MackieControl, string_compose ("fader touch, press ? %1\n", (bs == press)));
@@ -663,11 +675,42 @@ Strip::gui_selection_changed (ARDOUR::RouteNotificationListPtr rl)
string
Strip::static_display_string () const
{
- if (_surface->mcp().flip_mode()) {
+ if (!_vpot) {
+ return string();
+ }
+
+ boost::shared_ptr<AutomationControl> ac = _vpot->control (false);
+
+ if (!ac) {
+ return string();
+ }
+
+ /* don't use canonical controllable names here because we're
+ * limited by space concerns
+ */
+
+ switch((AutomationType)ac->parameter().type()) {
+ case GainAutomation:
return "Fader";
- } else {
+ break;
+ case PanAzimuthAutomation:
return "Pan";
+ break;
+ case PanWidthAutomation:
+ return "Width";
+ break;
+ case PanElevationAutomation:
+ case PanFrontBackAutomation:
+ case PanLFEAutomation:
+ break;
+ case PluginAutomation:
+ return string_compose ("Param %d", ac->parameter().id());
+ break;
+ default:
+ break;
}
+
+ return "???";
}
void