ID_add_file,
ID_remove,
ID_start_stop,
- ID_timeline
+ ID_timeline,
+ ID_back_frame,
+ ID_forward_frame
};
class DOMFrame : public wxFrame
overall_panel->SetSizer (main_sizer);
#ifdef __WXOSX__
- int accelerators = 5;
+ int accelerators = 7;
#else
- int accelerators = 4;
+ int accelerators = 6;
#endif
wxAcceleratorEntry* accel = new wxAcceleratorEntry[accelerators];
accel[0].Set (wxACCEL_CTRL, static_cast<int>('A'), ID_add_file);
accel[1].Set (wxACCEL_NORMAL, WXK_DELETE, ID_remove);
accel[2].Set (wxACCEL_NORMAL, WXK_SPACE, ID_start_stop);
accel[3].Set (wxACCEL_CTRL, static_cast<int>('T'), ID_timeline);
+ accel[4].Set (wxACCEL_NORMAL, WXK_LEFT, ID_back_frame);
+ accel[5].Set (wxACCEL_NORMAL, WXK_RIGHT, ID_forward_frame);
#ifdef __WXOSX__
- accel[4].Set (wxACCEL_CTRL, static_cast<int>('W'), wxID_EXIT);
+ accel[6].Set (wxACCEL_CTRL, static_cast<int>('W'), wxID_EXIT);
#endif
Bind (wxEVT_MENU, boost::bind (&ContentPanel::add_file_clicked, _film_editor->content_panel()), ID_add_file);
Bind (wxEVT_MENU, boost::bind (&DOMFrame::remove_clicked, this, _1), ID_remove);
Bind (wxEVT_MENU, boost::bind (&DOMFrame::start_stop_pressed, this), ID_start_stop);
Bind (wxEVT_MENU, boost::bind (&DOMFrame::timeline_pressed, this), ID_timeline);
+ Bind (wxEVT_MENU, boost::bind (&DOMFrame::back_frame, this), ID_back_frame);
+ Bind (wxEVT_MENU, boost::bind (&DOMFrame::forward_frame, this), ID_forward_frame);
wxAcceleratorTable accel_table (accelerators, accel);
SetAcceleratorTable (accel_table);
delete[] accel;
_film_editor->content_panel()->timeline_clicked ();
}
+ void back_frame ()
+ {
+ _film_viewer->back_frame ();
+ }
+
+ void forward_frame ()
+ {
+ _film_viewer->forward_frame ();
+ }
+
FilmEditor* _film_editor;
FilmViewer* _film_viewer;
VideoWaveformDialog* _video_waveform_dialog;
}
DCPTime
-FilmViewer::nudge_amount (wxMouseEvent& ev)
+FilmViewer::nudge_amount (wxKeyboardState& ev)
{
DCPTime amount = one_video_frame ();
}
void
-FilmViewer::back_clicked (wxMouseEvent& ev)
+FilmViewer::back_frame ()
+{
+ if (!_film) {
+ return;
+ }
+
+ go_to (_video_position - one_video_frame());
+}
+
+void
+FilmViewer::forward_frame ()
+{
+ if (!_film) {
+ return;
+ }
+
+ go_to (_video_position + one_video_frame());
+}
+
+void
+FilmViewer::back_clicked (wxKeyboardState& ev)
{
go_to (_video_position - nudge_amount (ev));
- ev.Skip ();
}
void
-FilmViewer::forward_clicked (wxMouseEvent& ev)
+FilmViewer::forward_clicked (wxKeyboardState& ev)
{
go_to (_video_position + nudge_amount (ev));
- ev.Skip ();
}
void
return _playing;
}
+ void back_frame ();
+ void forward_frame ();
+
int audio_callback (void* out, unsigned int frames);
boost::signals2::signal<void (boost::weak_ptr<PlayerVideo>)> ImageChanged;
void check_play_state ();
void active_jobs_changed (boost::optional<std::string>);
void rewind_clicked (wxMouseEvent &);
- void back_clicked (wxMouseEvent &);
- void forward_clicked (wxMouseEvent &);
+ void back_clicked (wxKeyboardState& s);
+ void forward_clicked (wxKeyboardState &);
void player_changed (int, bool);
void update_position_label ();
void update_position_slider ();
void refresh_panel ();
void setup_sensitivity ();
void film_changed (Film::Property);
- DCPTime nudge_amount (wxMouseEvent &);
+ DCPTime nudge_amount (wxKeyboardState &);
void timecode_clicked ();
void frame_number_clicked ();
void go_to (DCPTime t);