mirror of
https://github.com/Ardour/ardour.git
synced 2025-12-06 14:54:56 +01:00
prevent everything except the name column from changing selection in EditorRoutes
This commit is contained in:
parent
659683c686
commit
9f474953fd
2 changed files with 40 additions and 7 deletions
|
|
@ -85,6 +85,7 @@ EditorRoutes::EditorRoutes (Editor* e)
|
||||||
: EditorComponent (e)
|
: EditorComponent (e)
|
||||||
, _ignore_reorder (false)
|
, _ignore_reorder (false)
|
||||||
, _ignore_selection_change (false)
|
, _ignore_selection_change (false)
|
||||||
|
, column_does_not_select (false)
|
||||||
, _no_redisplay (false)
|
, _no_redisplay (false)
|
||||||
, _adding_routes (false)
|
, _adding_routes (false)
|
||||||
, _route_deletion_in_progress (false)
|
, _route_deletion_in_progress (false)
|
||||||
|
|
@ -103,6 +104,8 @@ EditorRoutes::EditorRoutes (Editor* e)
|
||||||
_model = ListStore::create (_columns);
|
_model = ListStore::create (_columns);
|
||||||
_display.set_model (_model);
|
_display.set_model (_model);
|
||||||
|
|
||||||
|
_display.get_selection()->set_select_function (sigc::mem_fun (*this, &EditorRoutes::select_function));
|
||||||
|
|
||||||
// Record enable toggle
|
// Record enable toggle
|
||||||
CellRendererPixbufMulti* rec_col_renderer = manage (new CellRendererPixbufMulti());
|
CellRendererPixbufMulti* rec_col_renderer = manage (new CellRendererPixbufMulti());
|
||||||
|
|
||||||
|
|
@ -224,6 +227,10 @@ EditorRoutes::EditorRoutes (Editor* e)
|
||||||
_visible_column = _display.append_column ("", _columns.visible) - 1;
|
_visible_column = _display.append_column ("", _columns.visible) - 1;
|
||||||
_active_column = _display.append_column ("", _columns.active) - 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 (*input_active_column);
|
||||||
_display.append_column (*rec_state_column);
|
_display.append_column (*rec_state_column);
|
||||||
_display.append_column (*rec_safe_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));
|
_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_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_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);
|
_scroller.signal_focus_in_event().connect (sigc::mem_fun (*this, &EditorRoutes::focus_in), false);
|
||||||
|
|
@ -1394,6 +1402,19 @@ EditorRoutes::get_relevant_routes (boost::shared_ptr<RouteList> rl)
|
||||||
return !rl->empty();
|
return !rl->empty();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
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
|
bool
|
||||||
EditorRoutes::button_press (GdkEventButton* ev)
|
EditorRoutes::button_press (GdkEventButton* ev)
|
||||||
{
|
{
|
||||||
|
|
@ -1418,7 +1439,17 @@ EditorRoutes::button_press (GdkEventButton* ev)
|
||||||
return true;
|
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
|
//Scroll editor canvas to selected track
|
||||||
if (Keyboard::modifier_state_equals (ev->state, Keyboard::PrimaryModifier)) {
|
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;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
EditorRoutes::selection_changed ()
|
EditorRoutes::selection_changed ()
|
||||||
{
|
{
|
||||||
cerr << " selection changed\n";
|
if (_ignore_selection_change || column_does_not_select) {
|
||||||
|
|
||||||
if (_ignore_selection_change) {
|
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -1459,7 +1486,6 @@ EditorRoutes::selection_changed ()
|
||||||
|
|
||||||
TimeAxisView* tv = (*iter)[_columns.tv];
|
TimeAxisView* tv = (*iter)[_columns.tv];
|
||||||
selected.push_back (tv);
|
selected.push_back (tv);
|
||||||
cerr << "now selected " << tv->stripable()->name() << endl;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -92,6 +92,7 @@ private:
|
||||||
void active_changed (std::string const &);
|
void active_changed (std::string const &);
|
||||||
void reordered (Gtk::TreeModel::Path const &, Gtk::TreeModel::iterator const &, int *);
|
void reordered (Gtk::TreeModel::Path const &, Gtk::TreeModel::iterator const &, int *);
|
||||||
bool button_press (GdkEventButton *);
|
bool button_press (GdkEventButton *);
|
||||||
|
bool button_release (GdkEventButton *);
|
||||||
void route_property_changed (const PBD::PropertyChange&, boost::weak_ptr<ARDOUR::Stripable>);
|
void route_property_changed (const PBD::PropertyChange&, boost::weak_ptr<ARDOUR::Stripable>);
|
||||||
void handle_gui_changes (std::string const &, void *);
|
void handle_gui_changes (std::string const &, void *);
|
||||||
bool idle_update_mute_rec_solo_etc ();
|
bool idle_update_mute_rec_solo_etc ();
|
||||||
|
|
@ -170,6 +171,9 @@ private:
|
||||||
Gtk::TreeViewColumn* solo_state_column;
|
Gtk::TreeViewColumn* solo_state_column;
|
||||||
Gtk::TreeViewColumn* solo_safe_state_column;
|
Gtk::TreeViewColumn* solo_safe_state_column;
|
||||||
Gtk::TreeViewColumn* solo_isolate_state_column;
|
Gtk::TreeViewColumn* solo_isolate_state_column;
|
||||||
|
Gtk::TreeViewColumn* name_column;
|
||||||
|
Gtk::TreeViewColumn* visible_column;
|
||||||
|
Gtk::TreeViewColumn* active_column;
|
||||||
|
|
||||||
Gtk::ScrolledWindow _scroller;
|
Gtk::ScrolledWindow _scroller;
|
||||||
Gtk::TreeView _display;
|
Gtk::TreeView _display;
|
||||||
|
|
@ -181,6 +185,7 @@ private:
|
||||||
|
|
||||||
bool _ignore_reorder;
|
bool _ignore_reorder;
|
||||||
bool _ignore_selection_change;
|
bool _ignore_selection_change;
|
||||||
|
bool column_does_not_select;
|
||||||
bool _no_redisplay;
|
bool _no_redisplay;
|
||||||
bool _adding_routes;
|
bool _adding_routes;
|
||||||
bool _route_deletion_in_progress;
|
bool _route_deletion_in_progress;
|
||||||
|
|
@ -192,6 +197,8 @@ private:
|
||||||
Gtk::Widget* old_focus;
|
Gtk::Widget* old_focus;
|
||||||
Gtk::CellEditable* name_editable;
|
Gtk::CellEditable* name_editable;
|
||||||
|
|
||||||
|
bool select_function (const Glib::RefPtr<Gtk::TreeModel>& model, const Gtk::TreeModel::Path& path, bool);
|
||||||
|
|
||||||
bool key_press (GdkEventKey* ev);
|
bool key_press (GdkEventKey* ev);
|
||||||
bool focus_in (GdkEventFocus*);
|
bool focus_in (GdkEventFocus*);
|
||||||
bool focus_out (GdkEventFocus*);
|
bool focus_out (GdkEventFocus*);
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue