X-Git-Url: https://main.carlh.net/gitweb/?a=blobdiff_plain;f=src%2Flib%2Faudio_content.cc;h=8458e3314c7be41b36aaccfdb8fdde437fe7b8da;hb=51cc8f575b55f2a21d8503965b628c0f59f1ed33;hp=d02728b00018f5ed6d8bc023698b6fe4a94c7536;hpb=1c13441a19aa387ddd8ac0c972207ccbbe3114d8;p=dcpomatic.git diff --git a/src/lib/audio_content.cc b/src/lib/audio_content.cc index d02728b00..8458e3314 100644 --- a/src/lib/audio_content.cc +++ b/src/lib/audio_content.cc @@ -33,6 +33,9 @@ using std::string; using std::cout; using std::vector; +using std::stringstream; +using std::fixed; +using std::setprecision; using boost::shared_ptr; using boost::dynamic_pointer_cast; using dcp::raw_convert; @@ -178,7 +181,7 @@ AudioContent::audio_analysis_path () const } boost::filesystem::path p = film->audio_analysis_dir (); - p /= digest() + "_" + audio_mapping().digest(); + p /= digest().get_value_or ("X") + "_" + audio_mapping().digest(); return p; } @@ -236,3 +239,22 @@ AudioContent::processed_audio_channels () const return audio_processor()->out_channels (audio_channels ()); } +string +AudioContent::processing_description () const +{ + stringstream d; + + if (audio_frame_rate() != resampled_audio_frame_rate ()) { + stringstream from; + from << fixed << setprecision(3) << (audio_frame_rate() / 1000.0); + stringstream to; + to << fixed << setprecision(3) << (resampled_audio_frame_rate() / 1000.0); + + d << String::compose (_("Audio will be resampled from %1kHz to %2kHz."), from.str(), to.str()); + } else { + d << _("Audio will not be resampled."); + } + + return d.str (); +} +