Display decode resolution in the player.
authorCarl Hetherington <cth@carlh.net>
Sun, 17 Dec 2017 15:47:10 +0000 (15:47 +0000)
committerCarl Hetherington <cth@carlh.net>
Sun, 17 Dec 2017 15:47:10 +0000 (15:47 +0000)
ChangeLog
src/tools/dcpomatic_player.cc
src/wx/film_viewer.cc
src/wx/film_viewer.h
src/wx/player_information.cc
src/wx/player_information.h

index 2dd2a0c67393ac90785a3331dd11f38b128a2cb7..7007efbd0333cb863fbce1090240fd8b2a94538b 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,7 @@
+2017-12-17  Carl Hetherington  <cth@carlh.net>
+
+       * Display decode resolution in the player.
+
 2017-12-13  Carl Hetherington  <cth@carlh.net>
 
        * Version 2.11.29 released.
index 836244db91c516bd9e76c9b5632fdc7301236acb..0346bb18ab7ddfc1897fb778f7bd2187c6cd0ac6 100644 (file)
@@ -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)
index 0bb582c66dffe8d6b46ca649eee103f20c53dc5d..7ada3b01ad708439cc9728d40a089cd57e6ac1ae 100644 (file)
@@ -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
 {
index 60ea2ec3d02a1109b71ccb6ed9c5c5986548da98..a969048826494b3202dff30d6f6c76a7dbe69cba 100644 (file)
@@ -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 ();
 
index 1b3d2809bbb286e212c54f5cb16cafb5e0589b89..98d4ab81b0fa883cf726d6abb6fd7eed72bebf36 100644 (file)
@@ -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));
 }
index 0fcbb15ee840920e99b9cbd402fbe96c455cdb29..747cd5a20a0acd12ea03c6795541683c7eb0fe4a 100644 (file)
@@ -38,5 +38,6 @@ private:
        wxSizer* _sizer;
        wxStaticText** _dcp;
        wxStaticText* _dropped;
+       wxStaticText* _decode_resolution;
        boost::scoped_ptr<wxTimer> _timer;
 };