Supporters update.
[dcpomatic.git] / src / wx / metadata_dialog.h
1 /*
2     Copyright (C) 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 #ifndef DCPOMATIC_METADATA_DIALOG_H
23 #define DCPOMATIC_METADATA_DIALOG_H
24
25
26 #include "editable_list.h"
27 #include "lib/change_signaller.h"
28 #include "lib/film_property.h"
29 #include "lib/weak_film.h"
30 #include <dcp/rating.h>
31 #include <dcp/warnings.h>
32 LIBDCP_DISABLE_WARNINGS
33 #include <wx/wx.h>
34 LIBDCP_ENABLE_WARNINGS
35 #include <unordered_map>
36
37
38 class Button;
39 class CheckBox;
40 class Choice;
41 class LanguageTagWidget;
42 class RatingDialog;
43 class RegionSubtagWidget;
44 class wxSpinCtrlDouble;
45
46
47 class MetadataDialog : public wxDialog, public WeakFilm
48 {
49 public:
50         MetadataDialog (wxWindow* parent, std::weak_ptr<Film> film);
51
52         virtual void setup ();
53
54 protected:
55         virtual void setup_standard (wxPanel*, wxSizer*);
56         virtual void setup_advanced (wxPanel*, wxSizer*);
57         virtual void film_changed(ChangeType type, FilmProperty property);
58         virtual void setup_sensitivity ();
59
60         EditableList<dcp::Rating, RatingDialog>* _ratings;
61         std::unordered_map<std::string, std::string> _rating_system_agency_to_name;
62
63 private:
64         void sign_language_video_language_changed ();
65         void release_territory_changed(boost::optional<dcp::LanguageTag::RegionSubtag> tag);
66         void enable_release_territory_changed ();
67         void facility_changed ();
68         void enable_facility_changed ();
69         void studio_changed ();
70         void enable_studio_changed ();
71         void temp_version_changed ();
72         void pre_release_changed ();
73         void red_band_changed ();
74         void two_d_version_of_three_d_changed ();
75         void chain_changed ();
76         void enable_chain_changed ();
77         void enable_luminance_changed ();
78         void luminance_changed ();
79         std::vector<dcp::Rating> ratings () const;
80         void set_ratings (std::vector<dcp::Rating> r);
81         void territory_type_changed();
82
83         CheckBox* _enable_release_territory;
84         /** The current release territory displayed in the UI; since we can't easily convert
85          *  the string in _release_territory_text to a RegionSubtag we just store the RegionSubtag
86          *  alongside.
87          */
88         boost::optional<dcp::LanguageTag::RegionSubtag> _release_territory_copy;
89         RegionSubtagWidget* _release_territory;
90         Choice* _territory_type;
91         LanguageTagWidget* _sign_language_video_language = nullptr;
92         CheckBox* _enable_facility;
93         wxTextCtrl* _facility;
94         CheckBox* _enable_chain;
95         wxTextCtrl* _chain;
96         CheckBox* _enable_studio;
97         wxTextCtrl* _studio;
98         CheckBox* _temp_version;
99         CheckBox* _pre_release;
100         CheckBox* _red_band;
101         CheckBox* _two_d_version_of_three_d;
102         CheckBox* _enable_luminance;
103         wxSpinCtrlDouble* _luminance_value;
104         Choice* _luminance_unit;
105
106         boost::signals2::scoped_connection _film_changed_connection;
107 };
108
109
110 #endif
111