X-Git-Url: https://git.carlh.net/gitweb/?a=blobdiff_plain;f=src%2Fwx%2Ftimeline.cc;h=1c1da708e44dcc81bbd10515751bff1f982c739d;hb=9153a8a53ada73b4b016e7bb6faf1c2ed99f011b;hp=a607b1eb170fac26507bf8822a7a421a5fc8dafb;hpb=79c7daee26c3695ed1d8b1e9feedb964a9cf4e87;p=dcpomatic.git diff --git a/src/wx/timeline.cc b/src/wx/timeline.cc index a607b1eb1..1c1da708e 100644 --- a/src/wx/timeline.cc +++ b/src/wx/timeline.cc @@ -256,7 +256,7 @@ Timeline::film_content_change (ChangeType type, int property, bool frequent) ensure_ui_thread (); - if (property == AudioContentProperty::STREAMS) { + if (property == AudioContentProperty::STREAMS || property == VideoContentProperty::FRAME_TYPE) { recreate_views (); } else if (property == ContentProperty::POSITION || property == ContentProperty::LENGTH) { _reels_view->force_redraw (); @@ -268,7 +268,7 @@ Timeline::film_content_change (ChangeType type, int property, bool frequent) template int -place (TimelineViewList& views, int& tracks) +place (shared_ptr film, TimelineViewList& views, int& tracks) { int const base = tracks; @@ -282,7 +282,7 @@ place (TimelineViewList& views, int& tracks) int t = base; shared_ptr content = cv->content(); - DCPTimePeriod const content_period (content->position(), content->end()); + DCPTimePeriod const content_period (content->position(), content->end(film)); while (true) { TimelineViewList::iterator j = views.begin(); @@ -296,7 +296,7 @@ place (TimelineViewList& views, int& tracks) shared_ptr test_content = test->content(); if ( test->track() && test->track().get() == t && - content_period.overlap(DCPTimePeriod(test_content->position(), test_content->end()))) { + content_period.overlap(DCPTimePeriod(test_content->position(), test_content->end(film)))) { /* we have an overlap on track `t' */ ++t; break; @@ -354,6 +354,9 @@ Timeline::assign_tracks () Audio N */ + shared_ptr film = _film.lock (); + DCPOMATIC_ASSERT (film); + _tracks = 0; for (TimelineViewList::iterator i = _views.begin(); i != _views.end(); ++i) { @@ -386,7 +389,7 @@ Timeline::assign_tracks () /* Texts */ - int const text_tracks = place (_views, _tracks); + int const text_tracks = place (film, _views, _tracks); /* Atmos */ @@ -412,7 +415,7 @@ Timeline::assign_tracks () TimelineViewList views = _views; sort(views.begin(), views.end(), AudioMappingComparator()); - int const audio_tracks = place (views, _tracks); + int const audio_tracks = place (film, views, _tracks); _labels_view->set_3d (have_3d); _labels_view->set_audio_tracks (audio_tracks); @@ -520,12 +523,15 @@ Timeline::left_down_select (wxMouseEvent& ev) continue; } + shared_ptr film = _film.lock (); + DCPOMATIC_ASSERT (film); + _start_snaps.push_back (cv->content()->position()); _end_snaps.push_back (cv->content()->position()); - _start_snaps.push_back (cv->content()->end()); - _end_snaps.push_back (cv->content()->end()); + _start_snaps.push_back (cv->content()->end(film)); + _end_snaps.push_back (cv->content()->end(film)); - BOOST_FOREACH (DCPTime i, cv->content()->reel_split_points()) { + BOOST_FOREACH (DCPTime i, cv->content()->reel_split_points(film)) { _start_snaps.push_back (i); } } @@ -725,9 +731,11 @@ Timeline::set_position_from_event (wxMouseEvent& ev) DCPTime new_position = _down_view_position + DCPTime::from_seconds ((p.x - _down_point.x) / pps); - if (_snap) { + shared_ptr film = _film.lock (); + DCPOMATIC_ASSERT (film); - DCPTime const new_end = new_position + _down_view->content()->length_after_trim(); + if (_snap) { + DCPTime const new_end = new_position + _down_view->content()->length_after_trim(film); /* Signed `distance' to nearest thing (i.e. negative is left on the timeline, positive is right). */ @@ -755,10 +763,8 @@ Timeline::set_position_from_event (wxMouseEvent& ev) new_position = DCPTime (); } - _down_view->content()->set_position (new_position); + _down_view->content()->set_position (film, new_position); - shared_ptr film = _film.lock (); - DCPOMATIC_ASSERT (film); film->set_sequence (false); }