From dad0e390ff247a4b0ac0da244fdf9b8a9550cec5 Mon Sep 17 00:00:00 2001 From: Robin Gareus Date: Sat, 19 Sep 2015 20:28:56 +0200 Subject: [PATCH] indicate that silence trim is already active. --- gtk2_ardour/strip_silence_dialog.cc | 10 ++++++++-- gtk2_ardour/strip_silence_dialog.h | 3 +++ 2 files changed, 11 insertions(+), 2 deletions(-) diff --git a/gtk2_ardour/strip_silence_dialog.cc b/gtk2_ardour/strip_silence_dialog.cc index 01d6487f74..30f5db8d4a 100644 --- a/gtk2_ardour/strip_silence_dialog.cc +++ b/gtk2_ardour/strip_silence_dialog.cc @@ -91,8 +91,8 @@ StripSilenceDialog::StripSilenceDialog (Session* s, list const & v) get_vbox()->pack_start (*hbox, false, false); - add_button (Gtk::Stock::CANCEL, Gtk::RESPONSE_CANCEL); - add_button (Gtk::Stock::APPLY, Gtk::RESPONSE_OK); + cancel_button = add_button (Gtk::Stock::CANCEL, Gtk::RESPONSE_CANCEL); + apply_button = add_button (Gtk::Stock::APPLY, Gtk::RESPONSE_OK); set_default_response (Gtk::RESPONSE_OK); get_vbox()->pack_start (_progress_bar, true, true, 12); @@ -141,9 +141,15 @@ StripSilenceDialog::silences (AudioIntervalMap& m) void StripSilenceDialog::drop_rects () { + // called by parent when starting to progess (dialog::run returned), + // but before the dialog is destoyed. + for (list::iterator v = views.begin(); v != views.end(); ++v) { v->view->drop_silent_frames (); } + + cancel_button->set_sensitive (false); + apply_button->set_sensitive (false); } void diff --git a/gtk2_ardour/strip_silence_dialog.h b/gtk2_ardour/strip_silence_dialog.h index e89f1911cd..225b4461a2 100644 --- a/gtk2_ardour/strip_silence_dialog.h +++ b/gtk2_ardour/strip_silence_dialog.h @@ -66,6 +66,9 @@ private: AudioClock* _fade_length; Gtk::ProgressBar _progress_bar; + Gtk::Button* cancel_button; + Gtk::Button* apply_button; + struct ViewInterval { RegionView* view; ARDOUR::AudioIntervalResult intervals; -- 2.30.2