X-Git-Url: https://main.carlh.net/gitweb/?a=blobdiff_plain;f=src%2Fwx%2Ftimeline.h;h=0217373b9c3bbbf6a6a6986d77c3f74e1ecc99d7;hb=1ba7bca7f2950faa441ec83920d35b65016f3fa6;hp=79ceceaa0c7fde4208c60ebe4fb1836524b4b75b;hpb=ebd495da2fe5be8c07cf7fb52e8283bb7f4113c1;p=dcpomatic.git diff --git a/src/wx/timeline.h b/src/wx/timeline.h index 79ceceaa0..0217373b9 100644 --- a/src/wx/timeline.h +++ b/src/wx/timeline.h @@ -1,5 +1,3 @@ -/* -*- c-basic-offset: 8; default-tab-width: 8; -*- */ - /* Copyright (C) 2013 Carl Hetherington @@ -21,21 +19,26 @@ #include #include +#include #include -#include "util.h" +#include "lib/util.h" +#include "lib/rect.h" +#include "content_menu.h" class Film; class View; class ContentView; +class FilmEditor; +class TimeAxisView; class Timeline : public wxPanel { public: - Timeline (wxWindow *, boost::shared_ptr); + Timeline (wxWindow *, FilmEditor *, boost::shared_ptr); boost::shared_ptr film () const; - void force_redraw (Rect const &); + void force_redraw (dcpomatic::Rect const &); int x_offset () const { return 8; @@ -46,34 +49,52 @@ public: } int track_height () const { - return 64; + return 48; } double pixels_per_time_unit () const { return _pixels_per_time_unit; } - Position tracks_position () const { - return Position (8, 8); + Position tracks_position () const { + return Position (8, 8); } int tracks () const; + void setup_pixels_per_time_unit (); + private: - void paint (wxPaintEvent &); + void paint (); void left_down (wxMouseEvent &); - void mouse_moved (wxMouseEvent &); void left_up (wxMouseEvent &); + void right_down (wxMouseEvent &); + void mouse_moved (wxMouseEvent &); void playlist_changed (); - void setup_pixels_per_time_unit (); - void resized (wxSizeEvent &); - - boost::weak_ptr _film; - std::list > _views; + void resized (); + void assign_tracks (); + void set_position_from_event (wxMouseEvent &); + void clear_selection (); + + typedef std::vector > ViewList; + typedef std::vector > ContentViewList; + + boost::shared_ptr event_to_view (wxMouseEvent &); + ContentViewList selected_views () const; + ContentList selected_content () const; + + FilmEditor* _film_editor; + boost::weak_ptr _film; + ViewList _views; + boost::shared_ptr _time_axis_view; + int _tracks; double _pixels_per_time_unit; bool _left_down; wxPoint _down_point; boost::shared_ptr _down_view; - Time _down_view_start; + Time _down_view_position; bool _first_move; + ContentMenu _menu; + + boost::signals2::scoped_connection _playlist_connection; };