Put subtitle language back into content from the film (#1930).
[dcpomatic.git] / src / wx / smpte_metadata_dialog.h
1 /*
2     Copyright (C) 2019-2021 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
22 #include "editable_list.h"
23 #include "full_language_tag_dialog.h"
24 #include "lib/film.h"
25 #include "lib/weak_film.h"
26 #include <dcp/language_tag.h>
27 #include <dcp/types.h>
28 #include <wx/wx.h>
29 #include <vector>
30
31
32 class Film;
33 class RatingDialog;
34 class ContentVersionDialog;
35 class LanguageTagWidget;
36 class LanguageTagDialog;
37
38
39 class SMPTEMetadataDialog : public wxDialog, public WeakFilm
40 {
41 public:
42         SMPTEMetadataDialog (wxWindow* parent, std::weak_ptr<Film> film);
43
44 private:
45         wxPanel* main_panel (wxWindow* parent);
46         wxPanel* advanced_panel (wxWindow* parent);
47         std::vector<dcp::Rating> ratings () const;
48         void set_ratings (std::vector<dcp::Rating> r);
49         std::vector<std::string> content_versions () const;
50         void set_content_versions (std::vector<std::string> v);
51         void name_language_changed (dcp::LanguageTag tag);
52         void audio_language_changed (dcp::LanguageTag tag);
53         void edit_release_territory ();
54         void version_number_changed ();
55         void status_changed ();
56         void chain_changed ();
57         void distributor_changed ();
58         void facility_changed ();
59         void luminance_changed ();
60         void film_changed (ChangeType type, Film::Property property);
61         void setup_sensitivity ();
62         void enable_release_territory_changed ();
63         void enable_chain_changed ();
64         void enable_distributor_changed ();
65         void enable_facility_changed ();
66
67         LanguageTagWidget* _name_language;
68         LanguageTagWidget* _audio_language;
69         wxCheckBox* _enable_release_territory;
70         /** The current release territory displayed in the UI; since we can't easily convert
71          *  the string in _release_territory_text to a RegionSubtag we just store the RegionSubtag
72          *  alongside.
73          */
74         boost::optional<dcp::LanguageTag::RegionSubtag> _release_territory;
75         wxStaticText* _release_territory_text;
76         Button* _edit_release_territory;
77         wxSpinCtrl* _version_number;
78         wxChoice* _status;
79         wxCheckBox* _enable_chain;
80         wxTextCtrl* _chain;
81         wxCheckBox* _enable_distributor;
82         wxTextCtrl* _distributor;
83         wxCheckBox* _enable_facility;
84         wxTextCtrl* _facility;
85         wxSpinCtrlDouble* _luminance_value;
86         wxChoice* _luminance_unit;
87         EditableList<dcp::Rating, RatingDialog>* _ratings;
88         EditableList<std::string, ContentVersionDialog>* _content_versions;
89
90         boost::signals2::scoped_connection _film_changed_connection;
91 };