X-Git-Url: https://main.carlh.net/gitweb/?a=blobdiff_plain;f=src%2Fwx%2Ftimeline.cc;h=359de9bf9f1b93d65e64e2045487ad120f6d6071;hb=92933c13e9233149e4e80244d92da81b70072214;hp=3294676fc2f8daaf8d5e0b9ce0704f326b1917c0;hpb=9b946fc5250eff5a5dd4a661896916fcd5d9bd4b;p=dcpomatic.git diff --git a/src/wx/timeline.cc b/src/wx/timeline.cc index 3294676fc..359de9bf9 100644 --- a/src/wx/timeline.cc +++ b/src/wx/timeline.cc @@ -112,7 +112,7 @@ Timeline::Timeline (wxWindow* parent, ContentPanel* cp, shared_ptr film, w _main_canvas->Bind (wxEVT_SCROLLWIN_PAGEDOWN, boost::bind (&Timeline::scrolled, this, _1)); _main_canvas->Bind (wxEVT_SCROLLWIN_THUMBTRACK, boost::bind (&Timeline::scrolled, this, _1)); - film_change (CHANGE_TYPE_DONE, Film::CONTENT); + film_change (ChangeType::DONE, Film::Property::CONTENT); SetMinSize (wxSize (640, 4 * pixels_per_track() + 96)); @@ -182,7 +182,7 @@ Timeline::paint_main () list> overlaps; for (auto j: _views) { auto jc = dynamic_pointer_cast (j); - /* No overlap with non-content views, views no different tracks, audio views or non-active views */ + /* No overlap with non-content views, views on different tracks, audio views or non-active views */ if (!ic || !jc || i == j || ic->track() != jc->track() || ic->track().get_value_or(2) >= 2 || !ic->active() || !jc->active()) { continue; } @@ -227,14 +227,14 @@ Timeline::paint_main () void Timeline::film_change (ChangeType type, Film::Property p) { - if (type != CHANGE_TYPE_DONE) { + if (type != ChangeType::DONE) { return; } - if (p == Film::CONTENT || p == Film::REEL_TYPE || p == Film::REEL_LENGTH) { + if (p == Film::Property::CONTENT || p == Film::Property::REEL_TYPE || p == Film::Property::REEL_LENGTH) { ensure_ui_thread (); recreate_views (); - } else if (p == Film::CONTENT_ORDER) { + } else if (p == Film::Property::CONTENT_ORDER) { Refresh (); } } @@ -277,7 +277,7 @@ Timeline::recreate_views () void Timeline::film_content_change (ChangeType type, int property, bool frequent) { - if (type != CHANGE_TYPE_DONE) { + if (type != ChangeType::DONE) { return; } @@ -370,8 +370,9 @@ void Timeline::assign_tracks () { /* Tracks are: - Video (mono or left-eye) - Video (right-eye) + Video 1 + Video 2 + Video N Text 1 Text 2 Text N @@ -393,29 +394,7 @@ Timeline::assign_tracks () } } - /* Video */ - - bool have_3d = false; - for (auto i: _views) { - auto cv = dynamic_pointer_cast(i); - if (!cv) { - continue; - } - - /* Video on tracks 0 and maybe 1 (left and right eye) */ - if (cv->content()->video->frame_type() == VIDEO_FRAME_TYPE_3D_RIGHT) { - cv->set_track (1); - _tracks = max (_tracks, 2); - have_3d = true; - } else { - cv->set_track (0); - } - } - - _tracks = max (_tracks, 1); - - /* Texts */ - + int const video_tracks = place (film, _views, _tracks); int const text_tracks = place (film, _views, _tracks); /* Atmos */ @@ -441,7 +420,7 @@ Timeline::assign_tracks () sort(views.begin(), views.end(), AudioMappingComparator()); int const audio_tracks = place (film, views, _tracks); - _labels_view->set_3d (have_3d); + _labels_view->set_video_tracks (video_tracks); _labels_view->set_audio_tracks (audio_tracks); _labels_view->set_text_tracks (text_tracks); _labels_view->set_atmos (have_atmos); @@ -625,6 +604,8 @@ Timeline::left_up_zoom (wxMouseEvent& ev) if ((bottom_right.x - top_left.x) < 8 || (bottom_right.y - top_left.y) < 8) { /* Very small zoom rectangle: we assume it wasn't intentional */ + _zoom_point = optional (); + Refresh (); return; }