X-Git-Url: https://git.carlh.net/gitweb/?a=blobdiff_plain;f=src%2Flib%2Fdcp_content_type.cc;h=e5466e1398936c1e4917efe11e95fa1cf5b12472;hb=9e4c091e6ef0f79fab10664e95240de2f14e5702;hp=72a26e4072622db2ca88083071e0ccf0997136d6;hpb=bb767c7e338414beee132af3e96829c1448e214b;p=dcpomatic.git diff --git a/src/lib/dcp_content_type.cc b/src/lib/dcp_content_type.cc index 72a26e407..e5466e139 100644 --- a/src/lib/dcp_content_type.cc +++ b/src/lib/dcp_content_type.cc @@ -24,13 +24,16 @@ #include #include "dcp_content_type.h" +#include "i18n.h" + using namespace std; vector DCPContentType::_dcp_content_types; -DCPContentType::DCPContentType (string p, string o) +DCPContentType::DCPContentType (string p, dcp::ContentKind k, string d) : _pretty_name (p) - , _opendcp_name (o) + , _libdcp_kind (k) + , _isdcf_name (d) { } @@ -38,16 +41,16 @@ DCPContentType::DCPContentType (string p, string o) void DCPContentType::setup_dcp_content_types () { - _dcp_content_types.push_back (new DCPContentType ("Feature", "feature")); - _dcp_content_types.push_back (new DCPContentType ("Short", "short")); - _dcp_content_types.push_back (new DCPContentType ("Trailer", "trailer")); - _dcp_content_types.push_back (new DCPContentType ("Test", "test")); - _dcp_content_types.push_back (new DCPContentType ("Transitional", "transitional")); - _dcp_content_types.push_back (new DCPContentType ("Rating", "rating")); - _dcp_content_types.push_back (new DCPContentType ("Teaser", "teaster")); - _dcp_content_types.push_back (new DCPContentType ("Policy", "policy")); - _dcp_content_types.push_back (new DCPContentType ("Public Service Announcement", "psa")); - _dcp_content_types.push_back (new DCPContentType ("Advertisement", "advertisement")); + _dcp_content_types.push_back (new DCPContentType (_("Feature"), dcp::FEATURE, N_("FTR"))); + _dcp_content_types.push_back (new DCPContentType (_("Short"), dcp::SHORT, N_("SHR"))); + _dcp_content_types.push_back (new DCPContentType (_("Trailer"), dcp::TRAILER, N_("TLR"))); + _dcp_content_types.push_back (new DCPContentType (_("Test"), dcp::TEST, N_("TST"))); + _dcp_content_types.push_back (new DCPContentType (_("Transitional"), dcp::TRANSITIONAL, N_("XSN"))); + _dcp_content_types.push_back (new DCPContentType (_("Rating"), dcp::RATING, N_("RTG"))); + _dcp_content_types.push_back (new DCPContentType (_("Teaser"), dcp::TEASER, N_("TSR"))); + _dcp_content_types.push_back (new DCPContentType (_("Policy"), dcp::POLICY, N_("POL"))); + _dcp_content_types.push_back (new DCPContentType (_("Public Service Announcement"), dcp::PUBLIC_SERVICE_ANNOUNCEMENT, N_("PSA"))); + _dcp_content_types.push_back (new DCPContentType (_("Advertisement"), dcp::ADVERTISEMENT, N_("ADV"))); } DCPContentType const * @@ -62,6 +65,18 @@ DCPContentType::from_pretty_name (string n) return 0; } +DCPContentType const * +DCPContentType::from_isdcf_name (string n) +{ + for (vector::const_iterator i = _dcp_content_types.begin(); i != _dcp_content_types.end(); ++i) { + if ((*i)->isdcf_name() == n) { + return *i; + } + } + + return 0; +} + DCPContentType const * DCPContentType::from_index (int n) {