Prevent endless read of silent files
[ardour.git] / gtk2_ardour / strip_silence_dialog.cc
index cd41950924d37f28dfe952b6d71739de30aceffb..a2f8bc7983001ff6e72b4a7fd4215378b8f228bc 100644 (file)
 
 #include <gtkmm/table.h>
 #include <gtkmm/label.h>
+#include <gtkmm/progressbar.h>
 #include <gtkmm/stock.h>
 
 #include "ardour/audioregion.h"
 #include "ardour/dB.h"
+#include "ardour/logmeter.h"
 #include "ardour_ui.h"
 
 #include "audio_clock.h"
@@ -32,8 +34,7 @@
 #include "strip_silence_dialog.h"
 #include "region_view.h"
 #include "rgb_macros.h"
-#include "i18n.h"
-#include "logmeter.h"
+#include "pbd/i18n.h"
 
 using namespace ARDOUR;
 using namespace std;
@@ -64,7 +65,7 @@ StripSilenceDialog::StripSilenceDialog (Session* s, list<RegionView*> const & v)
 
        table->attach (*Gtk::manage (new Gtk::Label (_("Threshold"), 1, 0.5)), 0, 1, n, n + 1, Gtk::FILL);
        table->attach (_threshold, 1, 2, n, n + 1, Gtk::FILL);
-       table->attach (*Gtk::manage (new Gtk::Label (_("dbFS"))), 2, 3, n, n + 1, Gtk::FILL);
+       table->attach (*Gtk::manage (new Gtk::Label (_("dBFS"))), 2, 3, n, n + 1, Gtk::FILL);
        ++n;
 
        _threshold.set_digits (1);
@@ -78,7 +79,7 @@ StripSilenceDialog::StripSilenceDialog (Session* s, list<RegionView*> const & v)
        ++n;
 
        _minimum_length->set_session (s);
-       _minimum_length->set_mode (AudioClock::Frames);
+       _minimum_length->set_mode (AudioClock::Samples);
        _minimum_length->set (1000, true);
 
        table->attach (*Gtk::manage (new Gtk::Label (_("Fade length"), 1, 0.5)), 0, 1, n, n + 1, Gtk::FILL);
@@ -86,7 +87,7 @@ StripSilenceDialog::StripSilenceDialog (Session* s, list<RegionView*> const & v)
        ++n;
 
        _fade_length->set_session (s);
-       _fade_length->set_mode (AudioClock::Frames);
+       _fade_length->set_mode (AudioClock::Samples);
        _fade_length->set (64, true);
 
        hbox->pack_start (*table);
@@ -175,7 +176,7 @@ StripSilenceDialog::drop_rects ()
        _lock.unlock ();
 
        for (list<ViewInterval>::iterator v = views.begin(); v != views.end(); ++v) {
-               v->view->drop_silent_frames ();
+               v->view->drop_silent_samples ();
        }
 
        cancel_button->set_sensitive (false);
@@ -222,7 +223,7 @@ StripSilenceDialog::update_silence_rects ()
        double const y = _threshold.get_value();
 
        for (list<ViewInterval>::iterator v = views.begin(); v != views.end(); ++v) {
-               v->view->set_silent_frames (v->intervals, y);
+               v->view->set_silent_samples (v->intervals, y);
        }
 }
 
@@ -319,16 +320,16 @@ StripSilenceDialog::threshold_changed ()
        restart_thread ();
 }
 
-framecnt_t
+samplecnt_t
 StripSilenceDialog::minimum_length () const
 {
-       return std::max((framecnt_t)1, _minimum_length->current_duration (views.front().view->region()->position()));
+       return std::max((samplecnt_t)1, _minimum_length->current_duration (views.front().view->region()->position()));
 }
 
-framecnt_t
+samplecnt_t
 StripSilenceDialog::fade_length () const
 {
-       return std::max((framecnt_t)0, _fade_length->current_duration (views.front().view->region()->position()));
+       return std::max((samplecnt_t)0, _fade_length->current_duration (views.front().view->region()->position()));
 }
 
 void