Emit no audio from DCPs if none is mapped
[dcpomatic.git] / src / wx / timeline.h
index 24c046a6a2faaabebb85400972fcb339ff0e36fe..621609fa7e66b94a2ae1f8cd73f2d548ce609368 100644 (file)
 
 */
 
+
 #include "content_menu.h"
 #include "timeline_content_view.h"
-#include "lib/film.h"
+#include "lib/film_property.h"
 #include "lib/rect.h"
-#include "lib/util.h"
 #include <dcp/warnings.h>
 LIBDCP_DISABLE_WARNINGS
 #include <wx/wx.h>
@@ -42,7 +42,7 @@ class TimelineView;
 class Timeline : public wxPanel
 {
 public:
-       Timeline (wxWindow *, ContentPanel *, std::shared_ptr<Film>, std::weak_ptr<FilmViewer> viewer);
+       Timeline (wxWindow *, ContentPanel *, std::shared_ptr<Film>, FilmViewer& viewer);
 
        std::shared_ptr<const Film> film () const;
 
@@ -82,6 +82,8 @@ public:
 
        int tracks_y_offset () const;
 
+       void keypress(wxKeyEvent const &);
+
 private:
        void paint_labels ();
        void paint_main ();
@@ -95,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 ();
@@ -108,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<TimelineView> event_to_view (wxMouseEvent &);
        TimelineContentViewList selected_views () const;
@@ -118,7 +121,7 @@ private:
        wxScrolledCanvas* _main_canvas;
        ContentPanel* _content_panel;
        std::weak_ptr<Film> _film;
-       std::weak_ptr<FilmViewer> _viewer;
+       FilmViewer& _viewer;
        TimelineViewList _views;
        std::shared_ptr<TimelineTimeAxisView> _time_axis_view;
        std::shared_ptr<TimelineReelsView> _reels_view;
@@ -141,6 +144,8 @@ private:
        int _pixels_per_track;
        bool _first_resize;
        wxTimer _timer;
+       boost::optional<int> _last_mouse_wheel_x;
+       boost::optional<double> _last_mouse_wheel_time;
 
        static double const _minimum_pixels_per_second;
        static int const _minimum_pixels_per_track;