diff options
| author | Carl Hetherington <cth@carlh.net> | 2012-10-16 02:35:30 +0100 |
|---|---|---|
| committer | Carl Hetherington <cth@carlh.net> | 2012-10-16 02:35:30 +0100 |
| commit | 4d3caea8b70b4a19c8aa80d626d52d4f95114f8e (patch) | |
| tree | 3cff0617d07cd4a192350abea7d5dfc9aa8add7e /src/lib | |
| parent | 763acf87c7c80d508f6c10af0f3f46045d5c23df (diff) | |
Clumsy DCI naming dialog.
Diffstat (limited to 'src/lib')
| -rw-r--r-- | src/lib/film.cc | 63 | ||||
| -rw-r--r-- | src/lib/film.h | 49 | ||||
| -rw-r--r-- | src/lib/film_state.cc | 27 | ||||
| -rw-r--r-- | src/lib/film_state.h | 4 |
4 files changed, 141 insertions, 2 deletions
diff --git a/src/lib/film.cc b/src/lib/film.cc index e4e7763d5..541d96f1e 100644 --- a/src/lib/film.cc +++ b/src/lib/film.cc @@ -690,3 +690,66 @@ Film::thumb_subtitle (int n) const return sub; } + +void +Film::set_dci_name_prefix (string v) +{ + _state.dci_name_prefix = v; + signal_changed (DCI_METADATA); +} + +void +Film::set_audio_language (string v) +{ + _state.audio_language = v; + signal_changed (DCI_METADATA); +} + +void +Film::set_subtitle_language (string v) +{ + _state.subtitle_language = v; + signal_changed (DCI_METADATA); +} + +void +Film::set_territory (string v) +{ + _state.territory = v; + signal_changed (DCI_METADATA); +} + +void +Film::set_rating (string v) +{ + _state.rating = v; + signal_changed (DCI_METADATA); +} + +void +Film::set_studio (string v) +{ + _state.studio = v; + signal_changed (DCI_METADATA); +} + +void +Film::set_facility (string v) +{ + _state.facility = v; + signal_changed (DCI_METADATA); +} + +void +Film::set_package_type (string v) +{ + _state.package_type = v; + signal_changed (DCI_METADATA); +} + +void +Film::set_use_dci_name (bool v) +{ + _state.use_dci_name = v; + signal_changed (USE_DCI_NAME); +} diff --git a/src/lib/film.h b/src/lib/film.h index 46c67ad19..9eb39fd64 100644 --- a/src/lib/film.h +++ b/src/lib/film.h @@ -71,6 +71,10 @@ public: return _state.name; } + bool use_dci_name () const { + return _state.use_dci_name; + } + /** @return number of pixels to crop from the sides of the original picture */ Crop crop () const { return _state.crop; @@ -146,6 +150,7 @@ public: void set_dcp_ab (bool); void set_name (std::string); + void set_use_dci_name (bool); void set_content (std::string); void set_top_crop (int); void set_bottom_crop (int); @@ -159,6 +164,14 @@ public: void set_with_subtitles (bool); void set_subtitle_offset (int); void set_subtitle_scale (float); + void set_dci_name_prefix (std::string); + void set_audio_language (std::string); + void set_subtitle_language (std::string); + void set_territory (std::string); + void set_rating (std::string); + void set_studio (std::string); + void set_facility (std::string); + void set_package_type (std::string); /** @return size, in pixels, of the source (ignoring cropping) */ Size size () const { @@ -193,7 +206,39 @@ public: bool has_subtitles () const { return _state.has_subtitles; } + + std::string dci_name_prefix () const { + return _state.dci_name_prefix; + } + + std::string audio_language () const { + return _state.audio_language; + } + + std::string subtitle_language () const { + return _state.subtitle_language; + } + std::string territory () const { + return _state.territory; + } + + std::string rating () const { + return _state.rating; + } + + std::string studio () const { + return _state.studio; + } + + std::string facility () const { + return _state.facility; + } + + std::string package_type () const { + return _state.package_type; + } + std::string j2k_dir () const; std::vector<std::string> audio_files () const; @@ -241,7 +286,9 @@ public: STILL_DURATION, WITH_SUBTITLES, SUBTITLE_OFFSET, - SUBTITLE_SCALE + SUBTITLE_SCALE, + USE_DCI_NAME, + DCI_METADATA }; boost::shared_ptr<FilmState> state_copy () const; diff --git a/src/lib/film_state.cc b/src/lib/film_state.cc index fed506863..862d69d7d 100644 --- a/src/lib/film_state.cc +++ b/src/lib/film_state.cc @@ -49,6 +49,7 @@ FilmState::write_metadata (ofstream& f) const { /* User stuff */ f << "name " << name << "\n"; + f << "use_dci_name " << use_dci_name << "\n"; f << "content " << content << "\n"; if (dcp_content_type) { f << "dcp_content_type " << dcp_content_type->pretty_name () << "\n"; @@ -99,6 +100,14 @@ FilmState::write_metadata (ofstream& f) const f << "audio_sample_format " << audio_sample_format_to_string (audio_sample_format) << "\n"; f << "content_digest " << content_digest << "\n"; f << "has_subtitles " << has_subtitles << "\n"; + f << "dci_name_prefix " << dci_name_prefix << "\n"; + f << "audio_language " << audio_language << "\n"; + f << "subtitle_language " << subtitle_language << "\n"; + f << "territory " << territory << "\n"; + f << "rating " << rating << "\n"; + f << "studio " << studio << "\n"; + f << "facility " << facility << "\n"; + f << "package_type " << package_type << "\n"; } /** Read state from a key / value pair. @@ -111,6 +120,8 @@ FilmState::read_metadata (string k, string v) /* User-specified stuff */ if (k == "name") { name = v; + } else if (k == "use_dci_name") { + use_dci_name = (v == "1"); } else if (k == "content") { content = v; } else if (k == "dcp_content_type") { @@ -178,6 +189,22 @@ FilmState::read_metadata (string k, string v) content_digest = v; } else if (k == "has_subtitles") { has_subtitles = (v == "1"); + } else if (k == "dci_name_prefix") { + dci_name_prefix = v; + } else if (k == "audio_language") { + audio_language = v; + } else if (k == "subtitle_language") { + subtitle_language = v; + } else if (k == "territory") { + territory = v; + } else if (k == "rating") { + rating = v; + } else if (k == "studio") { + studio = v; + } else if (k == "facility") { + facility = v; + } else if (k == "package_type") { + package_type = v; } } diff --git a/src/lib/film_state.h b/src/lib/film_state.h index e58d46b0f..83ae2c594 100644 --- a/src/lib/film_state.h +++ b/src/lib/film_state.h @@ -52,7 +52,8 @@ class FilmState { public: FilmState () - : dcp_content_type (0) + : use_dci_name (false) + , dcp_content_type (0) , frames_per_second (0) , format (0) , scaler (Scaler::from_id ("bicubic")) @@ -100,6 +101,7 @@ public: std::string directory; /** Name for DVD-o-matic */ std::string name; + bool use_dci_name; /** File or directory containing content; may be relative to our directory * or an absolute path. */ |
