#include <libcxml/cxml.h>
#include "sndfile_content.h"
#include "sndfile_decoder.h"
+#include "film.h"
#include "compose.hpp"
#include "job.h"
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<ContentAudioFrame> ("AudioLength");
+ _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]"), path().filename().string());
+}
+
+string
+SndfileContent::technical_summary () const
+{
+ return Content::technical_summary() + " - "
+ + AudioContent::technical_summary ()
+ + "sndfile";
}
string
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)
{
/* XXX: do this in signal_changed...? */
_audio_mapping = AudioMapping (_audio_channels);
+ _audio_mapping.make_default ();
signal_changed (AudioContentProperty::AUDIO_MAPPING);
}
shared_ptr<const Film> film = _film.lock ();
assert (film);
- return film->dcp_audio_frame_rate ();
+ return film->audio_frame_rate ();
}
void