X-Git-Url: https://git.carlh.net/gitweb/?a=blobdiff_plain;f=gtk2_ardour%2Fstrip_silence_dialog.h;h=18313941c15496835ff148e240826e9ed0d85f15;hb=7149ca74e6f81127154d20b2623ff1f7c1e3f341;hp=c9b31578b99fde1e8dc60a4c7620fce6de980531;hpb=bf411d3730526af0bb984f6bb3dd4035d6070bc4;p=ardour.git diff --git a/gtk2_ardour/strip_silence_dialog.h b/gtk2_ardour/strip_silence_dialog.h index c9b31578b9..18313941c1 100644 --- a/gtk2_ardour/strip_silence_dialog.h +++ b/gtk2_ardour/strip_silence_dialog.h @@ -26,27 +26,31 @@ #include "progress_reporter.h" namespace ARDOUR { - class AudioRegion; class Session; } +class AudioClock; +class RegionView; + /// Dialog box to set options for the `strip silence' filter class StripSilenceDialog : public ArdourDialog, public ProgressReporter { public: - StripSilenceDialog (ARDOUR::Session*, std::list > const &); + StripSilenceDialog (ARDOUR::Session*, std::list const &); ~StripSilenceDialog (); double threshold () const { return _threshold.get_value (); } - nframes_t minimum_length () const; - nframes_t fade_length () const; + void drop_rects (); + + void silences (ARDOUR::AudioIntervalMap&); + + ARDOUR::framecnt_t minimum_length () const; + ARDOUR::framecnt_t fade_length () const; private: - typedef std::list > SilenceResult; - void create_waves (); void peaks_ready (); void canvas_allocation (Gtk::Allocation &); @@ -54,43 +58,29 @@ private: void resize_silence_rects (); void update (); void update_threshold_line (); - void update_stats (SilenceResult const &); + void update_stats (ARDOUR::AudioIntervalResult const &); void threshold_changed (); void update_progress_gui (float); void restart_thread (); Gtk::SpinButton _threshold; - AudioClock _minimum_length; - AudioClock _fade_length; - Gtk::Label _segment_count_label; - Gtk::Label _shortest_silence_label; - Gtk::Label _shortest_audible_label; + AudioClock* _minimum_length; + AudioClock* _fade_length; Gtk::ProgressBar _progress_bar; - struct Wave { - boost::shared_ptr region; - ArdourCanvas::WaveView* view; - std::list silence_rects; - ArdourCanvas::SimpleLine* threshold_line; - double samples_per_unit; - SilenceResult silence; - - Wave (ArdourCanvas::Group *, boost::shared_ptr); - ~Wave (); - }; - - ArdourCanvas::Canvas* _canvas; - std::list _waves; - int _wave_width; - int _wave_height; - - ARDOUR::framecnt_t max_audible; - ARDOUR::framecnt_t min_audible; - ARDOUR::framecnt_t max_silence; - ARDOUR::framecnt_t min_silence; + struct ViewInterval { + RegionView* view; + ARDOUR::AudioIntervalResult intervals; + + ViewInterval (RegionView* rv) : view (rv) {} + }; + + std::list views; PBD::ScopedConnection* _peaks_ready_connection; + bool _destroying; + pthread_t _thread; ///< thread to compute silence in the background static void * _detection_thread_work (void *); void * detection_thread_work ();