From e6ea35c3de0c234a99443a05a131540dd821487c Mon Sep 17 00:00:00 2001 From: Robin Gareus Date: Mon, 15 Feb 2016 15:46:49 +0100 Subject: Add normalization gain factor to Export Analysis --- libs/ardour/export_graph_builder.cc | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) (limited to 'libs/ardour/export_graph_builder.cc') diff --git a/libs/ardour/export_graph_builder.cc b/libs/ardour/export_graph_builder.cc index bdcdf2620e..75587dedae 100644 --- a/libs/ardour/export_graph_builder.cc +++ b/libs/ardour/export_graph_builder.cc @@ -332,6 +332,14 @@ ExportGraphBuilder::SFC::SFC (ExportGraphBuilder &parent, FileSpec const & new_c } } +void +ExportGraphBuilder::SFC::set_peak (float gain) +{ + if (_analyse) { + analyser->set_normalization_gain (gain); + } +} + ExportGraphBuilder::FloatSinkPtr ExportGraphBuilder::SFC::sink () { @@ -476,7 +484,10 @@ ExportGraphBuilder::Normalizer::process() void ExportGraphBuilder::Normalizer::start_post_processing() { - normalizer->set_peak (peak_reader->get_peak()); + const float gain = normalizer->set_peak (peak_reader->get_peak()); + for (boost::ptr_list::iterator i = children.begin(); i != children.end(); ++i) { + (*i).set_peak (gain); + } tmp_file->seek (0, SEEK_SET); tmp_file->add_output (normalizer); parent.normalizers.push_back (this); -- cgit v1.2.3