From f7e9f086209c5fdec4a619dc36ba6f28d011452d Mon Sep 17 00:00:00 2001 From: Carl Hetherington Date: Sun, 14 Nov 2010 16:50:42 +0000 Subject: Fix non-update of region list when not showing automatic regions. Fixes #3098. git-svn-id: svn://localhost/ardour2/branches/3.0@8029 d708f5d6-7413-0410-9779-e7cbd77b26cf --- gtk2_ardour/editor_regions.cc | 59 ++++++++++++++++++++++++++----------------- 1 file changed, 36 insertions(+), 23 deletions(-) (limited to 'gtk2_ardour') diff --git a/gtk2_ardour/editor_regions.cc b/gtk2_ardour/editor_regions.cc index 66bb65a740..e8f5b9cd10 100644 --- a/gtk2_ardour/editor_regions.cc +++ b/gtk2_ardour/editor_regions.cc @@ -437,7 +437,6 @@ EditorRegions::region_changed (boost::shared_ptr r, const PropertyChange } } - if (what_changed.contains (our_interests)) { /* find the region in our model and update its row */ @@ -445,57 +444,71 @@ EditorRegions::region_changed (boost::shared_ptr r, const PropertyChange TreeModel::iterator i = rows.begin (); while (i != rows.end ()) { - + TreeModel::Children children = (*i)->children (); - TreeModel::iterator j = children.begin (); + TreeModel::iterator found = children.end (); - while (j != children.end()) { + boost::shared_ptr c = (*i)[_columns.region]; + + if (c == r) { + + /* check this row */ + last_row = TreeRowReference (_model, TreePath (i)); + found = i; + + } else { + + /* check its children */ + + found = children.begin (); + while (found != children.end()) { - boost::shared_ptr c = (*j)[_columns.region]; - - if (c == r) { - last_row = TreeRowReference(_model, TreePath(j)); - break; + boost::shared_ptr c = (*found)[_columns.region]; + + if (c == r) { + last_row = TreeRowReference(_model, TreePath (found)); + break; + } + ++found; } - ++j; } - if (j != children.end()) { + if (found != children.end()) { boost::shared_ptr audioregion = boost::dynamic_pointer_cast(r); uint32_t used = _editor->get_regionview_count_from_region_list (r); if (what_changed.contains (ARDOUR::Properties::name)) { - populate_row_name (r, *j); + populate_row_name (r, *found); } if (what_changed.contains (ARDOUR::Properties::position)) { - populate_row_position (r, *j, used); - populate_row_end (r, *j, used); + populate_row_position (r, *found, used); + populate_row_end (r, *found, used); } if (what_changed.contains (ARDOUR::Properties::length)) { - populate_row_end (r, *j, used); - populate_row_length (r, *j); + populate_row_end (r, *found, used); + populate_row_length (r, *found); } if (what_changed.contains (ARDOUR::Properties::start)) { - populate_row_length (r, *j); + populate_row_length (r, *found); } if (what_changed.contains (ARDOUR::Properties::locked)) { - populate_row_locked (r, *j, used); + populate_row_locked (r, *found, used); } if (what_changed.contains (ARDOUR::Properties::position_lock_style)) { - populate_row_glued (r, *j, used); + populate_row_glued (r, *found, used); } if (what_changed.contains (ARDOUR::Properties::muted)) { - populate_row_muted (r, *j, used); + populate_row_muted (r, *found, used); } if (what_changed.contains (ARDOUR::Properties::opaque)) { - populate_row_opaque (r, *j, used); + populate_row_opaque (r, *found, used); } if (what_changed.contains (ARDOUR::Properties::fade_in)) { - populate_row_fade_in (r, *j, used, audioregion); + populate_row_fade_in (r, *found, used, audioregion); } if (what_changed.contains (ARDOUR::Properties::fade_out)) { - populate_row_fade_out (r, *j, used, audioregion); + populate_row_fade_out (r, *found, used, audioregion); } break; -- cgit v1.2.3