diff options
author | Paul Davis <paul@linuxaudiosystems.com> | 2010-03-05 02:09:37 +0000 |
---|---|---|
committer | Paul Davis <paul@linuxaudiosystems.com> | 2010-03-05 02:09:37 +0000 |
commit | ec047d89810677cdf4ae3363834919a77b459047 (patch) | |
tree | 6bf54f309d124f441a7d8807774a41494875bb78 /gtk2_ardour/strip_silence_dialog.h | |
parent | 4cb9014de2035c530a4ea4d7c11ec83bfe56e906 (diff) |
more strip silence dialog changes, to use audio clocks, show smallest silence/audible segments, etc.
git-svn-id: svn://localhost/ardour2/branches/3.0@6734 d708f5d6-7413-0410-9779-e7cbd77b26cf
Diffstat (limited to 'gtk2_ardour/strip_silence_dialog.h')
-rw-r--r-- | gtk2_ardour/strip_silence_dialog.h | 41 |
1 files changed, 22 insertions, 19 deletions
diff --git a/gtk2_ardour/strip_silence_dialog.h b/gtk2_ardour/strip_silence_dialog.h index 2084d74de2..c746edc6b5 100644 --- a/gtk2_ardour/strip_silence_dialog.h +++ b/gtk2_ardour/strip_silence_dialog.h @@ -26,28 +26,23 @@ namespace ARDOUR { class AudioRegion; + class Session; } /// Dialog box to set options for the `strip silence' filter class StripSilenceDialog : public ArdourDialog { public: - StripSilenceDialog (std::list<boost::shared_ptr<ARDOUR::AudioRegion> > const &); + StripSilenceDialog (ARDOUR::Session*, std::list<boost::shared_ptr<ARDOUR::AudioRegion> > const &); ~StripSilenceDialog (); double threshold () const { return _threshold.get_value (); } - nframes_t minimum_length () const { - return _minimum_length.get_value_as_int (); - } - - nframes_t fade_length () const { - return _fade_length.get_value_as_int (); - } - - static void stop_thread (); + nframes_t minimum_length () const; + nframes_t fade_length () const; + static void stop_thread (); private: void create_waves (); @@ -57,16 +52,17 @@ private: void redraw_silence_rects (); Gtk::SpinButton _threshold; - Gtk::SpinButton _minimum_length; - Gtk::SpinButton _fade_length; + AudioClock _minimum_length; + AudioClock _fade_length; Gtk::Label _segment_count_label; + typedef std::list<std::pair<ARDOUR::frameoffset_t,ARDOUR::framecnt_t> > SilenceResult; struct Wave { boost::shared_ptr<ARDOUR::AudioRegion> region; ArdourCanvas::WaveView* view; std::list<ArdourCanvas::SimpleRect*> silence_rects; double samples_per_unit; - std::list<std::pair<ARDOUR::frameoffset_t,ARDOUR::framecnt_t> >silence; + SilenceResult silence; Wave() : view (0), samples_per_unit (1) { } }; @@ -77,12 +73,17 @@ private: int _wave_height; bool restart_queued; - static ARDOUR::InterThreadInfo itt; - static bool thread_should_exit; - static Glib::Cond *thread_run; - static Glib::Cond *thread_waiting; - static Glib::StaticMutex run_lock; - static StripSilenceDialog* current; + static ARDOUR::InterThreadInfo itt; + static bool thread_should_exit; + static Glib::Cond *thread_run; + static Glib::Cond *thread_waiting; + static Glib::StaticMutex run_lock; + static StripSilenceDialog* current; + + ARDOUR::framecnt_t max_audible; + ARDOUR::framecnt_t min_audible; + ARDOUR::framecnt_t max_silence; + ARDOUR::framecnt_t min_silence; PBD::ScopedConnection _peaks_ready_connection; @@ -93,4 +94,6 @@ private: void* detection_thread_work (); bool start_silence_detection (); void maybe_start_silence_detection (); + + void update_stats (const SilenceResult&); }; |