diff options
| author | Carl Hetherington <cth@carlh.net> | 2014-06-26 23:36:24 +0100 |
|---|---|---|
| committer | Carl Hetherington <cth@carlh.net> | 2014-06-26 23:36:24 +0100 |
| commit | 4616b19fb5241a54c9d57f7a91bb975f41aed14b (patch) | |
| tree | d067450cb12dd3629fe88ef9a578c6b1cabe7884 /src/wx/timeline.cc | |
| parent | f1d30fb114b3b2c6ccd8fdf5823e7cd6b26c1eef (diff) | |
| parent | 20fa26ea6ecfdbecea8bb1230c8388cce3fd521f (diff) | |
Merge master.
Diffstat (limited to 'src/wx/timeline.cc')
| -rw-r--r-- | src/wx/timeline.cc | 28 |
1 files changed, 26 insertions, 2 deletions
diff --git a/src/wx/timeline.cc b/src/wx/timeline.cc index 4b56168a1..534f4eda7 100644 --- a/src/wx/timeline.cc +++ b/src/wx/timeline.cc @@ -127,6 +127,10 @@ public: _track = t; } + void unset_track () { + _track = boost::optional<int> (); + } + optional<int> track () const { return _track; } @@ -386,7 +390,8 @@ Timeline::Timeline (wxWindow* parent, FilmEditor* ed, shared_ptr<Film> film) SetMinSize (wxSize (640, tracks() * track_height() + 96)); - _playlist_connection = film->playlist()->Changed.connect (bind (&Timeline::playlist_changed, this)); + _playlist_changed_connection = film->playlist()->Changed.connect (bind (&Timeline::playlist_changed, this)); + _playlist_content_changed_connection = film->playlist()->ContentChanged.connect (bind (&Timeline::playlist_content_changed, this, _2)); } void @@ -441,9 +446,28 @@ Timeline::playlist_changed () } void +Timeline::playlist_content_changed (int property) +{ + ensure_ui_thread (); + + if (property == ContentProperty::POSITION) { + assign_tracks (); + setup_pixels_per_second (); + Refresh (); + } +} + +void Timeline::assign_tracks () { for (ViewList::iterator i = _views.begin(); i != _views.end(); ++i) { + shared_ptr<ContentView> c = dynamic_pointer_cast<ContentView> (*i); + if (c) { + c->unset_track (); + } + } + + for (ViewList::iterator i = _views.begin(); i != _views.end(); ++i) { shared_ptr<ContentView> cv = dynamic_pointer_cast<ContentView> (*i); if (!cv) { continue; @@ -680,7 +704,7 @@ Timeline::set_position_from_event (wxMouseEvent& ev) if (new_position < DCPTime ()) { new_position = DCPTime (); } - + _down_view->content()->set_position (new_position); shared_ptr<Film> film = _film.lock (); |
