static int const dcp_lines = 6;
-PlayerInformation::PlayerInformation (wxWindow* parent, weak_ptr<FilmViewer> viewer)
+PlayerInformation::PlayerInformation(wxWindow* parent, FilmViewer const& viewer)
: wxPanel (parent)
, _viewer (viewer)
, _sizer (new wxBoxSizer (wxHORIZONTAL))
_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);
void
PlayerInformation::periodic_update ()
{
- auto fv = _viewer.lock ();
- if (fv) {
- auto s = wxString::Format(_("Dropped frames: %d"), fv->dropped() + fv->errored());
- if (fv->errored() == 1) {
- s += wxString::Format(_(" (%d error)"), fv->errored());
- } else if (fv->errored() > 1) {
- s += wxString::Format(_(" (%d errors)"), fv->errored());
- }
- checked_set (_dropped, s);
+ auto s = wxString::Format(_("Dropped frames: %d"), _viewer.dropped() + _viewer.errored());
+ if (_viewer.errored() == 1) {
+ s += wxString::Format(_(" (%d error)"), _viewer.errored());
+ } else if (_viewer.errored() > 1) {
+ s += wxString::Format(_(" (%d errors)"), _viewer.errored());
}
+ checked_set (_dropped, s);
}
void
PlayerInformation::triggered_update ()
{
- auto fv = _viewer.lock ();
- if (!fv) {
- return;
- }
-
shared_ptr<DCPContent> dcp;
- if (fv->film()) {
- auto content = fv->film()->content();
+ if (_viewer.film()) {
+ auto content = _viewer.film()->content();
if (content.size() == 1) {
dcp = dynamic_pointer_cast<DCPContent>(content.front());
}
}
int r = 0;
- checked_set (_dcp[r++], std_to_wx(dcp->name()));
+ checked_set(_dcp[r], std_to_wx(dcp->name()));
+ wxString tooltip;
+ for (auto directory: dcp->directories()) {
+ tooltip += std_to_wx(directory.string()) + "\n";
+ }
+ if (!tooltip.empty()) {
+ _dcp[r]->SetToolTip(tooltip.substr(0, tooltip.length() - 1));
+ }
+ ++r;
if (dcp->needs_assets()) {
checked_set (_dcp[r], _("Needs OV"));
auto const len = String::compose(
wx_to_std(_("Length: %1 (%2 frames)")),
- time_to_hmsf(dcp->full_length(fv->film()), lrint(*vfr)),
- dcp->full_length(fv->film()).frames_round(*vfr)
+ time_to_hmsf(dcp->full_length(_viewer.film()), lrint(*vfr)),
+ dcp->full_length(_viewer.film()).frames_round(*vfr)
);
checked_set (_dcp[r++], std_to_wx(len));
auto decode = dcp->video->size();
- auto reduction = fv->dcp_decode_reduction();
+ auto reduction = _viewer.dcp_decode_reduction();
if (reduction) {
decode.width /= pow(2, *reduction);
decode.height /= pow(2, *reduction);