Add Close option to player.
authorCarl Hetherington <cth@carlh.net>
Sun, 17 Dec 2017 16:01:32 +0000 (16:01 +0000)
committerCarl Hetherington <cth@carlh.net>
Sun, 17 Dec 2017 16:01:32 +0000 (16:01 +0000)
ChangeLog
src/tools/dcpomatic_player.cc
src/wx/film_viewer.cc
src/wx/player_information.cc

index 7007efbd0333cb863fbce1090240fd8b2a94538b..ae5eb8c1c0493dc409dc2aeea08bcf87dca27e1c 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,7 @@
 2017-12-17  Carl Hetherington  <cth@carlh.net>
 
+       * Add Close option to player.
+
        * Display decode resolution in the player.
 
 2017-12-13  Carl Hetherington  <cth@carlh.net>
index 0346bb18ab7ddfc1897fb778f7bd2187c6cd0ac6..a4db5fc71959239e8ddc5d739f2655c552ead6c6 100644 (file)
@@ -62,6 +62,7 @@ enum {
        ID_file_open = 1,
        ID_file_add_ov,
        ID_file_add_kdm,
+       ID_file_close,
        ID_view_scale_appropriate,
        ID_view_scale_full,
        ID_view_scale_half,
@@ -99,6 +100,7 @@ public:
                Bind (wxEVT_MENU, boost::bind (&DOMFrame::file_open, this), ID_file_open);
                Bind (wxEVT_MENU, boost::bind (&DOMFrame::file_add_ov, this), ID_file_add_ov);
                Bind (wxEVT_MENU, boost::bind (&DOMFrame::file_add_kdm, this), ID_file_add_kdm);
+               Bind (wxEVT_MENU, boost::bind (&DOMFrame::file_close, this), ID_file_close);
                Bind (wxEVT_MENU, boost::bind (&DOMFrame::file_exit, this), wxID_EXIT);
                Bind (wxEVT_MENU, boost::bind (&DOMFrame::edit_preferences, this), wxID_PREFERENCES);
                Bind (wxEVT_MENU, boost::bind (&DOMFrame::set_decode_reduction, this, optional<int>()), ID_view_scale_appropriate);
@@ -171,6 +173,9 @@ private:
                file->Append (ID_file_open, _("&Open...\tCtrl-O"));
                file->Append (ID_file_add_ov, _("&Add OV..."));
                file->Append (ID_file_add_kdm, _("&Add KDM..."));
+               file->AppendSeparator ();
+               file->Append (ID_file_close, _("&Close"));
+               file->AppendSeparator ();
 
 #ifdef __WXOSX__
                file->Append (wxID_EXIT, _("&Exit"));
@@ -291,6 +296,12 @@ private:
                _info->triggered_update ();
        }
 
+       void file_close ()
+       {
+               _viewer->set_film (shared_ptr<Film>());
+               _info->triggered_update ();
+       }
+
        void file_exit ()
        {
                Close ();
index 7ada3b01ad708439cc9728d40a089cd57e6ac1ae..a834a5344045587674e0d6c73ee288a8d4fca9c1 100644 (file)
@@ -191,6 +191,10 @@ FilmViewer::set_film (shared_ptr<Film> film)
        update_position_label ();
 
        if (!_film) {
+               _player.reset ();
+               recreate_butler ();
+               _frame.reset ();
+               refresh_panel ();
                return;
        }
 
index 98d4ab81b0fa883cf726d6abb6fd7eed72bebf36..bab960730bfbc9844323bdf259281ba3ecf85a3a 100644 (file)
@@ -90,6 +90,7 @@ PlayerInformation::triggered_update ()
                for (int r = 1; r < dcp_lines; ++r) {
                        checked_set (_dcp[r], wxT(""));
                }
+               checked_set (_decode_resolution, wxT(""));
                return;
        }