Add LanguageTagWidget and use it for the SMPTE metadata.
[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 "lib/film.h"
23 #include <dcp/types.h>
24 #include <wx/wx.h>
25 #include <boost/shared_ptr.hpp>
26 #include <boost/weak_ptr.hpp>
27 #include <vector>
28
29
30 class Film;
31 class RatingDialog;
32 class ContentVersionDialog;
33 class LanguageTagWidget;
34
35
36 class SMPTEMetadataDialog : public wxDialog
37 {
38 public:
39         SMPTEMetadataDialog (wxWindow* parent, boost::weak_ptr<Film> film);
40
41 private:
42         std::vector<dcp::Rating> ratings () const;
43         void set_ratings (std::vector<dcp::Rating> r);
44         std::vector<std::string> content_versions () const;
45         void set_content_versions (std::vector<std::string> v);
46         void name_language_changed (dcp::LanguageTag tag);
47         void audio_language_changed (dcp::LanguageTag tag);
48         void edit_release_territory ();
49         void version_number_changed ();
50         void status_changed ();
51         void chain_changed ();
52         void distributor_changed ();
53         void facility_changed ();
54         void luminance_changed ();
55         void film_changed (ChangeType type, Film::Property property);
56         boost::shared_ptr<Film> film () const;
57
58         boost::weak_ptr<Film> _film;
59         LanguageTagWidget* _name_language;
60         LanguageTagWidget* _audio_language;
61         wxStaticText* _release_territory;
62         wxSpinCtrl* _version_number;
63         wxChoice* _status;
64         wxTextCtrl* _chain;
65         wxTextCtrl* _distributor;
66         wxTextCtrl* _facility;
67         wxSpinCtrlDouble* _luminance_value;
68         wxChoice* _luminance_unit;
69         EditableList<dcp::Rating, RatingDialog>* _ratings;
70         EditableList<std::string, ContentVersionDialog>* _content_versions;
71
72         boost::signals2::scoped_connection _film_changed_connection;
73 };