22 #include <gtkmm/table.h>
23 #include <gtkmm/label.h>
24 #include <gtkmm/stock.h>
46 , _minimum_length (new
AudioClock (
X_(
"silence duration"), true,
"", true, false, true, false))
47 , _fade_length (new
AudioClock (
X_(
"silence duration"), true,
"", true, false, true, false))
48 , _peaks_ready_connection (0)
53 for (list<RegionView*>::const_iterator r = v.begin(); r != v.end(); ++r) {
57 Gtk::HBox* hbox = Gtk::manage (
new Gtk::HBox);
59 Gtk::Table* table = Gtk::manage (
new Gtk::Table (3, 3));
60 table->set_spacings (6);
64 table->attach (*Gtk::manage (
new Gtk::Label (
_(
"Threshold"), 1, 0.5)), 0, 1, n, n + 1, Gtk::FILL);
65 table->attach (
_threshold, 1, 2, n, n + 1, Gtk::FILL);
66 table->attach (*Gtk::manage (
new Gtk::Label (
_(
"dbFS"))), 2, 3, n, n + 1, Gtk::FILL);
75 table->attach (*Gtk::manage (
new Gtk::Label (
_(
"Minimum length"), 1, 0.5)), 0, 1, n, n + 1, Gtk::FILL);
83 table->attach (*Gtk::manage (
new Gtk::Label (
_(
"Fade length"), 1, 0.5)), 0, 1, n, n + 1, Gtk::FILL);
84 table->attach (*
_fade_length, 1, 2, n, n + 1, Gtk::FILL);
91 hbox->pack_start (*table);
93 get_vbox()->pack_start (*hbox,
false,
false);
95 add_button (Gtk::Stock::CANCEL, Gtk::RESPONSE_CANCEL);
96 add_button (Gtk::Stock::APPLY, Gtk::RESPONSE_OK);
97 set_default_response (Gtk::RESPONSE_OK);
139 for (list<ViewInterval>::iterator v =
views.begin(); v !=
views.end(); ++v) {
140 pair<boost::shared_ptr<Region>,
AudioIntervalResult> newpair (v->view->region(), v->intervals);
148 for (list<ViewInterval>::iterator v =
views.begin(); v !=
views.end(); ++v) {
149 v->view->drop_silent_frames ();
161 for (list<Wave*>::iterator i = _waves.begin(); i != _waves.end(); ++i) {
162 (*i)->threshold_line->property_x1() = 0;
163 (*i)->threshold_line->property_x2() = _wave_width;
167 (*i)->threshold_line->property_y1() = (n + 1 - y) * _wave_height;
168 (*i)->threshold_line->property_y2() = (n + 1 - y) * _wave_height;
189 for (list<ViewInterval>::iterator v =
views.begin(); v !=
views.end(); ++v) {
190 v->view->set_silent_frames (v->intervals, y);
211 for (list<ViewInterval>::iterator i =
views.begin(); i !=
views.end(); ++i) {
PBD::Signal0< void > Completed
emitted when a silence detection has completed
void set(framepos_t, bool force=false, ARDOUR::framecnt_t offset=0)
void set_session(ARDOUR::Session *s)
ARDOUR::InterThreadInfo _interthread_info
shared_ptr< T > dynamic_pointer_cast(shared_ptr< U > const &r)
static ARDOUR_UI * instance()
std::list< std::pair< frameoffset_t, frameoffset_t > > AudioIntervalResult
Dialog box to set options for the `strip silence' filter.
void update_threshold_line()
StripSilenceDialog(ARDOUR::Session *, std::list< RegionView * > const &)
ARDOUR::framecnt_t fade_length() const
AudioClock * _fade_length
void register_thread(std::string, pthread_t, std::string, uint32_t num_requests)
std::map< boost::shared_ptr< ARDOUR::Region >, AudioIntervalResult > AudioIntervalMap
std::list< ViewInterval > views
PBD::ScopedConnection * _peaks_ready_connection
void * detection_thread_work()
void update_progress_gui(float)
Glib::Threads::Cond _run_cond
condition to wake the thread
void update_silence_rects()
static float alt_log_meter(float power)
sigc::signal< void > ValueChanged
PBD::ScopedConnection _completed_connection
AudioClock * _minimum_length
pthread_t _thread
thread to compute silence in the background
bool _thread_should_finish
true if the thread should terminate
Gtk::ProgressBar _progress_bar
Glib::Threads::Mutex _lock
lock held while the thread is doing work
static float dB_to_coefficient(float dB)
framepos_t current_duration(framepos_t position=0) const
virtual void set_session(ARDOUR::Session *)
ARDOUR::framecnt_t minimum_length() const
void silences(ARDOUR::AudioIntervalMap &)
AudioIntervalResult find_silence(Sample, framecnt_t, InterThreadInfo &) const
#define MISSING_INVALIDATOR
Gtk::SpinButton _threshold
int pthread_create(pthread_t *__restrict thread, __const pthread_attr_t *__restrict attr, void *(*start_routine)(void *), void *__restrict arg)
static void * _detection_thread_work(void *)