Use ISDCF rather than DCI when talking about the digital cinema
authorCarl Hetherington <cth@carlh.net>
Tue, 10 Jun 2014 14:33:26 +0000 (15:33 +0100)
committerCarl Hetherington <cth@carlh.net>
Tue, 10 Jun 2014 14:33:26 +0000 (15:33 +0100)
naming convention (#362).

Reported-by: Mattias Mattsson
31 files changed:
ChangeLog
src/lib/config.cc
src/lib/config.h
src/lib/dci_metadata.cc [deleted file]
src/lib/dci_metadata.h [deleted file]
src/lib/dcp_content_type.cc
src/lib/dcp_content_type.h
src/lib/film.cc
src/lib/film.h
src/lib/isdcf_metadata.cc [new file with mode: 0644]
src/lib/isdcf_metadata.h [new file with mode: 0644]
src/lib/ratio.h
src/lib/wscript
src/tools/dcpomatic_create.cc
src/wx/config_dialog.cc
src/wx/dci_metadata_dialog.cc [deleted file]
src/wx/dci_metadata_dialog.h [deleted file]
src/wx/film_editor.cc
src/wx/film_editor.h
src/wx/isdcf_metadata_dialog.cc [new file with mode: 0644]
src/wx/isdcf_metadata_dialog.h [new file with mode: 0644]
src/wx/wscript
test/4k_test.cc
test/audio_delay_test.cc
test/black_fill_test.cc
test/film_metadata_test.cc
test/play_test.cc
test/recover_test.cc
test/scaling_test.cc
test/silence_padding_test.cc
test/test.cc

index 34513064677290e44025287ef0a427c587c03088..d9aeec1fb0ffe23ff77047ab387e4eb18c2b5220 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,8 @@
 2014-06-10  Carl Hetherington  <cth@carlh.net>
 
+       * Rename DCI to ISDCF when talking about the digital cinema
+       naming convention (#362).
+
        * Fix crash when opening the timeline with no content (#369).
 
 2014-06-09  Carl Hetherington  <cth@carlh.net>
index b97ad559dc949c8f21da787e51611e6bf4e48a0b..0c3dd023d165b1d285ba98ec1019a4d918432bf5 100644 (file)
@@ -64,7 +64,7 @@ Config::Config ()
        , _allow_any_dcp_frame_rate (false)
        , _default_still_length (10)
        , _default_container (Ratio::from_id ("185"))
-       , _default_dcp_content_type (DCPContentType::from_dci_name ("TST"))
+       , _default_dcp_content_type (DCPContentType::from_isdcf_name ("TST"))
        , _default_j2k_bandwidth (100000000)
        , _default_audio_delay (0)
        , _kdm_email (
@@ -141,13 +141,18 @@ Config::read ()
 
        c = f.optional_string_child ("DefaultDCPContentType");
        if (c) {
-               _default_dcp_content_type = DCPContentType::from_dci_name (c.get ());
+               _default_dcp_content_type = DCPContentType::from_isdcf_name (c.get ());
        }
 
        _dcp_metadata.issuer = f.optional_string_child ("DCPMetadataIssuer").get_value_or ("");
        _dcp_metadata.creator = f.optional_string_child ("DCPMetadataCreator").get_value_or ("");
 
-       _default_dci_metadata = DCIMetadata (f.node_child ("DCIMetadata"));
+       if (version && version.get() >= 2) {
+               _default_isdcf_metadata = ISDCFMetadata (f.node_child ("ISDCFMetadata"));
+       } else {
+               _default_isdcf_metadata = ISDCFMetadata (f.node_child ("DCIMetadata"));
+       }
+       
        _default_still_length = f.optional_number_child<int>("DefaultStillLength").get_value_or (10);
        _default_j2k_bandwidth = f.optional_number_child<int>("DefaultJ2KBandwidth").get_value_or (200000000);
        _default_audio_delay = f.optional_number_child<int>("DefaultAudioDelay").get_value_or (0);
@@ -245,7 +250,7 @@ Config::read_old_metadata ()
                } else if (k == "default_container") {
                        _default_container = Ratio::from_id (v);
                } else if (k == "default_dcp_content_type") {
-                       _default_dcp_content_type = DCPContentType::from_dci_name (v);
+                       _default_dcp_content_type = DCPContentType::from_isdcf_name (v);
                } else if (k == "dcp_metadata_issuer") {
                        _dcp_metadata.issuer = v;
                } else if (k == "dcp_metadata_creator") {
@@ -254,7 +259,7 @@ Config::read_old_metadata ()
                        _dcp_metadata.issue_date = v;
                }
 
-               _default_dci_metadata.read_old_metadata (k, v);
+               _default_isdcf_metadata.read_old_metadata (k, v);
        }
 }
 
@@ -315,7 +320,7 @@ Config::write () const
        xmlpp::Document doc;
        xmlpp::Element* root = doc.create_root_node ("Config");
 
-       root->add_child("Version")->add_child_text ("1");
+       root->add_child("Version")->add_child_text ("2");
        root->add_child("NumLocalEncodingThreads")->add_child_text (raw_convert<string> (_num_local_encoding_threads));
        root->add_child("DefaultDirectory")->add_child_text (_default_directory.string ());
        root->add_child("ServerPortBase")->add_child_text (raw_convert<string> (_server_port_base));
@@ -339,12 +344,12 @@ Config::write () const
                root->add_child("DefaultContainer")->add_child_text (_default_container->id ());
        }
        if (_default_dcp_content_type) {
-               root->add_child("DefaultDCPContentType")->add_child_text (_default_dcp_content_type->dci_name ());
+               root->add_child("DefaultDCPContentType")->add_child_text (_default_dcp_content_type->isdcf_name ());
        }
        root->add_child("DCPMetadataIssuer")->add_child_text (_dcp_metadata.issuer);
        root->add_child("DCPMetadataCreator")->add_child_text (_dcp_metadata.creator);
 
-       _default_dci_metadata.as_xml (root->add_child ("DCIMetadata"));
+       _default_isdcf_metadata.as_xml (root->add_child ("ISDCFMetadata"));
 
        root->add_child("DefaultStillLength")->add_child_text (raw_convert<string> (_default_still_length));
        root->add_child("DefaultJ2KBandwidth")->add_child_text (raw_convert<string> (_default_j2k_bandwidth));
index bd8cfe2973b43ddc258c0780a7e279fa82c6da74..671f53ef32dbcaf955f8109e6d46de6444ab8158 100644 (file)
@@ -29,7 +29,7 @@
 #include <boost/signals2.hpp>
 #include <boost/filesystem.hpp>
 #include <libdcp/metadata.h>
-#include "dci_metadata.h"
+#include "isdcf_metadata.h"
 #include "colour_conversion.h"
 #include "server.h"
 
@@ -121,8 +121,8 @@ public:
                return _allow_any_dcp_frame_rate;
        }
        
-       DCIMetadata default_dci_metadata () const {
-               return _default_dci_metadata;
+       ISDCFMetadata default_isdcf_metadata () const {
+               return _default_isdcf_metadata;
        }
 
        boost::optional<std::string> language () const {
@@ -254,8 +254,8 @@ public:
                changed ();
        }
 
-       void set_default_dci_metadata (DCIMetadata d) {
-               _default_dci_metadata = d;
+       void set_default_isdcf_metadata (ISDCFMetadata d) {
+               _default_isdcf_metadata = d;
                changed ();
        }
 
@@ -389,8 +389,8 @@ private:
        std::list<int> _allowed_dcp_frame_rates;
        /** Allow any video frame rate for the DCP; if true, overrides _allowed_dcp_frame_rates */
        bool _allow_any_dcp_frame_rate;
-       /** Default DCI metadata for newly-created Films */
-       DCIMetadata _default_dci_metadata;
+       /** Default ISDCF metadata for newly-created Films */
+       ISDCFMetadata _default_isdcf_metadata;
        boost::optional<std::string> _language;
        int _default_still_length;
        Ratio const * _default_container;
diff --git a/src/lib/dci_metadata.cc b/src/lib/dci_metadata.cc
deleted file mode 100644 (file)
index ccdc1ee..0000000
+++ /dev/null
@@ -1,74 +0,0 @@
-/*
-    Copyright (C) 2012-2014 Carl Hetherington <cth@carlh.net>
-
-    This program is free software; you can redistribute it and/or modify
-    it under the terms of the GNU General Public License as published by
-    the Free Software Foundation; either version 2 of the License, or
-    (at your option) any later version.
-
-    This program is distributed in the hope that it will be useful,
-    but WITHOUT ANY WARRANTY; without even the implied warranty of
-    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-    GNU General Public License for more details.
-
-    You should have received a copy of the GNU General Public License
-    along with this program; if not, write to the Free Software
-    Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
-
-*/
-
-#include <iostream>
-#include <libcxml/cxml.h>
-#include <libdcp/raw_convert.h>
-#include "dci_metadata.h"
-
-#include "i18n.h"
-
-using std::string;
-using boost::shared_ptr;
-using libdcp::raw_convert;
-
-DCIMetadata::DCIMetadata (shared_ptr<const cxml::Node> node)
-{
-       content_version = node->number_child<int> ("ContentVersion");
-       audio_language = node->string_child ("AudioLanguage");
-       subtitle_language = node->string_child ("SubtitleLanguage");
-       territory = node->string_child ("Territory");
-       rating = node->string_child ("Rating");
-       studio = node->string_child ("Studio");
-       facility = node->string_child ("Facility");
-       package_type = node->string_child ("PackageType");
-}
-
-void
-DCIMetadata::as_xml (xmlpp::Node* root) const
-{
-       root->add_child("ContentVersion")->add_child_text (raw_convert<string> (content_version));
-       root->add_child("AudioLanguage")->add_child_text (audio_language);
-       root->add_child("SubtitleLanguage")->add_child_text (subtitle_language);
-       root->add_child("Territory")->add_child_text (territory);
-       root->add_child("Rating")->add_child_text (rating);
-       root->add_child("Studio")->add_child_text (studio);
-       root->add_child("Facility")->add_child_text (facility);
-       root->add_child("PackageType")->add_child_text (package_type);
-}
-
-void
-DCIMetadata::read_old_metadata (string k, string v)
-{
-       if (k == N_("audio_language")) {
-               audio_language = v;
-       } else if (k == N_("subtitle_language")) {
-               subtitle_language = v;
-       } else if (k == N_("territory")) {
-               territory = v;
-       } else if (k == N_("rating")) {
-               rating = v;
-       } else if (k == N_("studio")) {
-               studio = v;
-       } else if (k == N_("facility")) {
-               facility = v;
-       } else if (k == N_("package_type")) {
-               package_type = v;
-       }
-}      
diff --git a/src/lib/dci_metadata.h b/src/lib/dci_metadata.h
deleted file mode 100644 (file)
index 738e439..0000000
+++ /dev/null
@@ -1,52 +0,0 @@
-/*
-    Copyright (C) 2012 Carl Hetherington <cth@carlh.net>
-
-    This program is free software; you can redistribute it and/or modify
-    it under the terms of the GNU General Public License as published by
-    the Free Software Foundation; either version 2 of the License, or
-    (at your option) any later version.
-
-    This program is distributed in the hope that it will be useful,
-    but WITHOUT ANY WARRANTY; without even the implied warranty of
-    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-    GNU General Public License for more details.
-
-    You should have received a copy of the GNU General Public License
-    along with this program; if not, write to the Free Software
-    Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
-
-*/
-
-#ifndef DCPOMATIC_DCI_METADATA_H
-#define DCPOMATIC_DCI_METADATA_H
-
-#include <string>
-#include <libxml++/libxml++.h>
-
-namespace cxml {
-       class Node;
-}
-
-class DCIMetadata
-{
-public:
-       DCIMetadata ()
-               : content_version (1)
-       {}
-       
-       DCIMetadata (boost::shared_ptr<const cxml::Node>);
-
-       void as_xml (xmlpp::Node *) const;
-       void read_old_metadata (std::string, std::string);
-
-       int content_version;
-       std::string audio_language;
-       std::string subtitle_language;
-       std::string territory;
-       std::string rating;
-       std::string studio;
-       std::string facility;
-       std::string package_type;
-};
-
-#endif
index 82bd5fa018429c6ceea666cc580204e58b5a735d..f24ed95ea24de85c74dd4d6b646fe744cc526f36 100644 (file)
@@ -33,7 +33,7 @@ vector<DCPContentType const *> DCPContentType::_dcp_content_types;
 DCPContentType::DCPContentType (string p, libdcp::ContentKind k, string d)
        : _pretty_name (p)
        , _libdcp_kind (k)
-       , _dci_name (d)
+       , _isdcf_name (d)
 {
 
 }
@@ -66,10 +66,10 @@ DCPContentType::from_pretty_name (string n)
 }
 
 DCPContentType const *
-DCPContentType::from_dci_name (string n)
+DCPContentType::from_isdcf_name (string n)
 {
        for (vector<DCPContentType const *>::const_iterator i = _dcp_content_types.begin(); i != _dcp_content_types.end(); ++i) {
-               if ((*i)->dci_name() == n) {
+               if ((*i)->isdcf_name() == n) {
                        return *i;
                }
        }
index 965c163478af5fa30eeeefe3b36a1b0522a86d4d..88f3c4a857e18d8e1574846906118ec1921c344f 100644 (file)
@@ -45,12 +45,12 @@ public:
                return _libdcp_kind;
        }
 
-       std::string dci_name () const {
-               return _dci_name;
+       std::string isdcf_name () const {
+               return _isdcf_name;
        }
 
        static DCPContentType const * from_pretty_name (std::string);
-       static DCPContentType const * from_dci_name (std::string);
+       static DCPContentType const * from_isdcf_name (std::string);
        static DCPContentType const * from_index (int);
        static int as_index (DCPContentType const *);
        static std::vector<DCPContentType const *> all ();
@@ -59,7 +59,7 @@ public:
 private:
        std::string _pretty_name;
        libdcp::ContentKind _libdcp_kind;
-       std::string _dci_name;
+       std::string _isdcf_name;
 
        /** All available DCP content types */
        static std::vector<DCPContentType const *> _dcp_content_types;
index 9dce80071c652659d6a52ffe6d76f6dbb10ffaec..fb30260395375d3cd79791cabd0b17b9dfb43c05 100644 (file)
@@ -90,8 +90,10 @@ using libdcp::raw_convert;
  * Subtitle offset changed to subtitle y offset, and subtitle x offset added.
  * 7 -> 8
  * Use <Scale> tag in <VideoContent> rather than <Ratio>.
+ * 8 -> 9
+ * DCI -> ISDCF
  */
-int const Film::current_state_version = 8;
+int const Film::current_state_version = 9;
 
 /** Construct a Film object in a given directory.
  *
@@ -100,7 +102,7 @@ int const Film::current_state_version = 8;
 
 Film::Film (boost::filesystem::path dir, bool log)
        : _playlist (new Playlist)
-       , _use_dci_name (true)
+       , _use_isdcf_name (true)
        , _dcp_content_type (Config::instance()->default_dcp_content_type ())
        , _container (Config::instance()->default_container ())
        , _resolution (RESOLUTION_2K)
@@ -109,7 +111,7 @@ Film::Film (boost::filesystem::path dir, bool log)
        , _signed (true)
        , _encrypted (false)
        , _j2k_bandwidth (Config::instance()->default_j2k_bandwidth ())
-       , _dci_metadata (Config::instance()->default_dci_metadata ())
+       , _isdcf_metadata (Config::instance()->default_isdcf_metadata ())
        , _video_frame_rate (24)
        , _audio_channels (6)
        , _three_d (false)
@@ -118,7 +120,7 @@ Film::Film (boost::filesystem::path dir, bool log)
        , _state_version (current_state_version)
        , _dirty (false)
 {
-       set_dci_date_today ();
+       set_isdcf_date_today ();
 
        _playlist->Changed.connect (bind (&Film::playlist_changed, this));
        _playlist->ContentChanged.connect (bind (&Film::playlist_content_changed, this, _1, _2));
@@ -245,7 +247,7 @@ Film::audio_analysis_dir () const
 void
 Film::make_dcp ()
 {
-       set_dci_date_today ();
+       set_isdcf_date_today ();
        
        if (dcp_name().find ("/") != string::npos) {
                throw BadSettingError (_("name"), _("cannot contain slashes"));
@@ -349,10 +351,10 @@ Film::metadata () const
 
        root->add_child("Version")->add_child_text (raw_convert<string> (current_state_version));
        root->add_child("Name")->add_child_text (_name);
-       root->add_child("UseDCIName")->add_child_text (_use_dci_name ? "1" : "0");
+       root->add_child("UseISDCFName")->add_child_text (_use_isdcf_name ? "1" : "0");
 
        if (_dcp_content_type) {
-               root->add_child("DCPContentType")->add_child_text (_dcp_content_type->dci_name ());
+               root->add_child("DCPContentType")->add_child_text (_dcp_content_type->isdcf_name ());
        }
 
        if (_container) {
@@ -363,9 +365,9 @@ Film::metadata () const
        root->add_child("Scaler")->add_child_text (_scaler->id ());
        root->add_child("WithSubtitles")->add_child_text (_with_subtitles ? "1" : "0");
        root->add_child("J2KBandwidth")->add_child_text (raw_convert<string> (_j2k_bandwidth));
-       _dci_metadata.as_xml (root->add_child ("DCIMetadata"));
+       _isdcf_metadata.as_xml (root->add_child ("ISDCFMetadata"));
        root->add_child("VideoFrameRate")->add_child_text (raw_convert<string> (_video_frame_rate));
-       root->add_child("DCIDate")->add_child_text (boost::gregorian::to_iso_string (_dci_date));
+       root->add_child("ISDCFDate")->add_child_text (boost::gregorian::to_iso_string (_isdcf_date));
        root->add_child("AudioChannels")->add_child_text (raw_convert<string> (_audio_channels));
        root->add_child("ThreeD")->add_child_text (_three_d ? "1" : "0");
        root->add_child("SequenceVideo")->add_child_text (_sequence_video ? "1" : "0");
@@ -407,12 +409,20 @@ Film::read_metadata ()
        }
        
        _name = f.string_child ("Name");
-       _use_dci_name = f.bool_child ("UseDCIName");
+       if (_state_version >= 9) {
+               _use_isdcf_name = f.bool_child ("UseISDCFName");
+               _isdcf_metadata = ISDCFMetadata (f.node_child ("ISDCFMetadata"));
+               _isdcf_date = boost::gregorian::from_undelimited_string (f.string_child ("ISDCFDate"));
+       } else {
+               _use_isdcf_name = f.bool_child ("UseDCIName");
+               _isdcf_metadata = ISDCFMetadata (f.node_child ("DCIMetadata"));
+               _isdcf_date = boost::gregorian::from_undelimited_string (f.string_child ("DCIDate"));
+       }
 
        {
                optional<string> c = f.optional_string_child ("DCPContentType");
                if (c) {
-                       _dcp_content_type = DCPContentType::from_dci_name (c.get ());
+                       _dcp_content_type = DCPContentType::from_isdcf_name (c.get ());
                }
        }
 
@@ -427,9 +437,7 @@ Film::read_metadata ()
        _scaler = Scaler::from_id (f.string_child ("Scaler"));
        _with_subtitles = f.bool_child ("WithSubtitles");
        _j2k_bandwidth = f.number_child<int> ("J2KBandwidth");
-       _dci_metadata = DCIMetadata (f.node_child ("DCIMetadata"));
        _video_frame_rate = f.number_child<int> ("VideoFrameRate");
-       _dci_date = boost::gregorian::from_undelimited_string (f.string_child ("DCIDate"));
        _signed = f.optional_bool_child("Signed").get_value_or (true);
        _encrypted = f.bool_child ("Encrypted");
        _audio_channels = f.number_child<int> ("AudioChannels");
@@ -476,9 +484,9 @@ Film::file (boost::filesystem::path f) const
        return p;
 }
 
-/** @return a DCI-compliant name for a DCP of this film */
+/** @return a ISDCF-compliant name for a DCP of this film */
 string
-Film::dci_name (bool if_created_now) const
+Film::isdcf_name (bool if_created_now) const
 {
        stringstream d;
 
@@ -497,8 +505,8 @@ Film::dci_name (bool if_created_now) const
        d << fixed_name;
 
        if (dcp_content_type()) {
-               d << "_" << dcp_content_type()->dci_name();
-               d << "-" << dci_metadata().content_version;
+               d << "_" << dcp_content_type()->isdcf_name();
+               d << "-" << isdcf_metadata().content_version;
        }
 
        if (three_d ()) {
@@ -510,10 +518,10 @@ Film::dci_name (bool if_created_now) const
        }
 
        if (container()) {
-               d << "_" << container()->dci_name();
+               d << "_" << container()->isdcf_name();
        }
 
-       DCIMetadata const dm = dci_metadata ();
+       ISDCFMetadata const dm = isdcf_metadata ();
 
        if (!dm.audio_language.empty ()) {
                d << "_" << dm.audio_language;
@@ -561,7 +569,7 @@ Film::dci_name (bool if_created_now) const
        if (if_created_now) {
                d << "_" << boost::gregorian::to_iso_string (boost::gregorian::day_clock::local_day ());
        } else {
-               d << "_" << boost::gregorian::to_iso_string (_dci_date);
+               d << "_" << boost::gregorian::to_iso_string (_isdcf_date);
        }
 
        if (!dm.facility.empty ()) {
@@ -579,8 +587,8 @@ Film::dci_name (bool if_created_now) const
 string
 Film::dcp_name (bool if_created_now) const
 {
-       if (use_dci_name()) {
-               return dci_name (if_created_now);
+       if (use_isdcf_name()) {
+               return isdcf_name (if_created_now);
        }
 
        return name();
@@ -602,10 +610,10 @@ Film::set_name (string n)
 }
 
 void
-Film::set_use_dci_name (bool u)
+Film::set_use_isdcf_name (bool u)
 {
-       _use_dci_name = u;
-       signal_changed (USE_DCI_NAME);
+       _use_isdcf_name = u;
+       signal_changed (USE_ISDCF_NAME);
 }
 
 void
@@ -651,10 +659,10 @@ Film::set_j2k_bandwidth (int b)
 }
 
 void
-Film::set_dci_metadata (DCIMetadata m)
+Film::set_isdcf_metadata (ISDCFMetadata m)
 {
-       _dci_metadata = m;
-       signal_changed (DCI_METADATA);
+       _isdcf_metadata = m;
+       signal_changed (ISDCF_METADATA);
 }
 
 void
@@ -708,9 +716,9 @@ Film::signal_changed (Property p)
 }
 
 void
-Film::set_dci_date_today ()
+Film::set_isdcf_date_today ()
 {
-       _dci_date = boost::gregorian::day_clock::local_day ();
+       _isdcf_date = boost::gregorian::day_clock::local_day ();
 }
 
 boost::filesystem::path
index 909bc0beb51aacda7ea755c67e987f19f8ebaf1a..f77309862badc22fd540006ead58e98726c6f9ef 100644 (file)
@@ -35,7 +35,7 @@
 #include <libdcp/kdm.h>
 #include "util.h"
 #include "types.h"
-#include "dci_metadata.h"
+#include "isdcf_metadata.h"
 #include "frame_rate_change.h"
 
 class DCPContentType;
@@ -88,7 +88,7 @@ public:
        void write_metadata () const;
        boost::shared_ptr<xmlpp::Document> metadata () const;
 
-       std::string dci_name (bool if_created_now) const;
+       std::string isdcf_name (bool if_created_now) const;
        std::string dcp_name (bool if_created_now = false) const;
 
        /** @return true if our state has changed since we last saved it */
@@ -151,7 +151,7 @@ public:
        enum Property {
                NONE,
                NAME,
-               USE_DCI_NAME,
+               USE_ISDCF_NAME,
                /** The playlist's content list has changed (i.e. content has been added, moved around or removed) */
                CONTENT,
                DCP_CONTENT_TYPE,
@@ -162,7 +162,7 @@ public:
                SIGNED,
                ENCRYPTED,
                J2K_BANDWIDTH,
-               DCI_METADATA,
+               ISDCF_METADATA,
                VIDEO_FRAME_RATE,
                AUDIO_CHANNELS,
                /** The setting of _three_d has been changed */
@@ -182,8 +182,8 @@ public:
                return _name;
        }
 
-       bool use_dci_name () const {
-               return _use_dci_name;
+       bool use_isdcf_name () const {
+               return _use_isdcf_name;
        }
 
        DCPContentType const * dcp_content_type () const {
@@ -219,8 +219,8 @@ public:
                return _j2k_bandwidth;
        }
 
-       DCIMetadata dci_metadata () const {
-               return _dci_metadata;
+       ISDCFMetadata isdcf_metadata () const {
+               return _isdcf_metadata;
        }
 
        /** @return The frame rate of the DCP */
@@ -249,7 +249,7 @@ public:
 
        void set_directory (boost::filesystem::path);
        void set_name (std::string);
-       void set_use_dci_name (bool);
+       void set_use_isdcf_name (bool);
        void examine_and_add_content (boost::shared_ptr<Content>);
        void add_content (boost::shared_ptr<Content>);
        void remove_content (boost::shared_ptr<Content>);
@@ -263,11 +263,11 @@ public:
        void set_signed (bool);
        void set_encrypted (bool);
        void set_j2k_bandwidth (int);
-       void set_dci_metadata (DCIMetadata);
+       void set_isdcf_metadata (ISDCFMetadata);
        void set_video_frame_rate (int);
        void set_audio_channels (int);
        void set_three_d (bool);
-       void set_dci_date_today ();
+       void set_isdcf_date_today ();
        void set_sequence_video (bool);
        void set_interop (bool);
 
@@ -300,8 +300,8 @@ private:
        
        /** Name for DCP-o-matic */
        std::string _name;
-       /** True if a auto-generated DCI-compliant name should be used for our DCP */
-       bool _use_dci_name;
+       /** True if a auto-generated ISDCF-compliant name should be used for our DCP */
+       bool _use_isdcf_name;
        /** The type of content that this Film represents (feature, trailer etc.) */
        DCPContentType const * _dcp_content_type;
        /** The container to put this Film in (flat, scope, etc.) */
@@ -316,12 +316,12 @@ private:
        bool _encrypted;
        /** bandwidth for J2K files in bits per second */
        int _j2k_bandwidth;
-       /** DCI naming stuff */
-       DCIMetadata _dci_metadata;
+       /** ISDCF naming stuff */
+       ISDCFMetadata _isdcf_metadata;
        /** Frames per second to run our DCP at */
        int _video_frame_rate;
-       /** The date that we should use in a DCI name */
-       boost::gregorian::date _dci_date;
+       /** The date that we should use in a ISDCF name */
+       boost::gregorian::date _isdcf_date;
        /** Number of audio channels to put in the DCP */
        int _audio_channels;
        /** If true, the DCP will be written in 3D mode; otherwise in 2D.
diff --git a/src/lib/isdcf_metadata.cc b/src/lib/isdcf_metadata.cc
new file mode 100644 (file)
index 0000000..ae99280
--- /dev/null
@@ -0,0 +1,74 @@
+/*
+    Copyright (C) 2012-2014 Carl Hetherington <cth@carlh.net>
+
+    This program is free software; you can redistribute it and/or modify
+    it under the terms of the GNU General Public License as published by
+    the Free Software Foundation; either version 2 of the License, or
+    (at your option) any later version.
+
+    This program is distributed in the hope that it will be useful,
+    but WITHOUT ANY WARRANTY; without even the implied warranty of
+    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+    GNU General Public License for more details.
+
+    You should have received a copy of the GNU General Public License
+    along with this program; if not, write to the Free Software
+    Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+
+*/
+
+#include <iostream>
+#include <libcxml/cxml.h>
+#include <libdcp/raw_convert.h>
+#include "isdcf_metadata.h"
+
+#include "i18n.h"
+
+using std::string;
+using boost::shared_ptr;
+using libdcp::raw_convert;
+
+ISDCFMetadata::ISDCFMetadata (shared_ptr<const cxml::Node> node)
+{
+       content_version = node->number_child<int> ("ContentVersion");
+       audio_language = node->string_child ("AudioLanguage");
+       subtitle_language = node->string_child ("SubtitleLanguage");
+       territory = node->string_child ("Territory");
+       rating = node->string_child ("Rating");
+       studio = node->string_child ("Studio");
+       facility = node->string_child ("Facility");
+       package_type = node->string_child ("PackageType");
+}
+
+void
+ISDCFMetadata::as_xml (xmlpp::Node* root) const
+{
+       root->add_child("ContentVersion")->add_child_text (raw_convert<string> (content_version));
+       root->add_child("AudioLanguage")->add_child_text (audio_language);
+       root->add_child("SubtitleLanguage")->add_child_text (subtitle_language);
+       root->add_child("Territory")->add_child_text (territory);
+       root->add_child("Rating")->add_child_text (rating);
+       root->add_child("Studio")->add_child_text (studio);
+       root->add_child("Facility")->add_child_text (facility);
+       root->add_child("PackageType")->add_child_text (package_type);
+}
+
+void
+ISDCFMetadata::read_old_metadata (string k, string v)
+{
+       if (k == N_("audio_language")) {
+               audio_language = v;
+       } else if (k == N_("subtitle_language")) {
+               subtitle_language = v;
+       } else if (k == N_("territory")) {
+               territory = v;
+       } else if (k == N_("rating")) {
+               rating = v;
+       } else if (k == N_("studio")) {
+               studio = v;
+       } else if (k == N_("facility")) {
+               facility = v;
+       } else if (k == N_("package_type")) {
+               package_type = v;
+       }
+}      
diff --git a/src/lib/isdcf_metadata.h b/src/lib/isdcf_metadata.h
new file mode 100644 (file)
index 0000000..cd63ba2
--- /dev/null
@@ -0,0 +1,52 @@
+/*
+    Copyright (C) 2012 Carl Hetherington <cth@carlh.net>
+
+    This program is free software; you can redistribute it and/or modify
+    it under the terms of the GNU General Public License as published by
+    the Free Software Foundation; either version 2 of the License, or
+    (at your option) any later version.
+
+    This program is distributed in the hope that it will be useful,
+    but WITHOUT ANY WARRANTY; without even the implied warranty of
+    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+    GNU General Public License for more details.
+
+    You should have received a copy of the GNU General Public License
+    along with this program; if not, write to the Free Software
+    Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+
+*/
+
+#ifndef DCPOMATIC_ISDCF_METADATA_H
+#define DCPOMATIC_ISDCF_METADATA_H
+
+#include <string>
+#include <libxml++/libxml++.h>
+
+namespace cxml {
+       class Node;
+}
+
+class ISDCFMetadata
+{
+public:
+       ISDCFMetadata ()
+               : content_version (1)
+       {}
+       
+       ISDCFMetadata (boost::shared_ptr<const cxml::Node>);
+
+       void as_xml (xmlpp::Node *) const;
+       void read_old_metadata (std::string, std::string);
+
+       int content_version;
+       std::string audio_language;
+       std::string subtitle_language;
+       std::string territory;
+       std::string rating;
+       std::string studio;
+       std::string facility;
+       std::string package_type;
+};
+
+#endif
index f3354f1b631c06bad6eda7073c1d75a57dc64866..8b1a1fc716dc61d9175c6144e30f34ea27bdf39f 100644 (file)
@@ -31,7 +31,7 @@ public:
                : _ratio (ratio)
                , _id (id)
                , _nickname (n)
-               , _dci_name (d)
+               , _isdcf_name (d)
        {}
 
        std::string id () const {
@@ -42,8 +42,8 @@ public:
                return _nickname;
        }
 
-       std::string dci_name () const {
-               return _dci_name;
+       std::string isdcf_name () const {
+               return _isdcf_name;
        }
 
        float ratio () const {
@@ -62,7 +62,7 @@ private:
        std::string _id;
        /** nickname (e.g. Flat, Scope) */
        std::string _nickname;
-       std::string _dci_name;
+       std::string _isdcf_name;
 
        static std::vector<Ratio const *> _ratios;      
 };
index 517ad7787b9ce164273c44c46cecc7c99d2c2a3e..9333687769fe1acd1ade6bbffd4e3adf4318092d 100644 (file)
@@ -14,7 +14,6 @@ sources = """
           content.cc
           content_factory.cc
           cross.cc
-          dci_metadata.cc
           dcp_content_type.cc
           dcp_video_frame.cc
           decoder.cc
@@ -37,6 +36,7 @@ sources = """
           image_decoder.cc
           image_examiner.cc
           image_proxy.cc
+          isdcf_metadata.cc
           job.cc
           job_manager.cc
           kdm.cc
index a49780276b1a0a6d8105850246bb792908eea832..c30f4e51e7fc66c7963f3aaa2f65b3c7b9c1296d 100644 (file)
@@ -74,7 +74,7 @@ main (int argc, char* argv[])
        dcpomatic_setup ();
 
        string name;
-       DCPContentType const * dcp_content_type = DCPContentType::from_dci_name ("TST");
+       DCPContentType const * dcp_content_type = DCPContentType::from_isdcf_name ("TST");
        Ratio const * container_ratio = 0;
        Ratio const * content_ratio = 0;
        int still_length = 10;
@@ -110,7 +110,7 @@ main (int argc, char* argv[])
                        name = optarg;
                        break;
                case 'c':
-                       dcp_content_type = DCPContentType::from_dci_name (optarg);
+                       dcp_content_type = DCPContentType::from_isdcf_name (optarg);
                        if (dcp_content_type == 0) {
                                cerr << "Bad DCP content type.\n";
                                help (argv[0]);
index 684d2496e67feb3a53e7903efd6d03e048c955a7..e65e931d023b2db5bda5381a096e03d269a1d3f0 100644 (file)
@@ -40,7 +40,7 @@
 #include "editable_list.h"
 #include "filter_dialog.h"
 #include "dir_picker_ctrl.h"
-#include "dci_metadata_dialog.h"
+#include "isdcf_metadata_dialog.h"
 #include "preset_colour_conversion_dialog.h"
 #include "server_dialog.h"
 
@@ -314,9 +314,9 @@ public:
 #endif
                table->Add (_directory, 1, wxEXPAND);
                
-               add_label_to_sizer (table, panel, _("Default DCI name details"), true);
-               _dci_metadata_button = new wxButton (panel, wxID_ANY, _("Edit..."));
-               table->Add (_dci_metadata_button);
+               add_label_to_sizer (table, panel, _("Default ISDCF name details"), true);
+               _isdcf_metadata_button = new wxButton (panel, wxID_ANY, _("Edit..."));
+               table->Add (_isdcf_metadata_button);
                
                add_label_to_sizer (table, panel, _("Default container"), true);
                _container = new wxChoice (panel, wxID_ANY);
@@ -361,7 +361,7 @@ public:
                _directory->SetPath (std_to_wx (config->default_directory_or (wx_to_std (wxStandardPaths::Get().GetDocumentsDir())).string ()));
                _directory->Bind (wxEVT_COMMAND_DIRPICKER_CHANGED, boost::bind (&DefaultsPage::directory_changed, this));
                
-               _dci_metadata_button->Bind (wxEVT_COMMAND_BUTTON_CLICKED, boost::bind (&DefaultsPage::edit_dci_metadata_clicked, this, parent));
+               _isdcf_metadata_button->Bind (wxEVT_COMMAND_BUTTON_CLICKED, boost::bind (&DefaultsPage::edit_isdcf_metadata_clicked, this, parent));
                
                vector<Ratio const *> ratio = Ratio::all ();
                int n = 0;
@@ -419,11 +419,11 @@ private:
                Config::instance()->set_default_directory (wx_to_std (_directory->GetPath ()));
        }
 
-       void edit_dci_metadata_clicked (wxWindow* parent)
+       void edit_isdcf_metadata_clicked (wxWindow* parent)
        {
-               DCIMetadataDialog* d = new DCIMetadataDialog (parent, Config::instance()->default_dci_metadata ());
+               ISDCFMetadataDialog* d = new ISDCFMetadataDialog (parent, Config::instance()->default_isdcf_metadata ());
                d->ShowModal ();
-               Config::instance()->set_default_dci_metadata (d->dci_metadata ());
+               Config::instance()->set_default_isdcf_metadata (d->isdcf_metadata ());
                d->Destroy ();
        }
 
@@ -460,7 +460,7 @@ private:
        
        wxSpinCtrl* _j2k_bandwidth;
        wxSpinCtrl* _audio_delay;
-       wxButton* _dci_metadata_button;
+       wxButton* _isdcf_metadata_button;
        wxSpinCtrl* _still_length;
 #ifdef DCPOMATIC_USE_OWN_DIR_PICKER
        DirPickerCtrl* _directory;
diff --git a/src/wx/dci_metadata_dialog.cc b/src/wx/dci_metadata_dialog.cc
deleted file mode 100644 (file)
index 700e1b1..0000000
+++ /dev/null
@@ -1,85 +0,0 @@
-/*
-    Copyright (C) 2012 Carl Hetherington <cth@carlh.net>
-
-    This program is free software; you can redistribute it and/or modify
-    it under the terms of the GNU General Public License as published by
-    the Free Software Foundation; either version 2 of the License, or
-    (at your option) any later version.
-
-    This program is distributed in the hope that it will be useful,
-    but WITHOUT ANY WARRANTY; without even the implied warranty of
-    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-    GNU General Public License for more details.
-
-    You should have received a copy of the GNU General Public License
-    along with this program; if not, write to the Free Software
-    Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
-
-*/
-
-#include <wx/wx.h>
-#include <wx/sizer.h>
-#include <wx/spinctrl.h>
-#include "lib/film.h"
-#include "dci_metadata_dialog.h"
-#include "wx_util.h"
-
-using boost::shared_ptr;
-
-DCIMetadataDialog::DCIMetadataDialog (wxWindow* parent, DCIMetadata dm)
-       : TableDialog (parent, _("DCI name"), 2, true)
-{
-       add (_("Content version"), true);
-       _content_version = add (new wxSpinCtrl (this, wxID_ANY));
-
-       add (_("Audio Language (e.g. EN)"), true);
-       _audio_language = add (new wxTextCtrl (this, wxID_ANY));
-
-       add (_("Subtitle Language (e.g. FR)"), true);
-       _subtitle_language = add (new wxTextCtrl (this, wxID_ANY));
-       
-       add (_("Territory (e.g. UK)"), true);
-       _territory = add (new wxTextCtrl (this, wxID_ANY));
-
-       add (_("Rating (e.g. 15)"), true);
-       _rating = add (new wxTextCtrl (this, wxID_ANY));
-
-       add (_("Studio (e.g. TCF)"), true);
-       _studio = add (new wxTextCtrl (this, wxID_ANY));
-
-       add (_("Facility (e.g. DLA)"), true);
-       _facility = add (new wxTextCtrl (this, wxID_ANY));
-
-       add (_("Package Type (e.g. OV)"), true);
-       _package_type = add (new wxTextCtrl (this, wxID_ANY));
-
-       _content_version->SetRange (1, 1024);
-
-       _content_version->SetValue (dm.content_version);
-       _audio_language->SetValue (std_to_wx (dm.audio_language));
-       _subtitle_language->SetValue (std_to_wx (dm.subtitle_language));
-       _territory->SetValue (std_to_wx (dm.territory));
-       _rating->SetValue (std_to_wx (dm.rating));
-       _studio->SetValue (std_to_wx (dm.studio));
-       _facility->SetValue (std_to_wx (dm.facility));
-       _package_type->SetValue (std_to_wx (dm.package_type));
-
-       layout ();
-}
-
-DCIMetadata
-DCIMetadataDialog::dci_metadata () const
-{
-       DCIMetadata dm;
-
-       dm.content_version = _content_version->GetValue ();
-       dm.audio_language = wx_to_std (_audio_language->GetValue ());
-       dm.subtitle_language = wx_to_std (_subtitle_language->GetValue ());
-       dm.territory = wx_to_std (_territory->GetValue ());
-       dm.rating = wx_to_std (_rating->GetValue ());
-       dm.studio = wx_to_std (_studio->GetValue ());
-       dm.facility = wx_to_std (_facility->GetValue ());
-       dm.package_type = wx_to_std (_package_type->GetValue ());
-
-       return dm;
-}
diff --git a/src/wx/dci_metadata_dialog.h b/src/wx/dci_metadata_dialog.h
deleted file mode 100644 (file)
index 7b93a3a..0000000
+++ /dev/null
@@ -1,44 +0,0 @@
-/*
-    Copyright (C) 2012-2014 Carl Hetherington <cth@carlh.net>
-
-    This program is free software; you can redistribute it and/or modify
-    it under the terms of the GNU General Public License as published by
-    the Free Software Foundation; either version 2 of the License, or
-    (at your option) any later version.
-
-    This program is distributed in the hope that it will be useful,
-    but WITHOUT ANY WARRANTY; without even the implied warranty of
-    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-    GNU General Public License for more details.
-
-    You should have received a copy of the GNU General Public License
-    along with this program; if not, write to the Free Software
-    Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
-
-*/
-
-#include <wx/textctrl.h>
-#include <boost/shared_ptr.hpp>
-#include "lib/dci_metadata.h"
-#include "table_dialog.h"
-
-class wxSpinCtrl;
-class Film;
-
-class DCIMetadataDialog : public TableDialog
-{
-public:
-       DCIMetadataDialog (wxWindow *, DCIMetadata);
-
-       DCIMetadata dci_metadata () const;
-
-private:
-       wxSpinCtrl* _content_version;
-       wxTextCtrl* _audio_language;
-       wxTextCtrl* _subtitle_language;
-       wxTextCtrl* _territory;
-       wxTextCtrl* _rating;
-       wxTextCtrl* _studio;
-       wxTextCtrl* _facility;
-       wxTextCtrl* _package_type;
-};
index 7452b985c547ae083daec8f8b558b4c8abd181e5..9c980b62568dbe037fd2456e215f7a848bb57cda 100644 (file)
@@ -48,7 +48,7 @@
 #include "timecode.h"
 #include "wx_util.h"
 #include "film_editor.h"
-#include "dci_metadata_dialog.h"
+#include "isdcf_metadata_dialog.h"
 #include "timeline_dialog.h"
 #include "timing_panel.h"
 #include "subtitle_panel.h"
@@ -125,10 +125,10 @@ FilmEditor::make_dcp_panel ()
        flags |= wxALIGN_RIGHT;
 #endif 
 
-       _use_dci_name = new wxCheckBox (_dcp_panel, wxID_ANY, _("Use DCI name"));
-       grid->Add (_use_dci_name, wxGBPosition (r, 0), wxDefaultSpan, flags);
-       _edit_dci_button = new wxButton (_dcp_panel, wxID_ANY, _("Details..."));
-       grid->Add (_edit_dci_button, wxGBPosition (r, 1), wxDefaultSpan);
+       _use_isdcf_name = new wxCheckBox (_dcp_panel, wxID_ANY, _("Use ISDCF name"));
+       grid->Add (_use_isdcf_name, wxGBPosition (r, 0), wxDefaultSpan, flags);
+       _edit_isdcf_button = new wxButton (_dcp_panel, wxID_ANY, _("Details..."));
+       grid->Add (_edit_isdcf_button, wxGBPosition (r, 1), wxDefaultSpan);
        ++r;
 
        add_label_to_grid_bag_sizer (grid, _dcp_panel, _("Container"), true, wxGBPosition (r, 0));
@@ -232,8 +232,8 @@ void
 FilmEditor::connect_to_widgets ()
 {
        _name->Bind             (wxEVT_COMMAND_TEXT_UPDATED,          boost::bind (&FilmEditor::name_changed, this));
-       _use_dci_name->Bind     (wxEVT_COMMAND_CHECKBOX_CLICKED,      boost::bind (&FilmEditor::use_dci_name_toggled, this));
-       _edit_dci_button->Bind  (wxEVT_COMMAND_BUTTON_CLICKED,        boost::bind (&FilmEditor::edit_dci_button_clicked, this));
+       _use_isdcf_name->Bind   (wxEVT_COMMAND_CHECKBOX_CLICKED,      boost::bind (&FilmEditor::use_isdcf_name_toggled, this));
+       _edit_isdcf_button->Bind(wxEVT_COMMAND_BUTTON_CLICKED,        boost::bind (&FilmEditor::edit_isdcf_button_clicked, this));
        _container->Bind        (wxEVT_COMMAND_CHOICE_SELECTED,       boost::bind (&FilmEditor::container_changed, this));
        _content->Bind          (wxEVT_COMMAND_LIST_ITEM_SELECTED,    boost::bind (&FilmEditor::content_selection_changed, this));
        _content->Bind          (wxEVT_COMMAND_LIST_ITEM_DESELECTED,  boost::bind (&FilmEditor::content_selection_changed, this));
@@ -468,11 +468,11 @@ FilmEditor::film_changed (Film::Property p)
        case Film::J2K_BANDWIDTH:
                checked_set (_j2k_bandwidth, _film->j2k_bandwidth() / 1000000);
                break;
-       case Film::USE_DCI_NAME:
-               checked_set (_use_dci_name, _film->use_dci_name ());
+       case Film::USE_ISDCF_NAME:
+               checked_set (_use_isdcf_name, _film->use_isdcf_name ());
                setup_dcp_name ();
                break;
-       case Film::DCI_METADATA:
+       case Film::ISDCF_METADATA:
                setup_dcp_name ();
                break;
        case Film::VIDEO_FRAME_RATE:
@@ -609,7 +609,7 @@ FilmEditor::set_film (shared_ptr<Film> f)
        }
 
        film_changed (Film::NAME);
-       film_changed (Film::USE_DCI_NAME);
+       film_changed (Film::USE_ISDCF_NAME);
        film_changed (Film::CONTENT);
        film_changed (Film::DCP_CONTENT_TYPE);
        film_changed (Film::CONTAINER);
@@ -619,7 +619,7 @@ FilmEditor::set_film (shared_ptr<Film> f)
        film_changed (Film::SIGNED);
        film_changed (Film::ENCRYPTED);
        film_changed (Film::J2K_BANDWIDTH);
-       film_changed (Film::DCI_METADATA);
+       film_changed (Film::ISDCF_METADATA);
        film_changed (Film::VIDEO_FRAME_RATE);
        film_changed (Film::AUDIO_CHANNELS);
        film_changed (Film::SEQUENCE_VIDEO);
@@ -640,8 +640,8 @@ FilmEditor::set_general_sensitivity (bool s)
 
        /* Stuff in the Content / DCP tabs */
        _name->Enable (s);
-       _use_dci_name->Enable (s);
-       _edit_dci_button->Enable (s);
+       _use_isdcf_name->Enable (s);
+       _edit_isdcf_button->Enable (s);
        _content->Enable (s);
        _content_add_file->Enable (s);
        _content_add_folder->Enable (s);
@@ -691,25 +691,25 @@ FilmEditor::scaler_changed ()
 }
 
 void
-FilmEditor::use_dci_name_toggled ()
+FilmEditor::use_isdcf_name_toggled ()
 {
        if (!_film) {
                return;
        }
 
-       _film->set_use_dci_name (_use_dci_name->GetValue ());
+       _film->set_use_isdcf_name (_use_isdcf_name->GetValue ());
 }
 
 void
-FilmEditor::edit_dci_button_clicked ()
+FilmEditor::edit_isdcf_button_clicked ()
 {
        if (!_film) {
                return;
        }
 
-       DCIMetadataDialog* d = new DCIMetadataDialog (this, _film->dci_metadata ());
+       ISDCFMetadataDialog* d = new ISDCFMetadataDialog (this, _film->isdcf_metadata ());
        d->ShowModal ();
-       _film->set_dci_metadata (d->dci_metadata ());
+       _film->set_isdcf_metadata (d->isdcf_metadata ());
        d->Destroy ();
 }
 
index 56e54734b7dcac54e0a3ebad1317be4f6febdf13..96cae3900d66d1b9aea29a4043e285f28dc81f2a 100644 (file)
@@ -75,8 +75,8 @@ private:
        
        /* Handle changes to the view */
        void name_changed ();
-       void use_dci_name_toggled ();
-       void edit_dci_button_clicked ();
+       void use_isdcf_name_toggled ();
+       void edit_isdcf_button_clicked ();
        void content_selection_changed ();
        void content_add_file_clicked ();
        void content_add_folder_clicked ();
@@ -131,7 +131,7 @@ private:
        boost::shared_ptr<Film> _film;
        wxTextCtrl* _name;
        wxStaticText* _dcp_name;
-       wxCheckBox* _use_dci_name;
+       wxCheckBox* _use_isdcf_name;
        wxChoice* _container;
        wxListCtrl* _content;
        wxButton* _content_add_file;
@@ -141,7 +141,7 @@ private:
        wxButton* _content_later;
        wxButton* _content_timeline;
        wxCheckBox* _sequence_video;
-       wxButton* _edit_dci_button;
+       wxButton* _edit_isdcf_button;
        wxChoice* _scaler;
        wxSpinCtrl* _j2k_bandwidth;
        wxChoice* _dcp_content_type;
diff --git a/src/wx/isdcf_metadata_dialog.cc b/src/wx/isdcf_metadata_dialog.cc
new file mode 100644 (file)
index 0000000..0fd00ff
--- /dev/null
@@ -0,0 +1,85 @@
+/*
+    Copyright (C) 2012 Carl Hetherington <cth@carlh.net>
+
+    This program is free software; you can redistribute it and/or modify
+    it under the terms of the GNU General Public License as published by
+    the Free Software Foundation; either version 2 of the License, or
+    (at your option) any later version.
+
+    This program is distributed in the hope that it will be useful,
+    but WITHOUT ANY WARRANTY; without even the implied warranty of
+    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+    GNU General Public License for more details.
+
+    You should have received a copy of the GNU General Public License
+    along with this program; if not, write to the Free Software
+    Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+
+*/
+
+#include <wx/wx.h>
+#include <wx/sizer.h>
+#include <wx/spinctrl.h>
+#include "lib/film.h"
+#include "isdcf_metadata_dialog.h"
+#include "wx_util.h"
+
+using boost::shared_ptr;
+
+ISDCFMetadataDialog::ISDCFMetadataDialog (wxWindow* parent, ISDCFMetadata dm)
+       : TableDialog (parent, _("ISDCF name"), 2, true)
+{
+       add (_("Content version"), true);
+       _content_version = add (new wxSpinCtrl (this, wxID_ANY));
+
+       add (_("Audio Language (e.g. EN)"), true);
+       _audio_language = add (new wxTextCtrl (this, wxID_ANY));
+
+       add (_("Subtitle Language (e.g. FR)"), true);
+       _subtitle_language = add (new wxTextCtrl (this, wxID_ANY));
+       
+       add (_("Territory (e.g. UK)"), true);
+       _territory = add (new wxTextCtrl (this, wxID_ANY));
+
+       add (_("Rating (e.g. 15)"), true);
+       _rating = add (new wxTextCtrl (this, wxID_ANY));
+
+       add (_("Studio (e.g. TCF)"), true);
+       _studio = add (new wxTextCtrl (this, wxID_ANY));
+
+       add (_("Facility (e.g. DLA)"), true);
+       _facility = add (new wxTextCtrl (this, wxID_ANY));
+
+       add (_("Package Type (e.g. OV)"), true);
+       _package_type = add (new wxTextCtrl (this, wxID_ANY));
+
+       _content_version->SetRange (1, 1024);
+
+       _content_version->SetValue (dm.content_version);
+       _audio_language->SetValue (std_to_wx (dm.audio_language));
+       _subtitle_language->SetValue (std_to_wx (dm.subtitle_language));
+       _territory->SetValue (std_to_wx (dm.territory));
+       _rating->SetValue (std_to_wx (dm.rating));
+       _studio->SetValue (std_to_wx (dm.studio));
+       _facility->SetValue (std_to_wx (dm.facility));
+       _package_type->SetValue (std_to_wx (dm.package_type));
+
+       layout ();
+}
+
+ISDCFMetadata
+ISDCFMetadataDialog::isdcf_metadata () const
+{
+       ISDCFMetadata dm;
+
+       dm.content_version = _content_version->GetValue ();
+       dm.audio_language = wx_to_std (_audio_language->GetValue ());
+       dm.subtitle_language = wx_to_std (_subtitle_language->GetValue ());
+       dm.territory = wx_to_std (_territory->GetValue ());
+       dm.rating = wx_to_std (_rating->GetValue ());
+       dm.studio = wx_to_std (_studio->GetValue ());
+       dm.facility = wx_to_std (_facility->GetValue ());
+       dm.package_type = wx_to_std (_package_type->GetValue ());
+
+       return dm;
+}
diff --git a/src/wx/isdcf_metadata_dialog.h b/src/wx/isdcf_metadata_dialog.h
new file mode 100644 (file)
index 0000000..e20dbf5
--- /dev/null
@@ -0,0 +1,44 @@
+/*
+    Copyright (C) 2012-2014 Carl Hetherington <cth@carlh.net>
+
+    This program is free software; you can redistribute it and/or modify
+    it under the terms of the GNU General Public License as published by
+    the Free Software Foundation; either version 2 of the License, or
+    (at your option) any later version.
+
+    This program is distributed in the hope that it will be useful,
+    but WITHOUT ANY WARRANTY; without even the implied warranty of
+    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+    GNU General Public License for more details.
+
+    You should have received a copy of the GNU General Public License
+    along with this program; if not, write to the Free Software
+    Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+
+*/
+
+#include <wx/textctrl.h>
+#include <boost/shared_ptr.hpp>
+#include "lib/isdcf_metadata.h"
+#include "table_dialog.h"
+
+class wxSpinCtrl;
+class Film;
+
+class ISDCFMetadataDialog : public TableDialog
+{
+public:
+       ISDCFMetadataDialog (wxWindow *, ISDCFMetadata);
+
+       ISDCFMetadata isdcf_metadata () const;
+
+private:
+       wxSpinCtrl* _content_version;
+       wxTextCtrl* _audio_language;
+       wxTextCtrl* _subtitle_language;
+       wxTextCtrl* _territory;
+       wxTextCtrl* _rating;
+       wxTextCtrl* _studio;
+       wxTextCtrl* _facility;
+       wxTextCtrl* _package_type;
+};
index a04df2d41751a718f72f3f30584cf2109c94a1ee..8c142698b04d1d247950a484c1544e794a3fb94e 100644 (file)
@@ -15,7 +15,7 @@ sources = """
           config_dialog.cc
           content_colour_conversion_dialog.cc
           content_menu.cc
-          dci_metadata_dialog.cc
+          isdcf_metadata_dialog.cc
           dir_picker_ctrl.cc
           dolby_certificate_dialog.cc
           doremi_certificate_dialog.cc
index 5224fae833baaa9c274762eb41535096b1380355..e65804aa5e5ff2908eb2434a95c79ebdf1b16769 100644 (file)
@@ -33,7 +33,7 @@ BOOST_AUTO_TEST_CASE (fourk_test)
        shared_ptr<FFmpegContent> c (new FFmpegContent (film, "test/data/test.mp4"));
        c->set_scale (VideoContentScale (Ratio::from_id ("185")));
        film->set_resolution (RESOLUTION_4K);
-       film->set_dcp_content_type (DCPContentType::from_dci_name ("FTR"));
+       film->set_dcp_content_type (DCPContentType::from_isdcf_name ("FTR"));
        film->set_container (Ratio::from_id ("185"));
        film->examine_and_add_content (c);
        wait_for_jobs ();
index 77243ea6d0e46d04b56dbeb34c33b5120977efc5..8ac5f746c8fb46e3621d392f9267297e7e792804 100644 (file)
@@ -38,7 +38,7 @@ void test_audio_delay (int delay_in_ms)
 {
        string const film_name = "audio_delay_test_" + lexical_cast<string> (delay_in_ms);
        shared_ptr<Film> film = new_test_film (film_name);
-       film->set_dcp_content_type (DCPContentType::from_dci_name ("FTR"));
+       film->set_dcp_content_type (DCPContentType::from_isdcf_name ("FTR"));
        film->set_container (Ratio::from_id ("185"));
        film->set_name (film_name);
 
index c2170d891744f3ce14848a9a372acdd0cdd5eb2a..5c594f68cc064f170d3290c83833422522012c52 100644 (file)
@@ -33,7 +33,7 @@ using boost::shared_ptr;
 BOOST_AUTO_TEST_CASE (black_fill_test)
 {
        shared_ptr<Film> film = new_test_film ("black_fill_test");
-       film->set_dcp_content_type (DCPContentType::from_dci_name ("FTR"));
+       film->set_dcp_content_type (DCPContentType::from_isdcf_name ("FTR"));
        film->set_name ("black_fill_test");
        film->set_container (Ratio::from_id ("185"));
        film->set_sequence_video (false);
index 1f06aa538568b6a83f57f75d36410eea47a69c3e..7440e43381e27dcb82530391f470607c13939332 100644 (file)
@@ -40,7 +40,7 @@ BOOST_AUTO_TEST_CASE (film_metadata_test)
        }
 
        shared_ptr<Film> f (new Film (test_film));
-       f->_dci_date = boost::gregorian::from_undelimited_string ("20130211");
+       f->_isdcf_date = boost::gregorian::from_undelimited_string ("20130211");
        BOOST_CHECK (f->container() == 0);
        BOOST_CHECK (f->dcp_content_type() == 0);
 
index 92d1a8dce82767d91a16043b8716048fd7b1fb4a..067f772ff1f4af6bcaa3541f1ba9f53f64efa383 100644 (file)
@@ -82,7 +82,7 @@ private:
 BOOST_AUTO_TEST_CASE (play_test)
 {
        shared_ptr<Film> film = new_test_film ("play_test");
-       film->set_dcp_content_type (DCPContentType::from_dci_name ("FTR"));
+       film->set_dcp_content_type (DCPContentType::from_isdcf_name ("FTR"));
        film->set_container (Ratio::from_id ("185"));
        film->set_name ("play_test");
 
index d8caf17fa919c81a3657f5a459ba878671f95fc9..284895e0a75d3bcee73ae157e078fc1ad6b86925 100644 (file)
@@ -39,7 +39,7 @@ note (libdcp::NoteType, string n)
 BOOST_AUTO_TEST_CASE (recover_test)
 {
        shared_ptr<Film> film = new_test_film ("recover_test");
-       film->set_dcp_content_type (DCPContentType::from_dci_name ("FTR"));
+       film->set_dcp_content_type (DCPContentType::from_isdcf_name ("FTR"));
        film->set_container (Ratio::from_id ("185"));
        film->set_name ("recover_test");
        film->set_three_d (true);
index f0cf3fe4a5bf89a3b473abac7af75d9071b89076..cdf1653cdf84a7c78b40f1518a3d81516a600063 100644 (file)
@@ -56,7 +56,7 @@ static void scaling_test_for (shared_ptr<Film> film, shared_ptr<VideoContent> co
 BOOST_AUTO_TEST_CASE (scaling_test)
 {
        shared_ptr<Film> film = new_test_film ("scaling_test");
-       film->set_dcp_content_type (DCPContentType::from_dci_name ("FTR"));
+       film->set_dcp_content_type (DCPContentType::from_isdcf_name ("FTR"));
        film->set_name ("scaling_test");
        shared_ptr<ImageContent> imc (new ImageContent (film, "test/data/simple_testcard_640x480.png"));
 
index d5236c144486f125a57ed300bb063c02dea84175..f1136a3f1a91c159fa3a32d3158d8b139822de88 100644 (file)
@@ -37,7 +37,7 @@ static void test_silence_padding (int channels)
 {
        string const film_name = "silence_padding_test_" + lexical_cast<string> (channels);
        shared_ptr<Film> film = new_test_film (film_name);
-       film->set_dcp_content_type (DCPContentType::from_dci_name ("FTR"));
+       film->set_dcp_content_type (DCPContentType::from_isdcf_name ("FTR"));
        film->set_container (Ratio::from_id ("185"));
        film->set_name (film_name);
 
index be2cf15389949c9ead1d23f5804b65c1c50ab99e..0b87b8062a67adc503bf076ba32624cf7678a2ff 100644 (file)
@@ -59,7 +59,7 @@ struct TestConfig
 
                Config::instance()->set_num_local_encoding_threads (1);
                Config::instance()->set_server_port_base (61920);
-               Config::instance()->set_default_dci_metadata (DCIMetadata ());
+               Config::instance()->set_default_isdcf_metadata (ISDCFMetadata ());
                Config::instance()->set_default_container (static_cast<Ratio*> (0));
                Config::instance()->set_default_dcp_content_type (static_cast<DCPContentType*> (0));