summaryrefslogtreecommitdiff
path: root/src/wx/timeline.h
diff options
context:
space:
mode:
authorCarl Hetherington <cth@carlh.net>2018-07-02 15:57:55 +0100
committerCarl Hetherington <cth@carlh.net>2018-07-02 15:57:55 +0100
commitf07a469603298049d12e1af9deda4ad830362e58 (patch)
treeb1a3b88c2bd521ca99bd5913118913af72ad0fec /src/wx/timeline.h
parentfd24c06df64f9e9877d3ef7c1db9fdee5dacb13b (diff)
Basic zoom.
Diffstat (limited to 'src/wx/timeline.h')
-rw-r--r--src/wx/timeline.h26
1 files changed, 22 insertions, 4 deletions
diff --git a/src/wx/timeline.h b/src/wx/timeline.h
index c8424541e..375a837a8 100644
--- a/src/wx/timeline.h
+++ b/src/wx/timeline.h
@@ -35,7 +35,7 @@ class TimelineTimeAxisView;
class TimelineReelsView;
class TimelineLabelsView;
-class Timeline : public wxPanel
+class Timeline : public wxScrolledCanvas
{
public:
Timeline (wxWindow *, ContentPanel *, boost::shared_ptr<Film>);
@@ -45,7 +45,7 @@ public:
void force_redraw (dcpomatic::Rect<int> const &);
int width () const {
- return GetSize().GetWidth ();
+ return GetVirtualSize().GetWidth ();
}
int track_height () const {
@@ -62,8 +62,6 @@ public:
int tracks () const;
- void setup_pixels_per_second ();
-
void set_snap (bool s) {
_snap = s;
}
@@ -74,12 +72,27 @@ public:
void set_selection (ContentList selection);
+ enum Tool {
+ SELECT,
+ ZOOM
+ };
+
+ void set_tool (Tool t) {
+ _tool = t;
+ }
+
private:
void paint ();
void left_down (wxMouseEvent &);
+ void left_down_select (wxMouseEvent &);
void left_up (wxMouseEvent &);
+ void left_up_select (wxMouseEvent &);
+ void left_up_zoom (wxMouseEvent &);
void right_down (wxMouseEvent &);
+ void right_down_select (wxMouseEvent &);
void mouse_moved (wxMouseEvent &);
+ void mouse_moved_select (wxMouseEvent &);
+ void mouse_moved_zoom (wxMouseEvent &);
void film_changed (Film::Property);
void film_content_changed (int, bool frequent);
void resized ();
@@ -87,6 +100,7 @@ private:
void set_position_from_event (wxMouseEvent &);
void clear_selection ();
void recreate_views ();
+ void setup_scrollbars ();
boost::shared_ptr<TimelineView> event_to_view (wxMouseEvent &);
TimelineContentViewList selected_views () const;
@@ -103,6 +117,7 @@ private:
boost::optional<double> _pixels_per_second;
bool _left_down;
wxPoint _down_point;
+ boost::optional<wxPoint> _zoom_point;
boost::shared_ptr<TimelineContentView> _down_view;
DCPTime _down_view_position;
bool _first_move;
@@ -111,6 +126,9 @@ private:
std::list<DCPTime> _start_snaps;
std::list<DCPTime> _end_snaps;
Position<int> _tracks_position;
+ Tool _tool;
+ int _x_scroll_rate;
+ int _y_scroll_rate;
boost::signals2::scoped_connection _film_changed_connection;
boost::signals2::scoped_connection _film_content_changed_connection;