using boost::optional;
using boost::is_any_of;
using dcp::raw_convert;
+using namespace dcpomatic;
string const Film::metadata_file = "metadata.xml";
/** Add suitable Jobs to the JobManager to create a DCP for this Film */
void
-Film::make_dcp ()
+Film::make_dcp (bool gui)
{
if (dcp_name().find ("/") != string::npos) {
throw BadSettingError (_("name"), _("Cannot contain slashes"));
shared_ptr<TranscodeJob> tj (new TranscodeJob (shared_from_this()));
tj->set_encoder (shared_ptr<Encoder> (new DCPEncoder (shared_from_this(), tj)));
- shared_ptr<CheckContentChangeJob> cc (new CheckContentChangeJob (shared_from_this(), tj));
+ shared_ptr<CheckContentChangeJob> cc (new CheckContentChangeJob(shared_from_this(), tj, gui));
JobManager::instance()->add (cc);
}
m->set_attribute("Type", dcp::marker_to_string(i->first));
m->add_child_text(raw_convert<string>(i->second.get()));
}
+ BOOST_FOREACH (dcp::Rating i, _ratings) {
+ i.as_xml (root->add_child("Rating"));
+ }
_playlist->as_xml (root->add_child ("Playlist"), with_content_paths);
return doc;
_markers[dcp::marker_from_string(i->string_attribute("Type"))] = DCPTime(dcp::raw_convert<DCPTime::Type>(i->content()));
}
+ BOOST_FOREACH (cxml::ConstNodePtr i, f.node_children("Rating")) {
+ _ratings.push_back (dcp::Rating(i));
+ }
+
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);
/* Write backtraces to this film's directory, until another film is loaded */
* @param disable_forensic_marking_audio if not set, don't disable forensic marking of audio. If set to 0,
* disable all forensic marking; if set above 0, disable forensic marking above that channel.
*/
-list<ScreenKDM>
+list<shared_ptr<ScreenKDM> >
Film::make_kdms (
list<shared_ptr<Screen> > screens,
boost::filesystem::path cpl_file,
optional<int> disable_forensic_marking_audio
) const
{
- list<ScreenKDM> kdms;
+ list<shared_ptr<ScreenKDM> > kdms;
BOOST_FOREACH (shared_ptr<Screen> i, screens) {
if (i->recipient) {
disable_forensic_marking_audio
);
- kdms.push_back (ScreenKDM (i, kdm));
+ kdms.push_back (shared_ptr<ScreenKDM>(new DCPScreenKDM(i, kdm)));
}
}
_markers.erase (type);
}
+void
+Film::set_ratings (vector<dcp::Rating> r)
+{
+ ChangeSignaller<Film> ch (this, RATINGS);
+ _ratings = r;
+}
+
optional<DCPTime>
Film::marker (dcp::Marker type) const
{