summaryrefslogtreecommitdiff
path: root/gtk2_ardour/crossfade_edit.cc
diff options
context:
space:
mode:
authorCarl Hetherington <carl@carlh.net>2010-04-22 01:40:33 +0000
committerCarl Hetherington <carl@carlh.net>2010-04-22 01:40:33 +0000
commit9213e9c9094468ce21be378ea017b0da1405bf03 (patch)
tree99424cd6f17fa93a354deae97db76af98b6f06e7 /gtk2_ardour/crossfade_edit.cc
parent5b4b2c04e522f8c71b23359519c19160c886c8b9 (diff)
Allow more than one peaks_ready callback to be pending for an AudioRegionView
at any one time. Prevents problems when there is more than 1 channel for which peaks are not ready; before, the first peaks_ready callback would be forgotten when the second one was requested. Should fix #3074. git-svn-id: svn://localhost/ardour2/branches/3.0@6951 d708f5d6-7413-0410-9779-e7cbd77b26cf
Diffstat (limited to 'gtk2_ardour/crossfade_edit.cc')
-rw-r--r--gtk2_ardour/crossfade_edit.cc16
1 files changed, 13 insertions, 3 deletions
diff --git a/gtk2_ardour/crossfade_edit.cc b/gtk2_ardour/crossfade_edit.cc
index d420e36c46..78d3c74ab6 100644
--- a/gtk2_ardour/crossfade_edit.cc
+++ b/gtk2_ardour/crossfade_edit.cc
@@ -93,7 +93,10 @@ CrossfadeEditor::CrossfadeEditor (Session* s, boost::shared_ptr<Crossfade> xf, d
fade_out_table (3, 3),
select_in_button (_("Fade In")),
- select_out_button (_("Fade Out"))
+ select_out_button (_("Fade Out")),
+
+ _peaks_ready_connection (0)
+
{
set_session (s);
@@ -308,6 +311,8 @@ CrossfadeEditor::~CrossfadeEditor()
for (list<Point*>::iterator i = fade[Out].points.begin(); i != fade[Out].points.end(); ++i) {
delete *i;
}
+
+ delete _peaks_ready_connection;
}
void
@@ -1138,11 +1143,14 @@ CrossfadeEditor::make_waves (boost::shared_ptr<AudioRegion> region, WhichFade wh
ht = canvas->get_allocation().get_height() / (double) nchans;
spu = xfade->length() / (double) effective_width();
+ delete _peaks_ready_connection;
+ _peaks_ready_connection = 0;
+
for (uint32_t n = 0; n < nchans; ++n) {
gdouble yoff = n * ht;
- if (region->audio_source(n)->peaks_ready (boost::bind (&CrossfadeEditor::peaks_ready, this, boost::weak_ptr<AudioRegion>(region), which), peaks_ready_connection, gui_context())) {
+ if (region->audio_source(n)->peaks_ready (boost::bind (&CrossfadeEditor::peaks_ready, this, boost::weak_ptr<AudioRegion>(region), which), &_peaks_ready_connection, gui_context())) {
WaveView* waveview = new WaveView (*(canvas->root()));
waveview->property_data_src() = region.get();
@@ -1188,7 +1196,9 @@ CrossfadeEditor::peaks_ready (boost::weak_ptr<AudioRegion> wr, WhichFade which)
will be ready by the time we want them. but our API forces us
to provide this, so ..
*/
- peaks_ready_connection.disconnect ();
+ delete _peaks_ready_connection;
+ _peaks_ready_connection = 0;
+
make_waves (r, which);
}