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