Don't insist on writing optional metadata (#1923).
[dcpomatic.git] / src / wx / smpte_metadata_dialog.h
1 /*
2     Copyright (C) 2019-2020 Carl Hetherington <cth@carlh.net>
3
4     This file is part of DCP-o-matic.
5
6     DCP-o-matic is free software; you can redistribute it and/or modify
7     it under the terms of the GNU General Public License as published by
8     the Free Software Foundation; either version 2 of the License, or
9     (at your option) any later version.
10
11     DCP-o-matic is distributed in the hope that it will be useful,
12     but WITHOUT ANY WARRANTY; without even the implied warranty of
13     MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
14     GNU General Public License for more details.
15
16     You should have received a copy of the GNU General Public License
17     along with DCP-o-matic.  If not, see <http://www.gnu.org/licenses/>.
18
19 */
20
21 #include "editable_list.h"
22 #include "full_language_tag_dialog.h"
23 #include "lib/film.h"
24 #include "lib/weak_film.h"
25 #include <dcp/language_tag.h>
26 #include <dcp/types.h>
27 #include <wx/wx.h>
28 #include <vector>
29
30
31 class Film;
32 class RatingDialog;
33 class ContentVersionDialog;
34 class LanguageTagWidget;
35 class LanguageTagDialog;
36
37
38 class SMPTEMetadataDialog : public wxDialog, public WeakFilm
39 {
40 public:
41         SMPTEMetadataDialog (wxWindow* parent, std::weak_ptr<Film> film);
42
43 private:
44         wxPanel* main_panel (wxWindow* parent);
45         wxPanel* advanced_panel (wxWindow* parent);
46         std::vector<dcp::Rating> ratings () const;
47         void set_ratings (std::vector<dcp::Rating> r);
48         std::vector<std::string> content_versions () const;
49         void set_content_versions (std::vector<std::string> v);
50         void name_language_changed (dcp::LanguageTag tag);
51         void audio_language_changed (dcp::LanguageTag tag);
52         void enable_main_subtitle_changed ();
53         void main_subtitle_language_changed (dcp::LanguageTag tag);
54         std::vector<dcp::LanguageTag> additional_subtitle_languages ();
55         void set_additional_subtitle_languages (std::vector<dcp::LanguageTag> languages);
56         void edit_release_territory ();
57         void version_number_changed ();
58         void status_changed ();
59         void chain_changed ();
60         void distributor_changed ();
61         void facility_changed ();
62         void luminance_changed ();
63         void film_changed (ChangeType type, Film::Property property);
64         void setup_sensitivity ();
65         void enable_release_territory_changed ();
66         void enable_chain_changed ();
67         void enable_distributor_changed ();
68         void enable_facility_changed ();
69
70         LanguageTagWidget* _name_language;
71         LanguageTagWidget* _audio_language;
72         wxCheckBox* _enable_main_subtitle_language;
73         LanguageTagWidget* _main_subtitle_language;
74         EditableList<dcp::LanguageTag, LanguageTagDialog>* _additional_subtitle_languages;
75         wxCheckBox* _enable_release_territory;
76         /** The current release territory displayed in the UI; since we can't easily convert
77          *  the string in _release_territory_text to a RegionSubtag we just store the RegionSubtag
78          *  alongside.
79          */
80         boost::optional<dcp::LanguageTag::RegionSubtag> _release_territory;
81         wxStaticText* _release_territory_text;
82         Button* _edit_release_territory;
83         wxSpinCtrl* _version_number;
84         wxChoice* _status;
85         wxCheckBox* _enable_chain;
86         wxTextCtrl* _chain;
87         wxCheckBox* _enable_distributor;
88         wxTextCtrl* _distributor;
89         wxCheckBox* _enable_facility;
90         wxTextCtrl* _facility;
91         wxSpinCtrlDouble* _luminance_value;
92         wxChoice* _luminance_unit;
93         EditableList<dcp::Rating, RatingDialog>* _ratings;
94         EditableList<std::string, ContentVersionDialog>* _content_versions;
95
96         boost::signals2::scoped_connection _film_changed_connection;
97 };