summaryrefslogtreecommitdiff
path: root/gtk2_ardour/strip_silence_dialog.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/strip_silence_dialog.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/strip_silence_dialog.cc')
-rw-r--r--gtk2_ardour/strip_silence_dialog.cc11
1 files changed, 9 insertions, 2 deletions
diff --git a/gtk2_ardour/strip_silence_dialog.cc b/gtk2_ardour/strip_silence_dialog.cc
index f5ecdef426..0403d4d188 100644
--- a/gtk2_ardour/strip_silence_dialog.cc
+++ b/gtk2_ardour/strip_silence_dialog.cc
@@ -56,6 +56,7 @@ StripSilenceDialog::StripSilenceDialog (Session* s, std::list<boost::shared_ptr<
, _wave_width (640)
, _wave_height (64)
, restart_queued (false)
+ , _peaks_ready_connection (0)
{
set_session (s);
@@ -148,6 +149,8 @@ StripSilenceDialog::~StripSilenceDialog ()
}
}
+ delete _peaks_ready_connection;
+
delete _canvas;
}
@@ -156,8 +159,11 @@ StripSilenceDialog::create_waves ()
{
int n = 0;
+ delete _peaks_ready_connection;
+ _peaks_ready_connection = 0;
+
for (std::list<Wave>::iterator i = _waves.begin(); i != _waves.end(); ++i) {
- if (i->region->audio_source(0)->peaks_ready (boost::bind (&StripSilenceDialog::peaks_ready, this), _peaks_ready_connection, gui_context())) {
+ if (i->region->audio_source(0)->peaks_ready (boost::bind (&StripSilenceDialog::peaks_ready, this), &_peaks_ready_connection, gui_context())) {
i->view = new WaveView (*(_canvas->root()));
i->view->property_data_src() = static_cast<gpointer>(i->region.get());
i->view->property_cache() = WaveView::create_cache ();
@@ -182,7 +188,8 @@ StripSilenceDialog::create_waves ()
void
StripSilenceDialog::peaks_ready ()
{
- _peaks_ready_connection.disconnect ();
+ delete _peaks_ready_connection;
+ _peaks_ready_connection = 0;
create_waves ();
}