/*
- 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 ();
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;
};