X-Git-Url: https://git.carlh.net/gitweb/?a=blobdiff_plain;f=src%2Fwx%2Ftimeline.h;h=24c046a6a2faaabebb85400972fcb339ff0e36fe;hb=HEAD;hp=b532e74e3730989bb78124cc7a8cacf9e997dd86;hpb=dd9be86db6cde0afa5da0d1d1ac43b42e05dca26;p=dcpomatic.git diff --git a/src/wx/timeline.h b/src/wx/timeline.h index b532e74e3..621609fa7 100644 --- a/src/wx/timeline.h +++ b/src/wx/timeline.h @@ -18,26 +18,31 @@ */ + #include "content_menu.h" #include "timeline_content_view.h" -#include "lib/util.h" +#include "lib/film_property.h" #include "lib/rect.h" -#include "lib/film.h" +#include +LIBDCP_DISABLE_WARNINGS #include +LIBDCP_ENABLE_WARNINGS #include -class Film; + class ContentPanel; -class TimelineView; -class TimelineTimeAxisView; -class TimelineReelsView; -class TimelineLabelsView; +class Film; class FilmViewer; +class TimelineLabelsView; +class TimelineReelsView; +class TimelineTimeAxisView; +class TimelineView; + class Timeline : public wxPanel { public: - Timeline (wxWindow *, ContentPanel *, std::shared_ptr, std::weak_ptr viewer); + Timeline (wxWindow *, ContentPanel *, std::shared_ptr, FilmViewer& viewer); std::shared_ptr film () const; @@ -77,6 +82,8 @@ public: int tracks_y_offset () const; + void keypress(wxKeyEvent const &); + private: void paint_labels (); void paint_main (); @@ -90,7 +97,7 @@ private: void mouse_moved (wxMouseEvent &); void mouse_moved_select (wxMouseEvent &); void mouse_moved_zoom (wxMouseEvent &); - void film_change (ChangeType type, Film::Property); + void film_change(ChangeType type, FilmProperty); void film_content_change (ChangeType type, int, bool frequent); void resized (); void assign_tracks (); @@ -103,6 +110,7 @@ private: void set_pixels_per_track (int h); void zoom_all (); void update_playhead (); + void mouse_wheel_turned(wxMouseEvent& event); std::shared_ptr event_to_view (wxMouseEvent &); TimelineContentViewList selected_views () const; @@ -113,7 +121,7 @@ private: wxScrolledCanvas* _main_canvas; ContentPanel* _content_panel; std::weak_ptr _film; - std::weak_ptr _viewer; + FilmViewer& _viewer; TimelineViewList _views; std::shared_ptr _time_axis_view; std::shared_ptr _reels_view; @@ -136,6 +144,8 @@ private: int _pixels_per_track; bool _first_resize; wxTimer _timer; + boost::optional _last_mouse_wheel_x; + boost::optional _last_mouse_wheel_time; static double const _minimum_pixels_per_second; static int const _minimum_pixels_per_track;