summaryrefslogtreecommitdiff
path: root/gtk2_ardour/editor_regions.cc
diff options
context:
space:
mode:
authorPaul Davis <paul@linuxaudiosystems.com>2010-09-21 03:02:30 +0000
committerPaul Davis <paul@linuxaudiosystems.com>2010-09-21 03:02:30 +0000
commit2c80ff4129040f0083318e689a9548444296009b (patch)
tree48f44fc04bb069d3862da583616e0b017110f406 /gtk2_ardour/editor_regions.cc
parentff356beda56953231c81d1f257b2993e42c0df93 (diff)
lincoln's patch that makes us pay attention to region copies w.r.t the region list, PLUS make region list insert drags work again by not insisting that the list of regionviews be non-empty as the drag is constructed PLUS the start of tracking mouse cursor position in MIDI notes PLUS a bit of leftover debugging info
git-svn-id: svn://localhost/ardour2/branches/3.0@7817 d708f5d6-7413-0410-9779-e7cbd77b26cf
Diffstat (limited to 'gtk2_ardour/editor_regions.cc')
-rw-r--r--gtk2_ardour/editor_regions.cc38
1 files changed, 31 insertions, 7 deletions
diff --git a/gtk2_ardour/editor_regions.cc b/gtk2_ardour/editor_regions.cc
index a66282a7ef..0cc8926371 100644
--- a/gtk2_ardour/editor_regions.cc
+++ b/gtk2_ardour/editor_regions.cc
@@ -25,7 +25,6 @@
#include "pbd/basename.h"
#include "pbd/enumwriter.h"
-#include "pbd/stacktrace.h"
#include "ardour/audioregion.h"
#include "ardour/audiofilesource.h"
@@ -346,18 +345,41 @@ EditorRegions::region_changed (boost::shared_ptr<Region> r, const PropertyChange
our_interests.add (ARDOUR::Properties::opaque);
our_interests.add (ARDOUR::Properties::fade_in);
our_interests.add (ARDOUR::Properties::fade_out);
+
+ if (last_row != NULL){
+
+ TreeModel::iterator j = _model->get_iter (last_row.get_path());
+ boost::shared_ptr<Region> c = (*j)[_columns.region];
+
+ if (c == r) {
+ populate_row (r, (*j));
+
+ if (what_changed.contains (ARDOUR::Properties::hidden)) {
+ redisplay ();
+ }
+
+ return;
+ }
+ }
+
if (what_changed.contains (our_interests)) {
/* find the region in our model and update its row */
TreeModel::Children rows = _model->children ();
TreeModel::iterator i = rows.begin ();
+
while (i != rows.end ()) {
+
TreeModel::Children children = (*i)->children ();
TreeModel::iterator j = children.begin ();
+
while (j != children.end()) {
+
boost::shared_ptr<Region> c = (*j)[_columns.region];
+
if (c == r) {
+ last_row = TreeRowReference(_model, TreePath(j));
break;
}
++j;
@@ -403,7 +425,6 @@ EditorRegions::region_changed (boost::shared_ptr<Region> r, const PropertyChange
++i;
}
-
}
if (what_changed.contains (ARDOUR::Properties::hidden)) {
@@ -438,8 +459,11 @@ EditorRegions::selection_changed ()
boost::shared_ptr<Region> region = (*iter)[_columns.region];
// they could have clicked on a row that is just a placeholder, like "Hidden"
-
if (region) {
+
+ cerr << "Selected region has use count "
+ << _session->playlists->region_use_count (region)
+ << endl;
if (region->automatic()) {
@@ -464,10 +488,12 @@ EditorRegions::selection_changed ()
void
EditorRegions::set_selected (RegionSelection& regions)
{
+ TreeModel::Children rows = _model->children();
+
for (RegionSelection::iterator iter = regions.begin(); iter != regions.end(); ++iter) {
TreeModel::iterator i;
- TreeModel::Children rows = _model->children();
+
boost::shared_ptr<Region> r ((*iter)->region());
for (i = rows.begin(); i != rows.end(); ++i) {
@@ -509,6 +535,7 @@ EditorRegions::set_selected_in_subrow (boost::shared_ptr<Region> region, TreeMod
}
}
}
+
return false;
}
@@ -550,9 +577,6 @@ EditorRegions::redisplay ()
insert_into_tmp_regionlist (i->second);
}
- stacktrace (cerr, 22);
- cerr << "Redisplay with " << tmp_region_list.size() << " regions\n";
-
for (list<boost::shared_ptr<Region> >::iterator r = tmp_region_list.begin(); r != tmp_region_list.end(); ++r) {
add_region (*r);
}