summaryrefslogtreecommitdiff
path: root/libs/ardour/export_graph_builder.cc
diff options
context:
space:
mode:
authorRobin Gareus <robin@gareus.org>2016-02-15 15:46:49 +0100
committerRobin Gareus <robin@gareus.org>2016-02-15 15:46:49 +0100
commite6ea35c3de0c234a99443a05a131540dd821487c (patch)
tree5cc035799079d8c4860b855449b61e23836b7a9e /libs/ardour/export_graph_builder.cc
parentb9efb2ae21b785ef7273af22df1a8fcad168227f (diff)
Add normalization gain factor to Export Analysis
Diffstat (limited to 'libs/ardour/export_graph_builder.cc')
-rw-r--r--libs/ardour/export_graph_builder.cc13
1 files changed, 12 insertions, 1 deletions
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<SFC>::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);