summaryrefslogtreecommitdiff
path: root/gtk2_ardour/strip_silence_dialog.cc
diff options
context:
space:
mode:
authorRobin Gareus <robin@gareus.org>2015-10-16 00:13:02 +0200
committerRobin Gareus <robin@gareus.org>2015-10-16 00:13:02 +0200
commitdead81d2840dbb551315798625cc7ae88d79e3f7 (patch)
tree4215eefdfad56ed9e1483cf8d21599a5cd251f7f /gtk2_ardour/strip_silence_dialog.cc
parent5ad63bd3f8e84ba7ef6d8a942c2a8c078fa03fa4 (diff)
strip silence: wait for analysis to complete
"apply"ing strip-silence while analysis is still running will at best only process regions that have already been analyzed and at worst crash.
Diffstat (limited to 'gtk2_ardour/strip_silence_dialog.cc')
-rw-r--r--gtk2_ardour/strip_silence_dialog.cc10
1 files changed, 10 insertions, 0 deletions
diff --git a/gtk2_ardour/strip_silence_dialog.cc b/gtk2_ardour/strip_silence_dialog.cc
index d802244407..c32a70ffd8 100644
--- a/gtk2_ardour/strip_silence_dialog.cc
+++ b/gtk2_ardour/strip_silence_dialog.cc
@@ -106,6 +106,9 @@ StripSilenceDialog::StripSilenceDialog (Session* s, list<RegionView*> const & v)
update_silence_rects ();
update_threshold_line ();
+ _progress_bar.set_text (_("Analyzing"));
+ apply_button->set_sensitive (false);
+
/* Create a thread which runs while the dialogue is open to compute the silence regions */
Completed.connect (_completed_connection, invalidator(*this), boost::bind (&StripSilenceDialog::update, this), gui_context ());
_thread_should_finish = false;
@@ -145,6 +148,8 @@ StripSilenceDialog::drop_rects ()
// called by parent when starting to progess (dialog::run returned),
// but before the dialog is destoyed.
+ _interthread_info.cancel = true;
+
for (list<ViewInterval>::iterator v = views.begin(); v != views.end(); ++v) {
v->view->drop_silent_frames ();
}
@@ -180,6 +185,8 @@ StripSilenceDialog::update ()
{
update_threshold_line ();
update_silence_rects ();
+ _progress_bar.set_text ("");
+ apply_button->set_sensitive(true);
}
void
@@ -253,6 +260,9 @@ StripSilenceDialog::restart_thread ()
return;
}
+ _progress_bar.set_text (_("Analyzing"));
+ apply_button->set_sensitive (false);
+
/* Cancel any current run */
_interthread_info.cancel = true;