BOOST_FOREACH (dcp::Rating i, _ratings) {
i.as_xml (root->add_child("Rating"));
}
+ root->add_child("ContentVersion")->add_child_text(_content_version);
_playlist->as_xml (root->add_child ("Playlist"), with_content_paths);
return doc;
_ratings.push_back (dcp::Rating(i));
}
+ _content_version = f.optional_string_child("ContentVersion").get_value_or("");
+
list<string> notes;
_playlist->set_from_xml (shared_from_this(), f.node_child ("Playlist"), _state_version, notes);
_ratings = r;
}
+void
+Film::set_content_version (string v)
+{
+ ChangeSignaller<Film> ch (this, CONTENT_VERSION);
+ _content_version = v;
+}
+
optional<DCPTime>
Film::marker (dcp::Marker type) const
{
UPLOAD_AFTER_MAKE_DCP,
REENCODE_J2K,
MARKERS,
- RATINGS
+ RATINGS,
+ CONTENT_VERSION
};
return _ratings;
}
+ std::string content_version () const {
+ return _content_version;
+ }
+
/* SET */
void set_directory (boost::filesystem::path);
void set_marker (dcp::Marker type, dcpomatic::DCPTime time);
void unset_marker (dcp::Marker type);
void set_ratings (std::vector<dcp::Rating> r);
+ void set_content_version (std::string v);
/** Emitted when some property has of the Film is about to change or has changed */
mutable boost::signals2::signal<void (ChangeType, Property)> Change;
bool _user_explicit_video_frame_rate;
std::map<dcp::Marker, dcpomatic::DCPTime> _markers;
std::vector<dcp::Rating> _ratings;
+ std::string _content_version;
int _state_version;
cpl->set_metadata (meta);
cpl->set_ratings (vector_to_list(_film->ratings()));
+ cpl->set_content_version_label_text (_film->content_version());
shared_ptr<const dcp::CertificateChain> signer;
if (_film->is_signed ()) {
);
sizer->Add (_ratings, 1, wxEXPAND);
+ add_label_to_sizer (sizer, this, _("Content version"), true);
+ _content_version = new wxTextCtrl (this, wxID_ANY);
+ sizer->Add (_content_version, 1, wxEXPAND);
+
+ shared_ptr<Film> f = _film.lock();
+ DCPOMATIC_ASSERT (f);
+ _content_version->SetValue (std_to_wx(f->content_version()));
+
overall_sizer->Add (sizer, 1, wxEXPAND | wxALL, DCPOMATIC_DIALOG_BORDER);
wxSizer* buttons = CreateSeparatedButtonSizer (wxCLOSE);
overall_sizer->Layout ();
overall_sizer->SetSizeHints (this);
+
+ _content_version->Bind (wxEVT_TEXT, boost::bind(&MetadataDialog::content_version_changed, this));
}
vector<dcp::Rating>
DCPOMATIC_ASSERT (film);
film->set_ratings (r);
}
+
+void
+MetadataDialog::content_version_changed ()
+{
+ shared_ptr<Film> film = _film.lock ();
+ DCPOMATIC_ASSERT (film);
+ film->set_content_version (wx_to_std(_content_version->GetValue()));
+}
private:
std::vector<dcp::Rating> ratings () const;
void set_ratings (std::vector<dcp::Rating> r);
+ void content_version_changed ();
boost::weak_ptr<Film> _film;
EditableList<dcp::Rating, RatingDialog>* _ratings;
+ wxTextCtrl* _content_version;
};