Store subtitle language(s) in Film, and allow setup of those
[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 "language_tag_dialog.h"
23 #include "lib/film.h"
24 #include <dcp/language_tag.h>
25 #include <dcp/types.h>
26 #include <wx/wx.h>
27 #include <boost/shared_ptr.hpp>
28 #include <boost/weak_ptr.hpp>
29 #include <vector>
30
31
32 class Film;
33 class RatingDialog;
34 class ContentVersionDialog;
35 class LanguageTagWidget;
36
37
38 class SMPTEMetadataDialog : public wxDialog
39 {
40 public:
41         SMPTEMetadataDialog (wxWindow* parent, boost::weak_ptr<Film> film);
42
43 private:
44         std::vector<dcp::Rating> ratings () const;
45         void set_ratings (std::vector<dcp::Rating> r);
46         std::vector<std::string> content_versions () const;
47         void set_content_versions (std::vector<std::string> v);
48         void name_language_changed (dcp::LanguageTag tag);
49         void audio_language_changed (dcp::LanguageTag tag);
50         void enable_main_subtitle_changed ();
51         void main_subtitle_language_changed (dcp::LanguageTag tag);
52         std::vector<dcp::LanguageTag> additional_subtitle_languages ();
53         void set_additional_subtitle_languages (std::vector<dcp::LanguageTag> languages);
54         void edit_release_territory ();
55         void version_number_changed ();
56         void status_changed ();
57         void chain_changed ();
58         void distributor_changed ();
59         void facility_changed ();
60         void luminance_changed ();
61         void film_changed (ChangeType type, Film::Property property);
62         void setup_sensitivity ();
63         boost::shared_ptr<Film> film () const;
64
65         boost::weak_ptr<Film> _film;
66         LanguageTagWidget* _name_language;
67         LanguageTagWidget* _audio_language;
68         wxCheckBox* _enable_main_subtitle_language;
69         LanguageTagWidget* _main_subtitle_language;
70         EditableList<dcp::LanguageTag, LanguageTagDialog>* _additional_subtitle_languages;
71         wxStaticText* _release_territory;
72         wxSpinCtrl* _version_number;
73         wxChoice* _status;
74         wxTextCtrl* _chain;
75         wxTextCtrl* _distributor;
76         wxTextCtrl* _facility;
77         wxSpinCtrlDouble* _luminance_value;
78         wxChoice* _luminance_unit;
79         EditableList<dcp::Rating, RatingDialog>* _ratings;
80         EditableList<std::string, ContentVersionDialog>* _content_versions;
81
82         boost::signals2::scoped_connection _film_changed_connection;
83 };