From 2734637c959928a7d412c709cc3433357418ae03 Mon Sep 17 00:00:00 2001 From: Carl Hetherington Date: Thu, 6 Nov 2014 11:55:05 +0000 Subject: Forward-port move of content description generation to lib/ rather than wx/. --- src/lib/audio_content.cc | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) (limited to 'src/lib/audio_content.cc') diff --git a/src/lib/audio_content.cc b/src/lib/audio_content.cc index d02728b00..988090bf8 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; @@ -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 (); +} + -- cgit v1.2.3