2 Copyright (C) 2013 Carl Hetherington <cth@carlh.net>
4 This program is free software; you can redistribute it and/or modify
5 it under the terms of the GNU General Public License as published by
6 the Free Software Foundation; either version 2 of the License, or
7 (at your option) any later version.
9 This program is distributed in the hope that it will be useful,
10 but WITHOUT ANY WARRANTY; without even the implied warranty of
11 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 GNU General Public License for more details.
14 You should have received a copy of the GNU General Public License
15 along with this program; if not, write to the Free Software
16 Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
20 #include <boost/shared_ptr.hpp>
21 #include <boost/weak_ptr.hpp>
22 #include <boost/signals2.hpp>
33 class Timeline : public wxPanel
36 Timeline (wxWindow *, FilmEditor *, boost::shared_ptr<Film>);
38 boost::shared_ptr<const Film> film () const;
40 void force_redraw (dcpomatic::Rect<int> const &);
42 int x_offset () const {
47 return GetSize().GetWidth ();
50 int track_height () const {
54 double pixels_per_time_unit () const {
55 return _pixels_per_time_unit;
58 Position<int> tracks_position () const {
59 return Position<int> (8, 8);
65 void paint (wxPaintEvent &);
66 void left_down (wxMouseEvent &);
67 void mouse_moved (wxMouseEvent &);
68 void left_up (wxMouseEvent &);
69 void playlist_changed ();
70 void setup_pixels_per_time_unit ();
71 void resized (wxSizeEvent &);
72 void assign_tracks ();
73 void set_start_from_event (wxMouseEvent &);
75 FilmEditor* _film_editor;
76 boost::weak_ptr<Film> _film;
77 std::list<boost::shared_ptr<View> > _views;
78 boost::shared_ptr<TimeAxisView> _time_axis_view;
80 double _pixels_per_time_unit;
83 boost::shared_ptr<ContentView> _down_view;
84 Time _down_view_start;
87 boost::signals2::scoped_connection _playlist_connection;