summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorCarl Hetherington <cth@carlh.net>2017-12-17 16:01:32 +0000
committerCarl Hetherington <cth@carlh.net>2017-12-17 16:01:32 +0000
commitb8883efc8d891ec634ba5587c2d3ca02c71b7cce (patch)
tree44660c4bd9d68317a55399cb18a6f3b8854c0383 /src
parent6abe10b28dbe3132ac329dad60befae5f40fbe69 (diff)
Add Close option to player.
Diffstat (limited to 'src')
-rw-r--r--src/tools/dcpomatic_player.cc11
-rw-r--r--src/wx/film_viewer.cc4
-rw-r--r--src/wx/player_information.cc1
3 files changed, 16 insertions, 0 deletions
diff --git a/src/tools/dcpomatic_player.cc b/src/tools/dcpomatic_player.cc
index 0346bb18a..a4db5fc71 100644
--- a/src/tools/dcpomatic_player.cc
+++ b/src/tools/dcpomatic_player.cc
@@ -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 ();
diff --git a/src/wx/film_viewer.cc b/src/wx/film_viewer.cc
index 7ada3b01a..a834a5344 100644
--- a/src/wx/film_viewer.cc
+++ b/src/wx/film_viewer.cc
@@ -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;
}
diff --git a/src/wx/player_information.cc b/src/wx/player_information.cc
index 98d4ab81b..bab960730 100644
--- a/src/wx/player_information.cc
+++ b/src/wx/player_information.cc
@@ -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;
}