diff options
| author | Carl Hetherington <cth@carlh.net> | 2022-07-21 21:09:30 +0200 |
|---|---|---|
| committer | Carl Hetherington <cth@carlh.net> | 2022-09-27 23:40:51 +0200 |
| commit | 600e0c67c61b29427602918daebb38a4822f95cb (patch) | |
| tree | f89b9a68082263d57a8a5b27d342aa56fa66f251 /src | |
| parent | ae11f9e1104cca1f138a09b35fdff20587a8144b (diff) | |
Add basic KDM information to the player (#2225).
Diffstat (limited to 'src')
| -rw-r--r-- | src/wx/player_information.cc | 27 | ||||
| -rw-r--r-- | src/wx/player_information.h | 3 |
2 files changed, 30 insertions, 0 deletions
diff --git a/src/wx/player_information.cc b/src/wx/player_information.cc index 6bb138c05..ca3a05ea4 100644 --- a/src/wx/player_information.cc +++ b/src/wx/player_information.cc @@ -73,6 +73,21 @@ PlayerInformation::PlayerInformation (wxWindow* parent, weak_ptr<FilmViewer> vie } { + _kdm_panel = new wxPanel(this, wxID_ANY); + auto s = new wxBoxSizer(wxVERTICAL); + add_label_to_sizer(s, _kdm_panel, _("KDM"), false, 0)->SetFont(title_font); + auto g = new wxGridBagSizer(0, DCPOMATIC_SIZER_GAP); + add_label_to_sizer(g, _kdm_panel, _("Valid from"), true, wxGBPosition(0, 0)); + _kdm_from = add_label_to_sizer(g, _kdm_panel, wxT(""), false, wxGBPosition(0, 1)); + add_label_to_sizer(g, _kdm_panel, _("Valid to"), true, wxGBPosition(1, 0)); + _kdm_to = add_label_to_sizer(g, _kdm_panel, wxT(""), false, wxGBPosition(1, 1)); + auto pad = new wxBoxSizer(wxVERTICAL); + s->Add(g, 1, wxEXPAND | wxLEFT, DCPOMATIC_SIZER_GAP); + _kdm_panel->SetSizer(s); + _sizer->Add(_kdm_panel, 1, wxEXPAND | wxALL, 6); + } + + { auto s = new wxBoxSizer (wxVERTICAL); add_label_to_sizer(s, this, _("Performance"), false, 0)->SetFont(title_font); _dropped = add_label_to_sizer(s, this, wxT(""), false, 0); @@ -128,6 +143,7 @@ PlayerInformation::triggered_update () checked_set (_dcp[r], wxT("")); } checked_set (_decode_resolution, wxT("")); + _kdm_panel->Hide(); return; } @@ -182,5 +198,16 @@ PlayerInformation::triggered_update () DCPOMATIC_ASSERT(r <= dcp_lines); + if (dcp->encrypted() && dcp->kdm()) { + _kdm_panel->Show(); + auto const kdm = *dcp->kdm(); + auto const before = kdm.not_valid_before(); + checked_set(_kdm_from, wxString::Format(_("%s %s"), std_to_wx(before.date()), std_to_wx(before.time_of_day(true, false)))); + auto const after = kdm.not_valid_after(); + checked_set(_kdm_to, wxString::Format(_("%s %s"), std_to_wx(after.date()), std_to_wx(after.time_of_day(true, false)))); + } else { + _kdm_panel->Hide(); + } + _sizer->Layout (); } diff --git a/src/wx/player_information.h b/src/wx/player_information.h index 269a9e6c7..b311847cb 100644 --- a/src/wx/player_information.h +++ b/src/wx/player_information.h @@ -41,8 +41,11 @@ private: void periodic_update (); std::weak_ptr<FilmViewer> _viewer; + wxPanel* _kdm_panel; wxSizer* _sizer; wxStaticText** _dcp; + wxStaticText* _kdm_from; + wxStaticText* _kdm_to; wxStaticText* _dropped; wxStaticText* _decode_resolution; boost::scoped_ptr<wxTimer> _timer; |
