summaryrefslogtreecommitdiff
path: root/src/wx/player_information.cc
diff options
context:
space:
mode:
authorCarl Hetherington <cth@carlh.net>2017-08-20 00:17:46 +0100
committerCarl Hetherington <cth@carlh.net>2017-08-20 00:17:46 +0100
commit35e9a698ba3ca35fd488b3622e441956632261cf (patch)
tree123624c4bc215943666c1c9cc24d0d08cd8ae336 /src/wx/player_information.cc
parent8f3743d18026b59b1ecd8e8f4d12cc59273eb1ed (diff)
Allow player to handle VF/OV and KDMs.
Diffstat (limited to 'src/wx/player_information.cc')
-rw-r--r--src/wx/player_information.cc35
1 files changed, 26 insertions, 9 deletions
diff --git a/src/wx/player_information.cc b/src/wx/player_information.cc
index 0a2921227..1b3d2809b 100644
--- a/src/wx/player_information.cc
+++ b/src/wx/player_information.cc
@@ -30,6 +30,8 @@ using boost::shared_ptr;
using boost::dynamic_pointer_cast;
using boost::optional;
+static int const dcp_lines = 4;
+
PlayerInformation::PlayerInformation (wxWindow* parent, FilmViewer* viewer)
: wxPanel (parent)
, _viewer (viewer)
@@ -38,12 +40,14 @@ PlayerInformation::PlayerInformation (wxWindow* parent, FilmViewer* viewer)
wxFont title_font (*wxNORMAL_FONT);
title_font.SetWeight (wxFONTWEIGHT_BOLD);
+ _dcp = new wxStaticText*[dcp_lines];
+
{
wxSizer* s = new wxBoxSizer (wxVERTICAL);
add_label_to_sizer(s, this, _("DCP"), false, 0)->SetFont(title_font);
- _cpl_name = add_label_to_sizer(s, this, wxT(""), false, 0);
- _size = add_label_to_sizer(s, this, wxT(""), false, 0);
- _length = add_label_to_sizer(s, this, wxT(""), false, 0);
+ for (int i = 0; i < dcp_lines; ++i) {
+ _dcp[i] = add_label_to_sizer(s, this, wxT(""), false, 0);
+ }
_sizer->Add (s, 1, wxEXPAND | wxALL, 6);
}
@@ -81,22 +85,35 @@ PlayerInformation::triggered_update ()
}
if (!dcp) {
- checked_set (_cpl_name, _("No DCP loaded."));
- checked_set (_size, wxT(""));
- checked_set (_length, wxT(""));
+ checked_set (_dcp[0], _("No DCP loaded."));
+ for (int r = 1; r < dcp_lines; ++r) {
+ checked_set (_dcp[r], wxT(""));
+ }
+ return;
+ }
+
+ int r = 0;
+ checked_set (_dcp[r++], std_to_wx(dcp->name()));
+
+ if (dcp->needs_assets()) {
+ checked_set (_dcp[r], _("Needs OV"));
+ return;
+ }
+
+ if (dcp->needs_kdm()) {
+ checked_set (_dcp[r], _("Needs KDM"));
return;
}
DCPOMATIC_ASSERT (dcp->video);
- checked_set (_cpl_name, std_to_wx(dcp->name()));
- checked_set (_size, wxString::Format(_("Size: %dx%d"), dcp->video->size().width, dcp->video->size().height));
+ checked_set (_dcp[r++], wxString::Format(_("Size: %dx%d"), dcp->video->size().width, dcp->video->size().height));
optional<double> vfr;
vfr = dcp->video_frame_rate ();
DCPOMATIC_ASSERT (vfr);
checked_set (
- _length,
+ _dcp[r++],
wxString::Format(
_("Length: %s (%ld frames)"),
std_to_wx(time_to_hmsf(dcp->full_length(), lrint(*vfr))).data(),