switch to using boost::signals2 instead of sigc++, at least for libardour. not finish...
[ardour.git] / gtk2_ardour / strip_silence_dialog.h
index faf52c268a32a0c68a5073463b007c7b56fc73bc..f79abb8eb9254457cfdb59b0581055626f22102c 100644 (file)
@@ -1,5 +1,5 @@
 /*
-    Copyright (C) 2009 Paul Davis 
+    Copyright (C) 2009 Paul Davis
 
     This program is free software; you can redistribute it and/or modify
     it under the terms of the GNU General Public License as published by
 
 #include <gtkmm/spinbutton.h>
 #include "ardour_dialog.h"
+#include "canvas.h"
+
+namespace ARDOUR {
+       class AudioRegion;
+}
 
 /// Dialog box to set options for the `strip silence' filter
 class StripSilenceDialog : public ArdourDialog
 {
 public:
-       StripSilenceDialog ();
+       StripSilenceDialog (std::list<boost::shared_ptr<ARDOUR::AudioRegion> > const &);
+       ~StripSilenceDialog ();
 
        double threshold () const {
                return _threshold.get_value ();
@@ -37,9 +43,28 @@ public:
        nframes_t fade_length () const {
                return _fade_length.get_value_as_int ();
        }
-       
+
 private:
+       void create_waves ();
+       void peaks_ready ();
+       void canvas_allocation (Gtk::Allocation &);
+       void update_silence_rects ();
+
        Gtk::SpinButton _threshold;
        Gtk::SpinButton _minimum_length;
        Gtk::SpinButton _fade_length;
+
+       struct Wave {
+               boost::shared_ptr<ARDOUR::AudioRegion> region;
+               ArdourCanvas::WaveView* view;
+               std::list<ArdourCanvas::SimpleRect*> silence_rects;
+               double samples_per_unit;
+       };
+
+       ArdourCanvas::Canvas* _canvas;
+       std::list<Wave> _waves;
+       int _wave_width;
+       int _wave_height;
+
+       boost::signals2::scoped_connection _peaks_ready_connection;
 };