diff options
author | Carl Hetherington <carl@carlh.net> | 2010-03-30 23:40:28 +0000 |
---|---|---|
committer | Carl Hetherington <carl@carlh.net> | 2010-03-30 23:40:28 +0000 |
commit | e3dd8cc3ee481924997a1650e3a130b2579be209 (patch) | |
tree | c14bd1999d9e7887f6ec05dff2a697aa0323223a /gtk2_ardour/editor_regions.cc | |
parent | 6721d997b159842e2c977ec0dd0c94002c0e1e47 (diff) |
Move region naming stuff from Session into RegionFactory, cleaning up some vestiges of when Session had a list of regions.
git-svn-id: svn://localhost/ardour2/branches/3.0@6812 d708f5d6-7413-0410-9779-e7cbd77b26cf
Diffstat (limited to 'gtk2_ardour/editor_regions.cc')
-rw-r--r-- | gtk2_ardour/editor_regions.cc | 50 |
1 files changed, 7 insertions, 43 deletions
diff --git a/gtk2_ardour/editor_regions.cc b/gtk2_ardour/editor_regions.cc index 981ada3eff..c33fc13bf2 100644 --- a/gtk2_ardour/editor_regions.cc +++ b/gtk2_ardour/editor_regions.cc @@ -129,48 +129,17 @@ EditorRegions::EditorRegions (Editor* e) //ARDOUR_UI::instance()->secondary_clock.mode_changed.connect (sigc::mem_fun(*this, &Editor::redisplay_regions)); ARDOUR_UI::instance()->secondary_clock.mode_changed.connect (sigc::mem_fun(*this, &EditorRegions::update_all_rows)); - ARDOUR::Region::RegionPropertyChanged.connect (region_property_connection, MISSING_INVALIDATOR, ui_bind (&EditorRegions::update_row, this, _1), gui_context()); - + ARDOUR::Region::RegionPropertyChanged.connect (region_property_connection, MISSING_INVALIDATOR, ui_bind (&EditorRegions::region_changed, this, _1, _2), gui_context()); + ARDOUR::RegionFactory::CheckNewRegion.connect (check_new_region_connection, MISSING_INVALIDATOR, ui_bind (&EditorRegions::add_region, this, _1), gui_context()); } void EditorRegions::set_session (ARDOUR::Session* s) { EditorComponent::set_session (s); - - if (_session) { - _session->RegionsAdded.connect (_session_connections, MISSING_INVALIDATOR, ui_bind (&EditorRegions::handle_new_regions, this, _1), gui_context()); - _session->RegionHiddenChange.connect (_session_connections, MISSING_INVALIDATOR, ui_bind (&EditorRegions::region_hidden, this, _1), gui_context()); - } - - redisplay (); -} - -void -EditorRegions::handle_new_regions (vector<boost::shared_ptr<Region> >& v) -{ - ENSURE_GUI_THREAD (*this, &EditorRegions::handle_new_regions, v) - add_regions (v); -} - -void -EditorRegions::region_hidden_weak (boost::weak_ptr<Region> wr) -{ - boost::shared_ptr<Region> r (wr.lock()); - - if (r) { - region_hidden (r); - } -} - -void -EditorRegions::region_hidden (boost::shared_ptr<Region> r) -{ - ENSURE_GUI_THREAD (*this, &EditorRegions::region_hidden, r) redisplay (); } - void EditorRegions::add_regions (vector<boost::shared_ptr<Region> >& regions) { @@ -334,18 +303,9 @@ EditorRegions::add_region (boost::shared_ptr<Region> region) populate_row(region, (*row)); } - void -EditorRegions::region_changed (const PropertyChange& what_changed, boost::weak_ptr<Region> region) +EditorRegions::region_changed (boost::shared_ptr<Region> r, const PropertyChange& what_changed) { - ENSURE_GUI_THREAD (*this, &EditorRegions::region_changed, what_changed, region) - - boost::shared_ptr<Region> r = region.lock (); - - if (!r) { - return; - } - if (what_changed.contains (ARDOUR::Properties::name)) { /* find the region in our model and change its name */ TreeModel::Children rows = _model->children (); @@ -370,6 +330,10 @@ EditorRegions::region_changed (const PropertyChange& what_changed, boost::weak_p } } + + if (what_changed.contains (ARDOUR::Properties::hidden)) { + redisplay (); + } } void |