Lua bindings to access MIDI region/source note-events
[ardour.git] / libs / ardour / export_graph_builder.cc
index 521916706cee0ca3da08514400205eb691908d49..afcfd2ee5dd6ff3e6e45eb5d26382f0df009afe6 100644 (file)
@@ -98,11 +98,11 @@ ExportGraphBuilder::post_process ()
 }
 
 unsigned
-ExportGraphBuilder::get_normalize_cycle_count() const
+ExportGraphBuilder::get_postprocessing_cycle_count() const
 {
        unsigned max = 0;
        for (std::list<Intermediate *>::const_iterator it = intermediates.begin(); it != intermediates.end(); ++it) {
-               max = std::max(max, (*it)->get_normalize_cycle_count());
+               max = std::max(max, (*it)->get_postprocessing_cycle_count());
        }
        return max;
 }
@@ -516,7 +516,7 @@ ExportGraphBuilder::Intermediate::operator== (FileSpec const & other_config) con
 }
 
 unsigned
-ExportGraphBuilder::Intermediate::get_normalize_cycle_count() const
+ExportGraphBuilder::Intermediate::get_postprocessing_cycle_count() const
 {
        return static_cast<unsigned>(std::ceil(static_cast<float>(tmp_file->get_frames_written()) /
                                               max_frames_out));
@@ -641,11 +641,17 @@ ExportGraphBuilder::SilenceHandler::SilenceHandler (ExportGraphBuilder & parent,
        max_frames_in = max_frames;
        framecnt_t sample_rate = parent.session.nominal_frame_rate();
 
+       /* work around partsing "-inf" config to "0" -- 7b1f97b
+        * silence trim 0dBFS makes no sense, anyway.
+        */
+       float est = Config->get_export_silence_threshold ();
+       if (est >= 0.f) est = -INFINITY;
 #ifdef MIXBUS
-       silence_trimmer.reset (new SilenceTrimmer<Sample>(max_frames_in, -90));
+       // Mixbus channelstrip always dithers the signal, cut above dither level
+       silence_trimmer.reset (new SilenceTrimmer<Sample>(max_frames_in, std::max (-90.f, est)));
 #else
        // TODO silence-threshold should be per export-preset, with Config->get_silence_threshold being the default
-       silence_trimmer.reset (new SilenceTrimmer<Sample>(max_frames_in, Config->get_export_silence_threshold ()));
+       silence_trimmer.reset (new SilenceTrimmer<Sample>(max_frames_in, est));
 #endif
        silence_trimmer->set_trim_beginning (config.format->trim_beginning());
        silence_trimmer->set_trim_end (config.format->trim_end());