summaryrefslogtreecommitdiff
path: root/gtk2_ardour/editor_regions.cc
diff options
context:
space:
mode:
authorCarl Hetherington <carl@carlh.net>2010-11-14 16:50:42 +0000
committerCarl Hetherington <carl@carlh.net>2010-11-14 16:50:42 +0000
commitf7e9f086209c5fdec4a619dc36ba6f28d011452d (patch)
tree020f9fc64ec5b88bc45d2a6c93c22771cac66349 /gtk2_ardour/editor_regions.cc
parent82e1d1267d091ac4a6f2cfa3e78ddcefe6592f8d (diff)
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
Diffstat (limited to 'gtk2_ardour/editor_regions.cc')
-rw-r--r--gtk2_ardour/editor_regions.cc59
1 files changed, 36 insertions, 23 deletions
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<Region> 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<Region> 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<Region> 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<Region> c = (*j)[_columns.region];
-
- if (c == r) {
- last_row = TreeRowReference(_model, TreePath(j));
- break;
+ boost::shared_ptr<Region> 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> audioregion = boost::dynamic_pointer_cast<AudioRegion>(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;