, _destroying (false)
, analysis_progress_cur (0)
, analysis_progress_max (0)
+ , _threshold_value (-60)
+ , _minimum_length_value (1000)
+ , _fade_length_value (64)
{
set_session (s);
Gtk::Table* table = Gtk::manage (new Gtk::Table (3, 3));
table->set_spacings (6);
+ //get the last used settings for this
+ XMLNode* node = _session->extra_xml(X_("StripSilence"));
+ if (node) {
+ node->get_property(X_("threshold"), _threshold_value);
+ node->get_property(X_("min-length"), _minimum_length_value);
+ node->get_property(X_("fade-length"), _fade_length_value);
+ }
+
int n = 0;
table->attach (*Gtk::manage (new Gtk::Label (_("Threshold"), 1, 0.5)), 0, 1, n, n + 1, Gtk::FILL);
_threshold.set_digits (1);
_threshold.set_increments (1, 10);
_threshold.set_range (-120, 0);
- _threshold.set_value (-60);
+ _threshold.set_value (_threshold_value);
_threshold.set_activates_default ();
table->attach (*Gtk::manage (new Gtk::Label (_("Minimum length"), 1, 0.5)), 0, 1, n, n + 1, Gtk::FILL);
_minimum_length->set_session (s);
_minimum_length->set_mode (AudioClock::Samples);
- _minimum_length->set (1000, true);
+ _minimum_length->set (_minimum_length_value, true);
table->attach (*Gtk::manage (new Gtk::Label (_("Fade length"), 1, 0.5)), 0, 1, n, n + 1, Gtk::FILL);
table->attach (*_fade_length, 1, 2, n, n + 1, Gtk::FILL);
_fade_length->set_session (s);
_fade_length->set_mode (AudioClock::Samples);
- _fade_length->set (64, true);
+ _fade_length->set (_fade_length_value, true);
hbox->pack_start (*table);
{
_progress_bar.set_fraction (p);
}
+
+XMLNode&
+StripSilenceDialog::get_state ()
+{
+ XMLNode* node = new XMLNode(X_("StripSilence"));
+ node->set_property(X_("threshold"), threshold());
+ node->set_property(X_("min-length"), minimum_length());
+ node->set_property(X_("fade-length"), fade_length());
+ return *node;
+}
+
+void
+StripSilenceDialog::set_state (const XMLNode &)
+{
+}
\ No newline at end of file
#include <gtkmm/spinbutton.h>
#include <glibmm/threads.h>
+#include <pbd/xml++.h>
+
#include "ardour/types.h"
#include "ardour_dialog.h"
#include "progress_reporter.h"
Gtk::Dialog::on_response (response_id);
}
+ XMLNode& get_state ();
+ void set_state (const XMLNode &);
+
private:
void create_waves ();
void canvas_allocation (Gtk::Allocation &);
bool idle_update_progress(); ///< GUI-thread progress updates of background silence computation
int analysis_progress_cur;
int analysis_progress_max;
+
+ int _threshold_value;
+ ARDOUR::samplecnt_t _minimum_length_value;
+ ARDOUR::samplecnt_t _fade_length_value;
};