13
0

MCP: more button tracing, more config stuff

git-svn-id: svn://localhost/ardour2/branches/3.0@11962 d708f5d6-7413-0410-9779-e7cbd77b26cf
This commit is contained in:
Paul Davis 2012-04-13 17:58:36 +00:00
parent 2329be8f6c
commit 411e2536c2
4 changed files with 58 additions and 9 deletions

View File

@ -69,8 +69,8 @@ MackieControlProtocolGUI::MackieControlProtocolGUI (MackieControlProtocol& p)
Gtk::Table* table = Gtk::manage (new Gtk::Table (2, 2));
table->set_spacings (4);
table->attach (*manage (new Gtk::Label (_("Surface type:"))), 0, 1, 0, 1);
table->attach (_surface_combo, 1, 2, 0, 1);
table->attach (*manage (new Gtk::Label (_("Surface type:"))), 0, 1, 0, 1, AttachOptions(FILL|EXPAND), AttachOptions(0));
table->attach (_surface_combo, 1, 2, 0, 1, AttachOptions(FILL|EXPAND), AttachOptions(0));
vector<string> surfaces;
@ -123,12 +123,51 @@ MackieControlProtocolGUI::rebuild_function_key_editor ()
function_key_editor.append_column (_("Key"), function_key_columns.name);
CellRendererCombo* plain_renderer = manage (new CellRendererCombo);
plain_renderer->property_model() = available_action_model;
plain_renderer->property_editable() = true;
plain_renderer->property_text_column() = 1;
TreeViewColumn* plain_column = manage (new TreeViewColumn (_("plain"), *plain_renderer));
CellRendererCombo* action_renderer = manage (new CellRendererCombo);
action_renderer->property_model() = available_action_model;
action_renderer->property_editable() = true;
action_renderer->property_text_column() = 0;
TreeViewColumn* plain_column = manage (new TreeViewColumn (_("Plain"), *action_renderer));
function_key_editor.append_column (*plain_column);
TreeViewColumn* shift_column = manage (new TreeViewColumn (_("Shift"), *action_renderer));
function_key_editor.append_column (*shift_column);
TreeViewColumn* control_column = manage (new TreeViewColumn (_("Control"), *action_renderer));
function_key_editor.append_column (*control_column);
TreeViewColumn* option_column = manage (new TreeViewColumn (_("Option"), *action_renderer));
function_key_editor.append_column (*option_column);
TreeViewColumn* cmdalt_column = manage (new TreeViewColumn (_("Cmd/Alt"), *action_renderer));
function_key_editor.append_column (*cmdalt_column);
TreeViewColumn* shiftcontrol_column = manage (new TreeViewColumn (_("Shift+Control"), *action_renderer));
function_key_editor.append_column (*shiftcontrol_column);
/* now fill with data */
function_key_model = ListStore::create (function_key_columns);
r = *(function_key_model->append());
r[function_key_columns.name] = "F1";
r = *(function_key_model->append());
r[function_key_columns.name] = "F2";
r = *(function_key_model->append());
r[function_key_columns.name] = "F3";
r = *(function_key_model->append());
r[function_key_columns.name] = "F4";
r = *(function_key_model->append());
r[function_key_columns.name] = "F5";
r = *(function_key_model->append());
r[function_key_columns.name] = "F6";
r = *(function_key_model->append());
r[function_key_columns.name] = "F7";
r = *(function_key_model->append());
r[function_key_columns.name] = "F8";
function_key_editor.set_model (function_key_model);
}
void

View File

@ -52,7 +52,7 @@ class MackieControlProtocolGUI : public Gtk::Notebook
struct FunctionKeyColumns : public Gtk::TreeModel::ColumnRecord {
FunctionKeyColumns() {
add (name);
add (unmodified);
add (plain);
add (shift);
add (control);
add (option);
@ -60,7 +60,7 @@ class MackieControlProtocolGUI : public Gtk::Notebook
add (shiftcontrol);
};
Gtk::TreeModelColumn<std::string> name;
Gtk::TreeModelColumn<std::string> unmodified;
Gtk::TreeModelColumn<std::string> plain;
Gtk::TreeModelColumn<std::string> shift;
Gtk::TreeModelColumn<std::string> control;
Gtk::TreeModelColumn<std::string> option;

View File

@ -1208,6 +1208,8 @@ MackieControlProtocol::select_range ()
pull_route_range (_down_select_buttons, routes);
DEBUG_TRACE (DEBUG::MackieControl, string_compose ("select range: found %1 routes\n", routes.size()));
if (!routes.empty()) {
for (RouteList::iterator r = routes.begin(); r != routes.end(); ++r) {
if (r == routes.begin()) {

View File

@ -415,10 +415,13 @@ Strip::handle_button (Button& button, ButtonState bs)
return;
}
DEBUG_TRACE (DEBUG::MackieControl, "add select button on press\n");
_surface->mcp().add_down_select_button (_surface->number(), _index);
_surface->mcp().select_range ();
} else {
DEBUG_TRACE (DEBUG::MackieControl, "remove select button on release\n");
_surface->mcp().remove_down_select_button (_surface->number(), _index);
}
@ -448,6 +451,7 @@ Strip::handle_button (Button& button, ButtonState bs)
if (control) {
if (bs == press) {
DEBUG_TRACE (DEBUG::MackieControl, "add button on release\n");
_surface->mcp().add_down_button ((AutomationType) control->parameter().type(), _surface->number(), _index);
float new_value;
@ -467,6 +471,9 @@ Strip::handle_button (Button& button, ButtonState bs)
MackieControlProtocol::ControlList controls = _surface->mcp().down_controls ((AutomationType) control->parameter().type());
DEBUG_TRACE (DEBUG::MackieControl, string_compose ("there are %1 buttons down for control type %2, new value = %3\n",
controls.size(), control->parameter().type(), new_value));
/* apply change */
for (MackieControlProtocol::ControlList::iterator c = controls.begin(); c != controls.end(); ++c) {
@ -474,6 +481,7 @@ Strip::handle_button (Button& button, ButtonState bs)
}
} else {
DEBUG_TRACE (DEBUG::MackieControl, "remove button on release\n");
_surface->mcp().remove_down_button ((AutomationType) control->parameter().type(), _surface->number(), _index);
}