Normalise labelling of types a bit.
[dcpomatic.git] / src / lib / sndfile_content.cc
index beee7cd9d0aa33c37dfa31d789b4ef076d3eacfa..549af09b10cd116857d9748f29102dca90f39b93 100644 (file)
@@ -44,17 +44,17 @@ SndfileContent::SndfileContent (shared_ptr<const Film> f, boost::filesystem::pat
 SndfileContent::SndfileContent (shared_ptr<const Film> f, shared_ptr<const cxml::Node> node)
        : Content (f, node)
        , AudioContent (f, node)
+       , _audio_mapping (node->node_child ("AudioMapping"))
 {
        _audio_channels = node->number_child<int> ("AudioChannels");
        _audio_length = node->number_child<AudioContent::Frame> ("AudioLength");
        _audio_frame_rate = node->number_child<int> ("AudioFrameRate");
-       _audio_mapping = AudioMapping (node->node_child ("AudioMapping"));
 }
 
 string
 SndfileContent::summary () const
 {
-       return String::compose (_("Sound file: %1"), file().filename().string());
+       return String::compose (_("%1 [audio]"), file().filename().string());
 }
 
 string
@@ -85,12 +85,6 @@ SndfileContent::valid_file (boost::filesystem::path f)
        return (ext == ".wav" || ext == ".aif" || ext == ".aiff");
 }
 
-shared_ptr<Content>
-SndfileContent::clone () const
-{
-       return shared_ptr<Content> (new SndfileContent (*this));
-}
-
 void
 SndfileContent::examine (shared_ptr<Job> job)
 {
@@ -115,6 +109,7 @@ SndfileContent::examine (shared_ptr<Job> job)
 
        /* XXX: do this in signal_changed...? */
        _audio_mapping = AudioMapping (_audio_channels);
+       _audio_mapping.make_default ();
        signal_changed (AudioContentProperty::AUDIO_MAPPING);
 }