X-Git-Url: https://git.carlh.net/gitweb/?a=blobdiff_plain;f=src%2Flib%2Fsingle_stream_audio_content.cc;h=4c59420cbfe16b3c350e13235ff01926dbde1251;hb=6fde557864505b470c438e4161ee494f29b90d63;hp=a38ef0e1e8ed2a6e2c8ac6b23fa04ec6ee3fccac;hpb=f89be8d79f4fe02be688b3cb3d1cc4e8c1aad26a;p=dcpomatic.git diff --git a/src/lib/single_stream_audio_content.cc b/src/lib/single_stream_audio_content.cc index a38ef0e1e..4c59420cb 100644 --- a/src/lib/single_stream_audio_content.cc +++ b/src/lib/single_stream_audio_content.cc @@ -21,29 +21,35 @@ #include "audio_examiner.h" #include "film.h" #include "raw_convert.h" +#include +#include + +#include "i18n.h" using std::string; using std::cout; using std::vector; +using std::list; +using std::pair; using boost::shared_ptr; -SingleStreamAudioContent::SingleStreamAudioContent (shared_ptr f) - : Content (f) - , AudioContent (f) +SingleStreamAudioContent::SingleStreamAudioContent (shared_ptr film) + : Content (film) + , AudioContent (film) { } -SingleStreamAudioContent::SingleStreamAudioContent (shared_ptr f, boost::filesystem::path p) - : Content (f, p) - , AudioContent (f, p) +SingleStreamAudioContent::SingleStreamAudioContent (shared_ptr film, boost::filesystem::path p) + : Content (film, p) + , AudioContent (film, p) { } -SingleStreamAudioContent::SingleStreamAudioContent (shared_ptr f, cxml::ConstNodePtr node, int version) - : Content (f, node) - , AudioContent (f, node) +SingleStreamAudioContent::SingleStreamAudioContent (shared_ptr film, cxml::ConstNodePtr node, int version) + : Content (film, node) + , AudioContent (film, node) , _audio_stream (new AudioStream (node->number_child ("AudioFrameRate"), AudioMapping (node->node_child ("AudioMapping"), version))) { @@ -64,7 +70,7 @@ SingleStreamAudioContent::take_from_audio_examiner (shared_ptr ex boost::mutex::scoped_lock lm (_mutex); _audio_stream.reset (new AudioStream (examiner->audio_frame_rate(), examiner->audio_channels ())); AudioMapping m = _audio_stream->mapping (); - m.make_default (); + film()->make_audio_mapping_default (m); _audio_stream->set_mapping (m); } @@ -78,3 +84,10 @@ SingleStreamAudioContent::audio_streams () const s.push_back (_audio_stream); return s; } + +void +SingleStreamAudioContent::add_properties (list >& p) const +{ + /* XXX: this could be better wrt audio streams */ + p.push_back (make_pair (_("Audio channels"), raw_convert (audio_stream()->channels ()))); +}