From dead81d2840dbb551315798625cc7ae88d79e3f7 Mon Sep 17 00:00:00 2001 From: Robin Gareus Date: Fri, 16 Oct 2015 00:13:02 +0200 Subject: [PATCH] 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. --- gtk2_ardour/strip_silence_dialog.cc | 10 ++++++++++ 1 file changed, 10 insertions(+) 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 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::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;