Rename a variable and add some logging to start_tool on macOS.
[dcpomatic.git] / src / lib / audio_analysis.cc
index 13917cb5f6d693f3987b0c8adb85526a6426747c..f69bcd362db164e23c31e01d73bdf3399f01b9e9 100644 (file)
 #include "util.h"
 #include "playlist.h"
 #include "audio_content.h"
+#include "warnings.h"
 #include <dcp/raw_convert.h>
+DCPOMATIC_DISABLE_WARNINGS
 #include <libxml++/libxml++.h>
+DCPOMATIC_ENABLE_WARNINGS
 #include <boost/filesystem.hpp>
 #include <boost/foreach.hpp>
 #include <stdint.h>
@@ -93,6 +96,8 @@ AudioAnalysis::AudioAnalysis (boost::filesystem::path filename)
        _analysis_gain = f.optional_number_child<double> ("AnalysisGain");
        _samples_per_point = f.number_child<int64_t> ("SamplesPerPoint");
        _sample_rate = f.number_child<int64_t> ("SampleRate");
+
+       _leqm = f.optional_number_child<double>("Leqm");
 }
 
 void
@@ -162,6 +167,10 @@ AudioAnalysis::write (boost::filesystem::path filename)
        root->add_child("SamplesPerPoint")->add_child_text (raw_convert<string> (_samples_per_point));
        root->add_child("SampleRate")->add_child_text (raw_convert<string> (_sample_rate));
 
+       if (_leqm) {
+               root->add_child("Leqm")->add_child_text(raw_convert<string>(*_leqm));
+       }
+
        doc->write_to_file_formatted (filename.string ());
 }
 
@@ -212,3 +221,4 @@ AudioAnalysis::overall_true_peak () const
 
        return p;
 }
+