mirror of
https://github.com/Ardour/ardour.git
synced 2025-12-09 16:24:57 +01:00
mackie: reverse previous profile editor changes; allow profile to define anything except plain and shift actions.
For Fn keys we also allow plain and shift definitions
This commit is contained in:
parent
aefa63aaa6
commit
d3081fd816
1 changed files with 43 additions and 47 deletions
|
|
@ -54,8 +54,6 @@ using namespace Gtk;
|
||||||
using namespace ArdourSurface;
|
using namespace ArdourSurface;
|
||||||
using namespace Mackie;
|
using namespace Mackie;
|
||||||
|
|
||||||
#define SHIFT_IS_THE_ONLY_MODIFIER
|
|
||||||
|
|
||||||
void*
|
void*
|
||||||
MackieControlProtocol::get_gui () const
|
MackieControlProtocol::get_gui () const
|
||||||
{
|
{
|
||||||
|
|
@ -205,9 +203,11 @@ MackieControlProtocolGUI::MackieControlProtocolGUI (MackieControlProtocol& p)
|
||||||
vector<string> profiles;
|
vector<string> profiles;
|
||||||
|
|
||||||
for (std::map<std::string,DeviceProfile>::iterator i = DeviceProfile::device_profiles.begin(); i != DeviceProfile::device_profiles.end(); ++i) {
|
for (std::map<std::string,DeviceProfile>::iterator i = DeviceProfile::device_profiles.begin(); i != DeviceProfile::device_profiles.end(); ++i) {
|
||||||
|
cerr << "add discovered profile " << i->first << endl;
|
||||||
profiles.push_back (i->first);
|
profiles.push_back (i->first);
|
||||||
}
|
}
|
||||||
Gtkmm2ext::set_popdown_strings (_profile_combo, profiles);
|
Gtkmm2ext::set_popdown_strings (_profile_combo, profiles);
|
||||||
|
cerr << "set active profile from " << p.device_profile().name() << endl;
|
||||||
_profile_combo.set_active_text (p.device_profile().name());
|
_profile_combo.set_active_text (p.device_profile().name());
|
||||||
_profile_combo.signal_changed().connect (sigc::mem_fun (*this, &MackieControlProtocolGUI::profile_combo_changed));
|
_profile_combo.signal_changed().connect (sigc::mem_fun (*this, &MackieControlProtocolGUI::profile_combo_changed));
|
||||||
|
|
||||||
|
|
@ -479,7 +479,6 @@ MackieControlProtocolGUI::build_available_action_menu ()
|
||||||
rowp = available_action_model->append();
|
rowp = available_action_model->append();
|
||||||
parent = *(rowp);
|
parent = *(rowp);
|
||||||
parent[available_action_columns.name] = _("Shift");
|
parent[available_action_columns.name] = _("Shift");
|
||||||
#ifndef SHIFT_IS_THE_ONLY_MODIFIER
|
|
||||||
rowp = available_action_model->append();
|
rowp = available_action_model->append();
|
||||||
parent = *(rowp);
|
parent = *(rowp);
|
||||||
parent[available_action_columns.name] = _("Control");
|
parent[available_action_columns.name] = _("Control");
|
||||||
|
|
@ -489,7 +488,6 @@ MackieControlProtocolGUI::build_available_action_menu ()
|
||||||
rowp = available_action_model->append();
|
rowp = available_action_model->append();
|
||||||
parent = *(rowp);
|
parent = *(rowp);
|
||||||
parent[available_action_columns.name] = _("CmdAlt");
|
parent[available_action_columns.name] = _("CmdAlt");
|
||||||
#endif
|
|
||||||
|
|
||||||
for (l = labels.begin(), k = keys.begin(), p = paths.begin(), t = tooltips.begin(); l != labels.end(); ++k, ++p, ++t, ++l) {
|
for (l = labels.begin(), k = keys.begin(), p = paths.begin(), t = tooltips.begin(); l != labels.end(); ++k, ++p, ++t, ++l) {
|
||||||
|
|
||||||
|
|
@ -560,16 +558,15 @@ MackieControlProtocolGUI::build_function_key_editor ()
|
||||||
CellRendererCombo* renderer;
|
CellRendererCombo* renderer;
|
||||||
|
|
||||||
renderer = make_action_renderer (available_action_model, function_key_columns.plain);
|
renderer = make_action_renderer (available_action_model, function_key_columns.plain);
|
||||||
col = manage (new TreeViewColumn (_("Normal Action"), *renderer));
|
col = manage (new TreeViewColumn (_("Plain"), *renderer));
|
||||||
col->add_attribute (renderer->property_text(), function_key_columns.plain);
|
col->add_attribute (renderer->property_text(), function_key_columns.plain);
|
||||||
function_key_editor.append_column (*col);
|
function_key_editor.append_column (*col);
|
||||||
|
|
||||||
renderer = make_action_renderer (available_action_model, function_key_columns.shift);
|
renderer = make_action_renderer (available_action_model, function_key_columns.shift);
|
||||||
col = manage (new TreeViewColumn (_("Action with Shift"), *renderer));
|
col = manage (new TreeViewColumn (_("Shift"), *renderer));
|
||||||
col->add_attribute (renderer->property_text(), function_key_columns.shift);
|
col->add_attribute (renderer->property_text(), function_key_columns.shift);
|
||||||
function_key_editor.append_column (*col);
|
function_key_editor.append_column (*col);
|
||||||
|
|
||||||
#ifndef SHIFT_IS_THE_ONLY_MODIFIER
|
|
||||||
renderer = make_action_renderer (available_action_model, function_key_columns.control);
|
renderer = make_action_renderer (available_action_model, function_key_columns.control);
|
||||||
col = manage (new TreeViewColumn (_("Control"), *renderer));
|
col = manage (new TreeViewColumn (_("Control"), *renderer));
|
||||||
col->add_attribute (renderer->property_text(), function_key_columns.control);
|
col->add_attribute (renderer->property_text(), function_key_columns.control);
|
||||||
|
|
@ -589,7 +586,6 @@ MackieControlProtocolGUI::build_function_key_editor ()
|
||||||
col = manage (new TreeViewColumn (_("Shift+Control"), *renderer));
|
col = manage (new TreeViewColumn (_("Shift+Control"), *renderer));
|
||||||
col->add_attribute (renderer->property_text(), function_key_columns.shiftcontrol);
|
col->add_attribute (renderer->property_text(), function_key_columns.shiftcontrol);
|
||||||
function_key_editor.append_column (*col);
|
function_key_editor.append_column (*col);
|
||||||
#endif
|
|
||||||
|
|
||||||
function_key_model = ListStore::create (function_key_columns);
|
function_key_model = ListStore::create (function_key_columns);
|
||||||
function_key_editor.set_model (function_key_model);
|
function_key_editor.set_model (function_key_model);
|
||||||
|
|
@ -607,19 +603,9 @@ MackieControlProtocolGUI::refresh_function_key_editor ()
|
||||||
DeviceProfile dp (_cp.device_profile());
|
DeviceProfile dp (_cp.device_profile());
|
||||||
DeviceInfo di;
|
DeviceInfo di;
|
||||||
|
|
||||||
vector<Mackie::Button::ID> Fn_buttons;
|
for (int n = 0; n < Mackie::Button::FinalGlobalButton; ++n) {
|
||||||
Fn_buttons.push_back (Mackie::Button::F1);
|
|
||||||
Fn_buttons.push_back (Mackie::Button::F2);
|
|
||||||
Fn_buttons.push_back (Mackie::Button::F3);
|
|
||||||
Fn_buttons.push_back (Mackie::Button::F4);
|
|
||||||
Fn_buttons.push_back (Mackie::Button::F5);
|
|
||||||
Fn_buttons.push_back (Mackie::Button::F6);
|
|
||||||
Fn_buttons.push_back (Mackie::Button::F7);
|
|
||||||
Fn_buttons.push_back (Mackie::Button::F8);
|
|
||||||
|
|
||||||
for (vector<Mackie::Button::ID>::iterator i = Fn_buttons.begin(); i != Fn_buttons.end(); ++i) {
|
Mackie::Button::ID bid = (Mackie::Button::ID) n;
|
||||||
|
|
||||||
Mackie::Button::ID bid = *i;
|
|
||||||
|
|
||||||
row = *(function_key_model->append());
|
row = *(function_key_model->append());
|
||||||
if (di.global_buttons().find (bid) == di.global_buttons().end()) {
|
if (di.global_buttons().find (bid) == di.global_buttons().end()) {
|
||||||
|
|
@ -633,6 +619,12 @@ MackieControlProtocolGUI::refresh_function_key_editor ()
|
||||||
string action;
|
string action;
|
||||||
const string defstring = "\u2022";
|
const string defstring = "\u2022";
|
||||||
|
|
||||||
|
/* We only allow plain bindings for Fn keys. All others are
|
||||||
|
* reserved for hard-coded actions.
|
||||||
|
*/
|
||||||
|
|
||||||
|
if (bid >= Mackie::Button::F1 && bid <= Mackie::Button::F8) {
|
||||||
|
|
||||||
action = dp.get_button_action (bid, 0);
|
action = dp.get_button_action (bid, 0);
|
||||||
if (action.empty()) {
|
if (action.empty()) {
|
||||||
row[function_key_columns.plain] = defstring;
|
row[function_key_columns.plain] = defstring;
|
||||||
|
|
@ -650,6 +642,13 @@ MackieControlProtocolGUI::refresh_function_key_editor ()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/* We only allow plain bindings for Fn keys. All others are
|
||||||
|
* reserved for hard-coded actions.
|
||||||
|
*/
|
||||||
|
|
||||||
|
if (bid >= Mackie::Button::F1 && bid <= Mackie::Button::F8) {
|
||||||
|
|
||||||
action = dp.get_button_action (bid, MackieControlProtocol::MODIFIER_SHIFT);
|
action = dp.get_button_action (bid, MackieControlProtocol::MODIFIER_SHIFT);
|
||||||
if (action.empty()) {
|
if (action.empty()) {
|
||||||
|
|
@ -667,8 +666,8 @@ MackieControlProtocolGUI::refresh_function_key_editor ()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
#ifndef SHIFT_IS_THE_ONLY_MODIFIER
|
|
||||||
action = dp.get_button_action (bid, MackieControlProtocol::MODIFIER_CONTROL);
|
action = dp.get_button_action (bid, MackieControlProtocol::MODIFIER_CONTROL);
|
||||||
if (action.empty()) {
|
if (action.empty()) {
|
||||||
row[function_key_columns.control] = defstring;
|
row[function_key_columns.control] = defstring;
|
||||||
|
|
@ -731,7 +730,6 @@ MackieControlProtocolGUI::refresh_function_key_editor ()
|
||||||
row[function_key_columns.shiftcontrol] = defstring;
|
row[function_key_columns.shiftcontrol] = defstring;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
#endif
|
|
||||||
}
|
}
|
||||||
|
|
||||||
function_key_editor.set_model (function_key_model);
|
function_key_editor.set_model (function_key_model);
|
||||||
|
|
@ -781,7 +779,6 @@ MackieControlProtocolGUI::action_changed (const Glib::ustring &sPath, const Glib
|
||||||
case 3:
|
case 3:
|
||||||
modifier = MackieControlProtocol::MODIFIER_SHIFT;
|
modifier = MackieControlProtocol::MODIFIER_SHIFT;
|
||||||
break;
|
break;
|
||||||
#ifndef SHIFT_IS_THE_ONLY_MODIFIER
|
|
||||||
case 4:
|
case 4:
|
||||||
modifier = MackieControlProtocol::MODIFIER_CONTROL;
|
modifier = MackieControlProtocol::MODIFIER_CONTROL;
|
||||||
break;
|
break;
|
||||||
|
|
@ -794,7 +791,6 @@ MackieControlProtocolGUI::action_changed (const Glib::ustring &sPath, const Glib
|
||||||
case 7:
|
case 7:
|
||||||
modifier = (MackieControlProtocol::MODIFIER_SHIFT|MackieControlProtocol::MODIFIER_CONTROL);
|
modifier = (MackieControlProtocol::MODIFIER_SHIFT|MackieControlProtocol::MODIFIER_CONTROL);
|
||||||
break;
|
break;
|
||||||
#endif
|
|
||||||
default:
|
default:
|
||||||
modifier = 0;
|
modifier = 0;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue