#include "exceptions.h"
#include "examine_content_job.h"
#include "config.h"
-#include "ui_signaller.h"
#include "playlist.h"
#include "player.h"
#include "dcp_content_type.h"
#include "safe_stringstream.h"
#include "environment_info.h"
#include "raw_convert.h"
+#include "audio_processor.h"
#include <libcxml/cxml.h>
#include <dcp/cpl.h>
#include <dcp/signer.h>
, _sequence_video (true)
, _interop (false)
, _burn_subtitles (false)
+ , _audio_processor (0)
, _state_version (current_state_version)
, _dirty (false)
{
return video_identifier() + ".mxf";
}
-boost::filesystem::path
-Film::video_mxf_filename () const
-{
- return filename_safe_name() + "_video.mxf";
-}
-
-boost::filesystem::path
-Film::audio_mxf_filename () const
-{
- return filename_safe_name() + "_audio.mxf";
-}
-
-boost::filesystem::path
-Film::subtitle_xml_filename () const
-{
- return filename_safe_name() + "_subtitle.xml";
-}
-
string
Film::filename_safe_name () const
{
root->add_child("Signed")->add_child_text (_signed ? "1" : "0");
root->add_child("Encrypted")->add_child_text (_encrypted ? "1" : "0");
root->add_child("Key")->add_child_text (_key.hex ());
+ if (_audio_processor) {
+ root->add_child("AudioProcessor")->add_child_text (_audio_processor->id ());
+ }
_playlist->as_xml (root->add_child ("Playlist"));
return doc;
}
_key = dcp::Key (f.string_child ("Key"));
+ if (f.optional_string_child ("AudioProcessor")) {
+ _audio_processor = AudioProcessor::from_id (f.string_child ("AudioProcessor"));
+ } else {
+ _audio_processor = 0;
+ }
+
list<string> notes;
/* This method is the only one that can return notes (so far) */
_playlist->set_from_xml (shared_from_this(), f.node_child ("Playlist"), _state_version, notes);
string
Film::dcp_name (bool if_created_now) const
{
+ string unfiltered;
if (use_isdcf_name()) {
- return isdcf_name (if_created_now);
+ unfiltered = isdcf_name (if_created_now);
+ } else {
+ unfiltered = name ();
}
- return name();
+ /* Filter out `bad' characters which cause problems with some systems.
+ There's no apparent list of what really is allowed, so this is a guess.
+ */
+
+ string filtered;
+ string const allowed = "0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz-_";
+ for (size_t i = 0; i < unfiltered.size(); ++i) {
+ if (allowed.find (unfiltered[i]) != string::npos) {
+ filtered += unfiltered[i];
+ }
+ }
+
+ return filtered;
}
void
signal_changed (BURN_SUBTITLES);
}
+void
+Film::set_audio_processor (AudioProcessor const * processor)
+{
+ _audio_processor = processor;
+ signal_changed (AUDIO_PROCESSOR);
+}
+
void
Film::signal_changed (Property p)
{
break;
}
- if (ui_signaller) {
- ui_signaller->emit (boost::bind (boost::ref (Changed), p));
- }
+ emit (boost::bind (boost::ref (Changed), p));
}
void
{
if (p == VideoContentProperty::VIDEO_FRAME_RATE) {
set_video_frame_rate (_playlist->best_dcp_frame_rate ());
- } else if (
- p == AudioContentProperty::AUDIO_MAPPING ||
- p == AudioContentProperty::AUDIO_CHANNELS) {
+ } else if (p == AudioContentProperty::AUDIO_STREAMS) {
signal_changed (NAME);
}
- if (ui_signaller) {
- ui_signaller->emit (boost::bind (boost::ref (ContentChanged), c, p));
- }
+ emit (boost::bind (boost::ref (ContentChanged), c, p));
}
void