summaryrefslogtreecommitdiff
path: root/gtk2_ardour/editor_routes.cc
diff options
context:
space:
mode:
authorPaul Davis <paul@linuxaudiosystems.com>2020-01-13 23:13:04 -0700
committerPaul Davis <paul@linuxaudiosystems.com>2020-01-13 23:13:14 -0700
commit9f474953fd878a703f7b69d886f5397fc57f9cca (patch)
tree4e17b6cf0fecfe19775ff86dd8a6d8981f48dfc6 /gtk2_ardour/editor_routes.cc
parent659683c6863f4ee3bf6c58df2685711975c29aad (diff)
prevent everything except the name column from changing selection in EditorRoutes
Diffstat (limited to 'gtk2_ardour/editor_routes.cc')
-rw-r--r--gtk2_ardour/editor_routes.cc40
1 files changed, 33 insertions, 7 deletions
diff --git a/gtk2_ardour/editor_routes.cc b/gtk2_ardour/editor_routes.cc
index 4de1cfdfd2..d3634db38b 100644
--- a/gtk2_ardour/editor_routes.cc
+++ b/gtk2_ardour/editor_routes.cc
@@ -85,6 +85,7 @@ EditorRoutes::EditorRoutes (Editor* e)
: EditorComponent (e)
, _ignore_reorder (false)
, _ignore_selection_change (false)
+ , column_does_not_select (false)
, _no_redisplay (false)
, _adding_routes (false)
, _route_deletion_in_progress (false)
@@ -103,6 +104,8 @@ EditorRoutes::EditorRoutes (Editor* e)
_model = ListStore::create (_columns);
_display.set_model (_model);
+ _display.get_selection()->set_select_function (sigc::mem_fun (*this, &EditorRoutes::select_function));
+
// Record enable toggle
CellRendererPixbufMulti* rec_col_renderer = manage (new CellRendererPixbufMulti());
@@ -224,6 +227,10 @@ EditorRoutes::EditorRoutes (Editor* e)
_visible_column = _display.append_column ("", _columns.visible) - 1;
_active_column = _display.append_column ("", _columns.active) - 1;
+ name_column = _display.get_column (_name_column);
+ visible_column = _display.get_column (_visible_column);
+ active_column = _display.get_column (_active_column);
+
_display.append_column (*input_active_column);
_display.append_column (*rec_state_column);
_display.append_column (*rec_safe_column);
@@ -313,6 +320,7 @@ EditorRoutes::EditorRoutes (Editor* e)
_model->signal_rows_reordered().connect (sigc::mem_fun (*this, &EditorRoutes::reordered));
_display.signal_button_press_event().connect (sigc::mem_fun (*this, &EditorRoutes::button_press), false);
+ _display.signal_button_release_event().connect (sigc::mem_fun (*this, &EditorRoutes::button_release), false);
_scroller.signal_key_press_event().connect (sigc::mem_fun(*this, &EditorRoutes::key_press), false);
_scroller.signal_focus_in_event().connect (sigc::mem_fun (*this, &EditorRoutes::focus_in), false);
@@ -1395,6 +1403,19 @@ EditorRoutes::get_relevant_routes (boost::shared_ptr<RouteList> rl)
}
bool
+EditorRoutes::select_function(const Glib::RefPtr<Gtk::TreeModel>&, const Gtk::TreeModel::Path&, bool)
+{
+ return !column_does_not_select;
+}
+
+bool
+EditorRoutes::button_release (GdkEventButton*)
+{
+ column_does_not_select = false;
+ return false;
+}
+
+bool
EditorRoutes::button_press (GdkEventButton* ev)
{
if (Keyboard::is_context_menu_event (ev)) {
@@ -1418,7 +1439,17 @@ EditorRoutes::button_press (GdkEventButton* ev)
return true;
}
- cerr << "BP in cell " << cell_x << ", " << cell_y << " path " << path.to_string() << endl;
+ if ((tvc == rec_state_column) ||
+ (tvc == rec_safe_column) ||
+ (tvc == input_active_column) ||
+ (tvc == mute_state_column) ||
+ (tvc == solo_state_column) ||
+ (tvc == solo_safe_state_column) ||
+ (tvc == solo_isolate_state_column) ||
+ (tvc == visible_column) ||
+ (tvc == active_column)) {
+ column_does_not_select = true;
+ }
//Scroll editor canvas to selected track
if (Keyboard::modifier_state_equals (ev->state, Keyboard::PrimaryModifier)) {
@@ -1431,17 +1462,13 @@ EditorRoutes::button_press (GdkEventButton* ev)
}
}
- cerr << "button press unhandled\n";
-
return false;
}
void
EditorRoutes::selection_changed ()
{
- cerr << " selection changed\n";
-
- if (_ignore_selection_change) {
+ if (_ignore_selection_change || column_does_not_select) {
return;
}
@@ -1459,7 +1486,6 @@ EditorRoutes::selection_changed ()
TimeAxisView* tv = (*iter)[_columns.tv];
selected.push_back (tv);
- cerr << "now selected " << tv->stripable()->name() << endl;
}
}