summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorCarl Hetherington <cth@carlh.net>2018-09-11 19:58:28 +0100
committerCarl Hetherington <cth@carlh.net>2018-09-11 19:58:28 +0100
commit15895d47cebc0988aecf0a6b84947f4b6bae9aa3 (patch)
treeafdca3099e691981fe2dbd0be4e9fb88cdcf5a3f /src
parent42e9303d4bfd41eaeaa093bcdc5d77eee7a0696d (diff)
Full-screen mode for player.
Diffstat (limited to 'src')
-rw-r--r--src/tools/dcpomatic_player.cc29
-rw-r--r--src/wx/film_viewer.cc1
2 files changed, 23 insertions, 7 deletions
diff --git a/src/tools/dcpomatic_player.cc b/src/tools/dcpomatic_player.cc
index a95476fc1..9a9316717 100644
--- a/src/tools/dcpomatic_player.cc
+++ b/src/tools/dcpomatic_player.cc
@@ -85,7 +85,8 @@ enum {
ID_file_close = 100,
ID_view_cpl,
/* Allow spare IDs for CPLs */
- ID_view_closed_captions = 200,
+ ID_view_full_screen = 200,
+ ID_view_closed_captions,
ID_view_scale_appropriate,
ID_view_scale_full,
ID_view_scale_half,
@@ -107,6 +108,7 @@ public:
, _update_news_requested (false)
, _info (0)
, _config_dialog (0)
+ , _full_screen (false)
, _file_menu (0)
, _history_items (0)
, _history_position (0)
@@ -137,6 +139,7 @@ public:
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::view_full_screen, this), ID_view_full_screen);
Bind (wxEVT_MENU, boost::bind (&DOMFrame::view_closed_captions, this), ID_view_closed_captions);
Bind (wxEVT_MENU, boost::bind (&DOMFrame::view_cpl, this, _1), ID_view_cpl, ID_view_cpl + MAX_CPLS);
Bind (wxEVT_MENU, boost::bind (&DOMFrame::set_decode_reduction, this, optional<int>(0)), ID_view_scale_full);
@@ -150,17 +153,17 @@ public:
/* Use a panel as the only child of the Frame so that we avoid
the dark-grey background on Windows.
*/
- wxPanel* overall_panel = new wxPanel (this, wxID_ANY);
+ _overall_panel = new wxPanel (this, wxID_ANY);
- _viewer.reset (new FilmViewer (overall_panel));
- _controls = new Controls (overall_panel, _viewer);
+ _viewer.reset (new FilmViewer (_overall_panel));
+ _controls = new Controls (_overall_panel, _viewer);
_viewer->set_dcp_decode_reduction (Config::instance()->decode_reduction ());
- _info = new PlayerInformation (overall_panel, _viewer);
+ _info = new PlayerInformation (_overall_panel, _viewer);
wxSizer* main_sizer = new wxBoxSizer (wxVERTICAL);
- main_sizer->Add (_viewer->panel(), 1, wxEXPAND | wxALL, 6);
+ main_sizer->Add (_viewer->panel(), 1, wxEXPAND);
main_sizer->Add (_controls, 0, wxEXPAND | wxALL, 6);
main_sizer->Add (_info, 0, wxEXPAND | wxALL, 6);
- overall_panel->SetSizer (main_sizer);
+ _overall_panel->SetSizer (main_sizer);
#ifdef __WXOSX__
int accelerators = 4;
@@ -274,6 +277,7 @@ private:
wxMenu* view = new wxMenu;
optional<int> c = Config::instance()->decode_reduction();
_view_cpl = view->Append(ID_view_cpl, _("CPL"), _cpl_menu);
+ view->AppendCheckItem(ID_view_full_screen, _("Full screen\tF11"))->Check(_full_screen);
view->Append(ID_view_closed_captions, _("Closed captions..."));
view->AppendSeparator();
view->AppendRadioItem(ID_view_scale_appropriate, _("Set decode resolution to match display"))->Check(!static_cast<bool>(c));
@@ -438,6 +442,15 @@ private:
dcp->examine (shared_ptr<Job>());
}
+ void view_full_screen ()
+ {
+ _full_screen = !_full_screen;
+ _controls->Show (!_full_screen);
+ _info->Show (!_full_screen);
+ _overall_panel->SetBackgroundColour (_full_screen ? wxColour(0, 0, 0) : wxNullColour);
+ ShowFullScreen (_full_screen);
+ }
+
void view_closed_captions ()
{
_viewer->show_closed_captions ();
@@ -646,6 +659,8 @@ private:
bool _update_news_requested;
PlayerInformation* _info;
wxPreferencesEditor* _config_dialog;
+ bool _full_screen;
+ wxPanel* _overall_panel;
wxMenu* _file_menu;
wxMenuItem* _view_cpl;
wxMenu* _cpl_menu;
diff --git a/src/wx/film_viewer.cc b/src/wx/film_viewer.cc
index bd83821be..c062524e9 100644
--- a/src/wx/film_viewer.cc
+++ b/src/wx/film_viewer.cc
@@ -91,6 +91,7 @@ FilmViewer::FilmViewer (wxWindow* p)
#endif
_panel->SetBackgroundStyle (wxBG_STYLE_PAINT);
+ _panel->SetBackgroundColour (*wxBLACK);
_panel->Bind (wxEVT_PAINT, boost::bind (&FilmViewer::paint_panel, this));
_panel->Bind (wxEVT_SIZE, boost::bind (&FilmViewer::panel_sized, this, _1));