diff options
| author | Carl Hetherington <cth@carlh.net> | 2017-12-17 15:47:10 +0000 |
|---|---|---|
| committer | Carl Hetherington <cth@carlh.net> | 2017-12-17 15:47:10 +0000 |
| commit | 6abe10b28dbe3132ac329dad60befae5f40fbe69 (patch) | |
| tree | af2787f633a4c05868fb6c934b43835b93597a93 /src | |
| parent | 33a3a1d5c73685287ee5dcbbd6c67f99f98ad72f (diff) | |
Display decode resolution in the player.
Diffstat (limited to 'src')
| -rw-r--r-- | src/tools/dcpomatic_player.cc | 1 | ||||
| -rw-r--r-- | src/wx/film_viewer.cc | 8 | ||||
| -rw-r--r-- | src/wx/film_viewer.h | 1 | ||||
| -rw-r--r-- | src/wx/player_information.cc | 10 | ||||
| -rw-r--r-- | src/wx/player_information.h | 1 |
5 files changed, 20 insertions, 1 deletions
diff --git a/src/tools/dcpomatic_player.cc b/src/tools/dcpomatic_player.cc index 836244db9..0346bb18a 100644 --- a/src/tools/dcpomatic_player.cc +++ b/src/tools/dcpomatic_player.cc @@ -127,6 +127,7 @@ public: void set_decode_reduction (optional<int> reduction) { _viewer->set_dcp_decode_reduction (reduction); + _info->triggered_update (); } void load_dcp (boost::filesystem::path dir) diff --git a/src/wx/film_viewer.cc b/src/wx/film_viewer.cc index 0bb582c66..7ada3b01a 100644 --- a/src/wx/film_viewer.cc +++ b/src/wx/film_viewer.cc @@ -1,5 +1,5 @@ /* - Copyright (C) 2012-2016 Carl Hetherington <cth@carlh.net> + Copyright (C) 2012-2017 Carl Hetherington <cth@carlh.net> This file is part of DCP-o-matic. @@ -819,6 +819,12 @@ FilmViewer::set_dcp_decode_reduction (optional<int> reduction) } } +optional<int> +FilmViewer::dcp_decode_reduction () const +{ + return _dcp_decode_reduction; +} + DCPTime FilmViewer::one_video_frame () const { diff --git a/src/wx/film_viewer.h b/src/wx/film_viewer.h index 60ea2ec3d..a96904882 100644 --- a/src/wx/film_viewer.h +++ b/src/wx/film_viewer.h @@ -57,6 +57,7 @@ public: void set_position (DCPTime p); void set_coalesce_player_changes (bool c); void set_dcp_decode_reduction (boost::optional<int> reduction); + boost::optional<int> dcp_decode_reduction () const; void refresh (); diff --git a/src/wx/player_information.cc b/src/wx/player_information.cc index 1b3d2809b..98d4ab81b 100644 --- a/src/wx/player_information.cc +++ b/src/wx/player_information.cc @@ -55,6 +55,7 @@ PlayerInformation::PlayerInformation (wxWindow* parent, FilmViewer* viewer) wxSizer* 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); + _decode_resolution = add_label_to_sizer(s, this, wxT(""), false, 0); _sizer->Add (s, 1, wxEXPAND | wxALL, 6); } @@ -120,4 +121,13 @@ PlayerInformation::triggered_update () dcp->full_length().frames_round(*vfr) ) ); + + dcp::Size decode = dcp->video->size(); + optional<int> reduction = _viewer->dcp_decode_reduction(); + if (reduction) { + decode.width /= pow(2, *reduction); + decode.height /= pow(2, *reduction); + } + + checked_set (_decode_resolution, wxString::Format(_("Decode resolution: %dx%d"), decode.width, decode.height)); } diff --git a/src/wx/player_information.h b/src/wx/player_information.h index 0fcbb15ee..747cd5a20 100644 --- a/src/wx/player_information.h +++ b/src/wx/player_information.h @@ -38,5 +38,6 @@ private: wxSizer* _sizer; wxStaticText** _dcp; wxStaticText* _dropped; + wxStaticText* _decode_resolution; boost::scoped_ptr<wxTimer> _timer; }; |
