if (_studio) {
root->add_child("Studio")->add_child_text(*_studio);
}
+ root->add_child("TempVersion")->add_child_text(_temp_version ? "1" : "0");
+ root->add_child("PreRelease")->add_child_text(_pre_release ? "1" : "0");
+ root->add_child("RedBand")->add_child_text(_red_band ? "1" : "0");
+ root->add_child("TwoDVersionOfThreeD")->add_child_text(_two_d_version_of_three_d ? "1" : "0");
if (_luminance) {
root->add_child("LuminanceValue")->add_child_text(raw_convert<string>(_luminance->value()));
root->add_child("LuminanceUnit")->add_child_text(dcp::Luminance::unit_to_string(_luminance->unit()));
_distributor = f.optional_string_child("Distributor");
_facility = f.optional_string_child("Facility");
_studio = f.optional_string_child("Studio");
+ _temp_version = f.optional_bool_child("TempVersion").get_value_or(false);
+ _pre_release = f.optional_bool_child("PreRelease").get_value_or(false);
+ _red_band = f.optional_bool_child("RedBand").get_value_or(false);
+ _two_d_version_of_three_d = f.optional_bool_child("TwoDVersionOfThreeD").get_value_or(false);
auto value = f.optional_number_child<float>("LuminanceValue");
auto unit = f.optional_string_child("LuminanceUnit");
auto const dm = isdcf_metadata ();
- if (dm.temp_version) {
+ if (_temp_version) {
d += "-Temp";
}
- if (dm.pre_release) {
+ if (_pre_release) {
d += "-Pre";
}
- if (dm.red_band) {
+ if (_red_band) {
d += "-RedBand";
}
d += "-3D";
}
- if (dm.two_d_version_of_three_d) {
+ if (_two_d_version_of_three_d) {
d += "-2D";
}
FilmChangeSignaller ch (this, Property::THREE_D);
_three_d = t;
- if (_three_d && _isdcf_metadata.two_d_version_of_three_d) {
- FilmChangeSignaller ch (this, Property::ISDCF_METADATA);
- _isdcf_metadata.two_d_version_of_three_d = false;
+ if (_three_d && _two_d_version_of_three_d) {
+ set_two_d_version_of_three_d (false);
}
}
markers[dcp::Marker::LFOC] = length() - DCPTime::from_frames(1, video_frame_rate());
}
}
+
+
+void
+Film::set_temp_version (bool t)
+{
+ FilmChangeSignaller ch (this, Property::TEMP_VERSION);
+ _temp_version = t;
+}
+
+
+void
+Film::set_pre_release (bool p)
+{
+ FilmChangeSignaller ch (this, Property::PRE_RELEASE);
+ _pre_release = p;
+}
+
+
+void
+Film::set_red_band (bool r)
+{
+ FilmChangeSignaller ch (this, Property::RED_BAND);
+ _red_band = r;
+}
+
+
+void
+Film::set_two_d_version_of_three_d (bool t)
+{
+ FilmChangeSignaller ch (this, Property::TWO_D_VERSION_OF_THREE_D);
+ _two_d_version_of_three_d = t;
+}
+
DISTRIBUTOR,
FACILITY,
STUDIO,
+ TEMP_VERSION,
+ PRE_RELEASE,
+ RED_BAND,
+ TWO_D_VERSION_OF_THREE_D,
LUMINANCE,
};
return _studio;
}
+ bool temp_version () const {
+ return _temp_version;
+ }
+
+ bool pre_release () const {
+ return _pre_release;
+ }
+
+ bool red_band () const {
+ return _red_band;
+ }
+
+ bool two_d_version_of_three_d () const {
+ return _two_d_version_of_three_d;
+ }
+
boost::optional<dcp::Luminance> luminance () const {
return _luminance;
}
void set_chain (boost::optional<std::string> c = boost::none);
void set_facility (boost::optional<std::string> f = boost::none);
void set_studio (boost::optional<std::string> s = boost::none);
+ void set_temp_version (bool t);
+ void set_pre_release (bool p);
+ void set_red_band (bool r);
+ void set_two_d_version_of_three_d (bool t);
void set_distributor (boost::optional<std::string> d = boost::none);
void set_luminance (boost::optional<dcp::Luminance> l = boost::none);
boost::optional<std::string> _distributor;
boost::optional<std::string> _facility;
boost::optional<std::string> _studio;
+ bool _temp_version = false;
+ bool _pre_release = false;
+ bool _red_band = false;
+ bool _two_d_version_of_three_d = false;
boost::optional<dcp::Luminance> _luminance;
int _state_version;
using dcp::raw_convert;
ISDCFMetadata::ISDCFMetadata (cxml::ConstNodePtr node)
- : temp_version (node->optional_bool_child ("TempVersion").get_value_or (false))
- , pre_release (node->optional_bool_child ("PreRelease").get_value_or (false))
- , red_band (node->optional_bool_child ("RedBand").get_value_or (false))
- , chain (node->optional_string_child ("Chain").get_value_or (""))
- , two_d_version_of_three_d (node->optional_bool_child ("TwoDVersionOfThreeD").get_value_or (false))
+ : chain (node->optional_string_child ("Chain").get_value_or (""))
, mastered_luminance (node->optional_string_child ("MasteredLuminance").get_value_or (""))
{
void
ISDCFMetadata::as_xml (xmlpp::Node* root) const
{
- root->add_child("TempVersion")->add_child_text (temp_version ? "1" : "0");
- root->add_child("PreRelease")->add_child_text (pre_release ? "1" : "0");
- root->add_child("RedBand")->add_child_text (red_band ? "1" : "0");
root->add_child("Chain")->add_child_text (chain);
- root->add_child("TwoDVersionOfThreeD")->add_child_text (two_d_version_of_three_d ? "1" : "0");
root->add_child("MasteredLuminance")->add_child_text (mastered_luminance);
}
bool
operator== (ISDCFMetadata const & a, ISDCFMetadata const & b)
{
- return a.temp_version == b.temp_version &&
- a.pre_release == b.pre_release &&
- a.red_band == b.red_band &&
- a.chain == b.chain &&
- a.two_d_version_of_three_d == b.two_d_version_of_three_d &&
+ return a.chain == b.chain &&
a.mastered_luminance == b.mastered_luminance;
}
class ISDCFMetadata
{
public:
- ISDCFMetadata ()
- : temp_version (false)
- , pre_release (false)
- , red_band (false)
- , two_d_version_of_three_d (false)
- {}
-
+ ISDCFMetadata () {}
explicit ISDCFMetadata (cxml::ConstNodePtr);
void as_xml (xmlpp::Node *) const;
void read_old_metadata (std::string, std::string);
- /** true if this is a temporary version (without final picture or sound) */
- bool temp_version;
- /** true if this is a pre-release version (final picture and sound, but without accessibility features) */
- bool pre_release;
- /** true if this has adult content */
- bool red_band;
/** specific theatre chain or event */
std::string chain;
- /** true if this is a 2D version of content that also exists in 3D */
- bool two_d_version_of_three_d;
/** mastered luminance if there are multiple versions distributed (e.g. 35, 4fl, 6fl etc.) */
std::string mastered_luminance;
};
case Film::Property::RATINGS:
case Film::Property::FACILITY:
case Film::Property::STUDIO:
+ case Film::Property::TEMP_VERSION:
+ case Film::Property::PRE_RELEASE:
+ case Film::Property::RED_BAND:
+ case Film::Property::TWO_D_VERSION_OF_THREE_D:
setup_dcp_name ();
break;
default:
return;
}
- auto d = new ISDCFMetadataDialog (_panel, _film->isdcf_metadata (), _film->three_d ());
+ auto d = new ISDCFMetadataDialog (_panel, _film->isdcf_metadata ());
d->ShowModal ();
_film->set_isdcf_metadata (d->isdcf_metadata ());
d->Destroy ();
void edit_isdcf_metadata_clicked ()
{
- ISDCFMetadataDialog* d = new ISDCFMetadataDialog (_panel, Config::instance()->default_isdcf_metadata (), false);
+ auto d = new ISDCFMetadataDialog (_panel, Config::instance()->default_isdcf_metadata ());
d->ShowModal ();
Config::instance()->set_default_isdcf_metadata (d->isdcf_metadata ());
d->Destroy ();
* @param dm Initial ISDCF metadata.
* @param threed true if the film is in 3D.
*/
-ISDCFMetadataDialog::ISDCFMetadataDialog (wxWindow* parent, ISDCFMetadata dm, bool threed)
+ISDCFMetadataDialog::ISDCFMetadataDialog (wxWindow* parent, ISDCFMetadata dm)
: TableDialog (parent, _("ISDCF name"), 2, 1, true)
{
- _temp_version = add (new CheckBox(this, _("Temp version")));
- add_spacer ();
-
- _pre_release = add (new CheckBox(this, _("Pre-release")));
- add_spacer ();
-
- _red_band = add (new CheckBox(this, _("Red band")));
- add_spacer ();
-
add (_("Chain"), true);
_chain = add (new wxTextCtrl (this, wxID_ANY));
- _two_d_version_of_three_d = add (new CheckBox(this, _("2D version of content available in 3D")));
- add_spacer ();
-
- if (threed) {
- _two_d_version_of_three_d->Enable (false);
- }
-
add (_("Mastered luminance (e.g. 14fl)"), true);
_mastered_luminance = add (new wxTextCtrl (this, wxID_ANY));
- _temp_version->SetValue (dm.temp_version);
- _pre_release->SetValue (dm.pre_release);
- _red_band->SetValue (dm.red_band);
_chain->SetValue (std_to_wx (dm.chain));
- _two_d_version_of_three_d->SetValue (dm.two_d_version_of_three_d);
_mastered_luminance->SetValue (std_to_wx (dm.mastered_luminance));
layout ();
{
ISDCFMetadata dm;
- dm.temp_version = _temp_version->GetValue ();
- dm.pre_release = _pre_release->GetValue ();
- dm.red_band = _red_band->GetValue ();
dm.chain = wx_to_std (_chain->GetValue ());
- dm.two_d_version_of_three_d = _two_d_version_of_three_d->GetValue ();
dm.mastered_luminance = wx_to_std (_mastered_luminance->GetValue ());
return dm;
class ISDCFMetadataDialog : public TableDialog
{
public:
- ISDCFMetadataDialog (wxWindow *, ISDCFMetadata, bool threed);
+ ISDCFMetadataDialog (wxWindow *, ISDCFMetadata);
ISDCFMetadata isdcf_metadata () const;
private:
- wxCheckBox* _temp_version;
- wxCheckBox* _pre_release;
- wxCheckBox* _red_band;
wxTextCtrl* _chain;
- wxCheckBox* _two_d_version_of_three_d;
wxTextCtrl* _mastered_luminance;
};
overall_sizer->Layout ();
overall_sizer->SetSizeHints (this);
+ _edit_release_territory->Bind (wxEVT_BUTTON, boost::bind(&MetadataDialog::edit_release_territory, this));
+ _enable_release_territory->Bind (wxEVT_CHECKBOX, boost::bind(&MetadataDialog::enable_release_territory_changed, this));
_enable_facility->Bind (wxEVT_CHECKBOX, boost::bind(&MetadataDialog::enable_facility_changed, this));
_facility->Bind (wxEVT_TEXT, boost::bind(&MetadataDialog::facility_changed, this));
_enable_studio->Bind (wxEVT_CHECKBOX, boost::bind(&MetadataDialog::enable_studio_changed, this));
_studio->Bind (wxEVT_TEXT, boost::bind(&MetadataDialog::studio_changed, this));
+ _temp_version->Bind (wxEVT_CHECKBOX, boost::bind(&MetadataDialog::temp_version_changed, this));
+ _pre_release->Bind (wxEVT_CHECKBOX, boost::bind(&MetadataDialog::pre_release_changed, this));
+ _red_band->Bind (wxEVT_CHECKBOX, boost::bind(&MetadataDialog::red_band_changed, this));
+ _two_d_version_of_three_d->Bind (wxEVT_CHECKBOX, boost::bind(&MetadataDialog::two_d_version_of_three_d_changed, this));
_film_changed_connection = film()->Change.connect(boost::bind(&MetadataDialog::film_changed, this, _1, _2));
film_changed (ChangeType::DONE, Film::Property::RELEASE_TERRITORY);
film_changed (ChangeType::DONE, Film::Property::FACILITY);
film_changed (ChangeType::DONE, Film::Property::STUDIO);
+ film_changed (ChangeType::DONE, Film::Property::TEMP_VERSION);
+ film_changed (ChangeType::DONE, Film::Property::PRE_RELEASE);
+ film_changed (ChangeType::DONE, Film::Property::RED_BAND);
+ film_changed (ChangeType::DONE, Film::Property::TWO_D_VERSION_OF_THREE_D);
setup_sensitivity ();
}
if (film()->studio()) {
checked_set (_studio, *film()->studio());
}
+ } else if (property == Film::Property::TEMP_VERSION) {
+ checked_set (_temp_version, film()->temp_version());
+ } else if (property == Film::Property::PRE_RELEASE) {
+ checked_set (_pre_release, film()->pre_release());
+ } else if (property == Film::Property::RED_BAND) {
+ checked_set (_red_band, film()->red_band());
+ } else if (property == Film::Property::TWO_D_VERSION_OF_THREE_D) {
+ checked_set (_two_d_version_of_three_d, film()->two_d_version_of_three_d());
}
}
s->Add (_edit_release_territory, 0, wxLEFT, DCPOMATIC_SIZER_GAP);
sizer->Add (s, 0, wxEXPAND);
}
-
- _edit_release_territory->Bind (wxEVT_BUTTON, boost::bind(&MetadataDialog::edit_release_territory, this));
- _enable_release_territory->Bind (wxEVT_CHECKBOX, boost::bind(&MetadataDialog::enable_release_territory_changed, this));
}
sizer->Add (_enable_studio, 0, wxRIGHT | wxALIGN_CENTER_VERTICAL);
_studio = new wxTextCtrl (panel, wxID_ANY);
sizer->Add (_studio, 1, wxEXPAND);
+
+ _temp_version = new wxCheckBox (panel, wxID_ANY, _("Temporary version"));
+ sizer->Add (_temp_version, 0, wxALIGN_CENTER_VERTICAL);
+ sizer->AddSpacer (0);
+
+ _pre_release = new wxCheckBox (panel, wxID_ANY, _("Pre-release"));
+ sizer->Add (_pre_release, 0, wxALIGN_CENTER_VERTICAL);
+ sizer->AddSpacer (0);
+
+ _red_band = new wxCheckBox (panel, wxID_ANY, _("Red band"));
+ sizer->Add (_red_band, 0, wxALIGN_CENTER_VERTICAL);
+ sizer->AddSpacer (0);
+
+ _two_d_version_of_three_d = new wxCheckBox (panel, wxID_ANY, _("2D version of 3D DCP"));
+ sizer->Add (_two_d_version_of_three_d, 0, wxALIGN_CENTER_VERTICAL);
+ sizer->AddSpacer (0);
}
}
+void
+MetadataDialog::temp_version_changed ()
+{
+ film()->set_temp_version(_temp_version->GetValue());
+}
+
+
+void
+MetadataDialog::pre_release_changed ()
+{
+ film()->set_pre_release(_pre_release->GetValue());
+}
+
+
+void
+MetadataDialog::red_band_changed ()
+{
+ film()->set_red_band(_red_band->GetValue());
+}
+
+
+void
+MetadataDialog::two_d_version_of_three_d_changed ()
+{
+ film()->set_two_d_version_of_three_d(_two_d_version_of_three_d->GetValue());
+}
+
void enable_facility_changed ();
void studio_changed ();
void enable_studio_changed ();
+ void temp_version_changed ();
+ void pre_release_changed ();
+ void red_band_changed ();
+ void two_d_version_of_three_d_changed ();
wxCheckBox* _enable_release_territory;
/** The current release territory displayed in the UI; since we can't easily convert
wxTextCtrl* _facility;
wxCheckBox* _enable_studio;
wxTextCtrl* _studio;
+ wxCheckBox* _temp_version;
+ wxCheckBox* _pre_release;
+ wxCheckBox* _red_band;
+ wxCheckBox* _two_d_version_of_three_d;
boost::signals2::scoped_connection _film_changed_connection;
};
/* Test content type modifiers */
film->set_three_d (false);
- m.temp_version = true;
- m.pre_release = true;
- m.red_band = true;
+ film->set_temp_version (true);
+ film->set_pre_release (true);
+ film->set_red_band (true);
+ film->set_two_d_version_of_three_d (true);
m.chain = "MyChain";
- m.two_d_version_of_three_d = true;
m.mastered_luminance = "4fl";
film->set_isdcf_metadata (m);
film->set_video_frame_rate (48);
/* Test a name which is already in camelCase */
film->set_three_d (false);
- m.temp_version = false;
- m.pre_release = false;
- m.red_band = false;
+ film->set_temp_version (false);
+ film->set_pre_release (false);
+ film->set_red_band (false);
+ film->set_two_d_version_of_three_d (false);
m.chain = "";
- m.two_d_version_of_three_d = false;
m.mastered_luminance = "";
film->set_isdcf_metadata (m);
film->set_video_frame_rate (24);