Add a 'Make DKDM' dialogue box to simplify and (hopefully) clarify DKDM creation...
[dcpomatic.git] / src / lib / audio_analysis.cc
index 78e5741e59f5b2cc365b6b9054186016b34fa429..446fcccef1607323d7851dbffe98114cda5fb841 100644 (file)
@@ -46,6 +46,7 @@ using boost::shared_ptr;
 using boost::optional;
 using boost::dynamic_pointer_cast;
 using dcp::raw_convert;
+using namespace dcpomatic;
 
 int const AudioAnalysis::_current_state_version = 3;
 
@@ -92,6 +93,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
@@ -161,6 +164,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 ());
 }
 
@@ -211,3 +218,4 @@ AudioAnalysis::overall_true_peak () const
 
        return p;
 }
+