_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));
list<dcpomatic::Rect<int>> overlaps;
for (auto j: _views) {
auto jc = dynamic_pointer_cast<TimelineContentView> (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;
}
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 ();
}
}
void
Timeline::film_content_change (ChangeType type, int property, bool frequent)
{
- if (type != CHANGE_TYPE_DONE) {
+ if (type != ChangeType::DONE) {
return;
}
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
}
}
- /* Video */
-
- bool have_3d = false;
- for (auto i: _views) {
- auto cv = dynamic_pointer_cast<TimelineVideoContentView>(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<TimelineVideoContentView> (film, _views, _tracks);
int const text_tracks = place<TimelineTextContentView> (film, _views, _tracks);
/* Atmos */
sort(views.begin(), views.end(), AudioMappingComparator());
int const audio_tracks = place<TimelineAudioContentView> (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);
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<wxPoint> ();
+ Refresh ();
return;
}