diff options
author | Paul Davis <paul@linuxaudiosystems.com> | 2010-03-03 23:38:42 +0000 |
---|---|---|
committer | Paul Davis <paul@linuxaudiosystems.com> | 2010-03-03 23:38:42 +0000 |
commit | a7eb8f47335904c6b9c30b86d6a7be3946d13655 (patch) | |
tree | 0a54147c22eb9fc1ec8bd8e1c646a2df542a7e7d /gtk2_ardour/strip_silence_dialog.h | |
parent | fba09a3d19c460fb55e374a24b9f02cf774e2573 (diff) |
fixes and improvements for strip silence, with lots of thread debugging
git-svn-id: svn://localhost/ardour2/branches/3.0@6724 d708f5d6-7413-0410-9779-e7cbd77b26cf
Diffstat (limited to 'gtk2_ardour/strip_silence_dialog.h')
-rw-r--r-- | gtk2_ardour/strip_silence_dialog.h | 34 |
1 files changed, 30 insertions, 4 deletions
diff --git a/gtk2_ardour/strip_silence_dialog.h b/gtk2_ardour/strip_silence_dialog.h index 927764e57c..2084d74de2 100644 --- a/gtk2_ardour/strip_silence_dialog.h +++ b/gtk2_ardour/strip_silence_dialog.h @@ -18,6 +18,9 @@ */ #include <gtkmm/spinbutton.h> +#include <glibmm/thread.h> + +#include "ardour/types.h" #include "ardour_dialog.h" #include "canvas.h" @@ -44,27 +47,50 @@ public: return _fade_length.get_value_as_int (); } + static void stop_thread (); + private: void create_waves (); void peaks_ready (); void canvas_allocation (Gtk::Allocation &); void update_silence_rects (); + void redraw_silence_rects (); Gtk::SpinButton _threshold; Gtk::SpinButton _minimum_length; Gtk::SpinButton _fade_length; + Gtk::Label _segment_count_label; struct Wave { - boost::shared_ptr<ARDOUR::AudioRegion> region; - ArdourCanvas::WaveView* view; - std::list<ArdourCanvas::SimpleRect*> silence_rects; - double samples_per_unit; + 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; + + Wave() : view (0), samples_per_unit (1) { } }; ArdourCanvas::Canvas* _canvas; std::list<Wave> _waves; int _wave_width; 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; PBD::ScopedConnection _peaks_ready_connection; + + static bool _detection_done (void*); + static void* _detection_thread_work (void*); + + bool detection_done (); + void* detection_thread_work (); + bool start_silence_detection (); + void maybe_start_silence_detection (); }; |