diff options
author | Carl Hetherington <carl@carlh.net> | 2010-06-28 00:41:01 +0000 |
---|---|---|
committer | Carl Hetherington <carl@carlh.net> | 2010-06-28 00:41:01 +0000 |
commit | bc32e5b5eb2320e22f471317d3b1ebb9f8494514 (patch) | |
tree | 993170cfc190ded516e1a1e1507a8f0fda3f8bf0 /gtk2_ardour/editor_regions.cc | |
parent | c5bbca0cf560014e14d0d5863fb824952cb4908f (diff) |
Make the L,G,M and O buttons in the region list respond to clicks. Fixes #3252.
git-svn-id: svn://localhost/ardour2/branches/3.0@7307 d708f5d6-7413-0410-9779-e7cbd77b26cf
Diffstat (limited to 'gtk2_ardour/editor_regions.cc')
-rw-r--r-- | gtk2_ardour/editor_regions.cc | 74 |
1 files changed, 73 insertions, 1 deletions
diff --git a/gtk2_ardour/editor_regions.cc b/gtk2_ardour/editor_regions.cc index 58a6a0e129..e2a97c791e 100644 --- a/gtk2_ardour/editor_regions.cc +++ b/gtk2_ardour/editor_regions.cc @@ -102,6 +102,22 @@ EditorRegions::EditorRegions (Editor* e) tv_col->add_attribute(renderer->property_text(), _columns.name); tv_col->add_attribute(renderer->property_foreground_gdk(), _columns.color_); + CellRendererToggle* locked_cell = dynamic_cast<CellRendererToggle*> (_display.get_column_cell_renderer (7)); + locked_cell->property_activatable() = true; + locked_cell->signal_toggled().connect (sigc::mem_fun (*this, &EditorRegions::locked_changed)); + + CellRendererToggle* glued_cell = dynamic_cast<CellRendererToggle*> (_display.get_column_cell_renderer (8)); + glued_cell->property_activatable() = true; + glued_cell->signal_toggled().connect (sigc::mem_fun (*this, &EditorRegions::glued_changed)); + + CellRendererToggle* muted_cell = dynamic_cast<CellRendererToggle*> (_display.get_column_cell_renderer (9)); + muted_cell->property_activatable() = true; + muted_cell->signal_toggled().connect (sigc::mem_fun (*this, &EditorRegions::muted_changed)); + + CellRendererToggle* opaque_cell = dynamic_cast<CellRendererToggle*> (_display.get_column_cell_renderer (10)); + opaque_cell->property_activatable() = true; + opaque_cell->signal_toggled().connect (sigc::mem_fun (*this, &EditorRegions::opaque_changed)); + _display.get_selection()->set_mode (SELECTION_MULTIPLE); _display.add_object_drag (_columns.region.index(), "regions"); @@ -306,7 +322,11 @@ EditorRegions::region_changed (boost::shared_ptr<Region> r, const PropertyChange if (what_changed.contains (ARDOUR::Properties::name) || what_changed.contains (ARDOUR::Properties::start) || what_changed.contains (ARDOUR::Properties::position) || - what_changed.contains (ARDOUR::Properties::length)) { + what_changed.contains (ARDOUR::Properties::length) || + what_changed.contains (ARDOUR::Properties::locked) || + what_changed.contains (ARDOUR::Properties::position_lock_style) || + what_changed.contains (ARDOUR::Properties::muted) || + what_changed.contains (ARDOUR::Properties::opaque)) { /* find the region in our model and update its row */ TreeModel::Children rows = _model->children (); @@ -1196,3 +1216,55 @@ EditorRegions::get_single_selection () return (*iter)[_columns.region]; } + +void +EditorRegions::locked_changed (Glib::ustring const & path) +{ + TreeIter i = _model->get_iter (path); + if (i) { + boost::shared_ptr<ARDOUR::Region> region = (*i)[_columns.region]; + if (region) { + region->set_locked (!(*i)[_columns.locked]); + } + } +} + +void +EditorRegions::glued_changed (Glib::ustring const & path) +{ + TreeIter i = _model->get_iter (path); + if (i) { + boost::shared_ptr<ARDOUR::Region> region = (*i)[_columns.region]; + if (region) { + /* `glued' means MusicTime, and we're toggling here */ + region->set_position_lock_style ((*i)[_columns.glued] ? AudioTime : MusicTime); + } + } + +} + +void +EditorRegions::muted_changed (Glib::ustring const & path) +{ + TreeIter i = _model->get_iter (path); + if (i) { + boost::shared_ptr<ARDOUR::Region> region = (*i)[_columns.region]; + if (region) { + region->set_muted (!(*i)[_columns.muted]); + } + } + +} + +void +EditorRegions::opaque_changed (Glib::ustring const & path) +{ + TreeIter i = _model->get_iter (path); + if (i) { + boost::shared_ptr<ARDOUR::Region> region = (*i)[_columns.region]; + if (region) { + region->set_opaque (!(*i)[_columns.opaque]); + } + } + +} |