From fe50be9c37b0c93ac87075018488a9716432d8de Mon Sep 17 00:00:00 2001 From: Carl Hetherington Date: Fri, 23 Mar 2018 01:28:13 +0000 Subject: [PATCH] Add arrows to player too. --- src/tools/dcpomatic_player.cc | 24 ++++++++++++++++++++---- 1 file changed, 20 insertions(+), 4 deletions(-) diff --git a/src/tools/dcpomatic_player.cc b/src/tools/dcpomatic_player.cc index 39826df1b..d7e47081c 100644 --- a/src/tools/dcpomatic_player.cc +++ b/src/tools/dcpomatic_player.cc @@ -84,7 +84,9 @@ enum { ID_tools_verify, ID_tools_check_for_updates, /* IDs for shortcuts (with no associated menu item) */ - ID_start_stop + ID_start_stop, + ID_back_frame, + ID_forward_frame }; class DOMFrame : public wxFrame @@ -149,21 +151,25 @@ public: overall_panel->SetSizer (main_sizer); #ifdef __WXOSX__ - int accelerators = 2; + int accelerators = 4; #else - int accelerators = 1; + int accelerators = 3; #endif wxAcceleratorEntry* accel = new wxAcceleratorEntry[accelerators]; accel[0].Set(wxACCEL_NORMAL, WXK_SPACE, ID_start_stop); + accel[1].Set(wxACCEL_NORMAL, WXK_LEFT, ID_back_frame); + accel[2].Set(wxACCEL_NORMAL, WXK_RIGHT, ID_forward_frame); #ifdef __WXOSX__ - accel[1].Set(wxACCEL_CTRL, static_cast('W'), ID_file_close); + accel[3].Set(wxACCEL_CTRL, static_cast('W'), ID_file_close); #endif wxAcceleratorTable accel_table (accelerators, accel); SetAcceleratorTable (accel_table); delete[] accel; Bind (wxEVT_MENU, boost::bind (&DOMFrame::start_stop_pressed, this), ID_start_stop); + Bind (wxEVT_MENU, boost::bind (&DOMFrame::back_frame, this), ID_back_frame); + Bind (wxEVT_MENU, boost::bind (&DOMFrame::forward_frame, this), ID_forward_frame); UpdateChecker::instance()->StateChanged.connect (boost::bind (&DOMFrame::update_checker_state_changed, this)); } @@ -573,6 +579,16 @@ private: } } + void back_frame () + { + _viewer->back_frame (); + } + + void forward_frame () + { + _viewer->forward_frame (); + } + bool _update_news_requested; PlayerInformation* _info; wxPreferencesEditor* _config_dialog; -- 2.30.2