No-op; variable renaming.
[dcpomatic.git] / src / wx / timeline.cc
index 9c70a001e0bc2709ebfea53cfe91fa02568056a6..8c8692aa1acca5c8fc7f6a43d5abdffd0bac19bd 100644 (file)
@@ -64,12 +64,12 @@ Timeline::Timeline (wxWindow* parent, ContentPanel* cp, shared_ptr<Film> film)
        Bind (wxEVT_MOTION,     boost::bind (&Timeline::mouse_moved, this, _1));
        Bind (wxEVT_SIZE,       boost::bind (&Timeline::resized,     this));
 
-       playlist_changed ();
+       film_changed (Film::CONTENT);
 
        SetMinSize (wxSize (640, tracks() * track_height() + 96));
 
-       _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));
+       _film_changed_connection = film->Changed.connect (bind (&Timeline::film_changed, this, _1));
+       _film_content_changed_connection = film->ContentChanged.connect (bind (&Timeline::film_content_changed, this, _2));
 }
 
 void
@@ -90,24 +90,26 @@ Timeline::paint ()
 }
 
 void
-Timeline::playlist_changed ()
+Timeline::film_changed (Film::Property p)
 {
-       ensure_ui_thread ();
-       recreate_views ();
+       if (p == Film::CONTENT) {
+               ensure_ui_thread ();
+               recreate_views ();
+       }
 }
 
 void
 Timeline::recreate_views ()
 {
-       shared_ptr<const Film> fl = _film.lock ();
-       if (!fl) {
+       shared_ptr<const Film> film = _film.lock ();
+       if (!film) {
                return;
        }
 
        _views.clear ();
        _views.push_back (_time_axis_view);
 
-       ContentList content = fl->playlist()->content ();
+       ContentList content = film->content ();
 
        for (ContentList::iterator i = content.begin(); i != content.end(); ++i) {
                if (dynamic_pointer_cast<VideoContent> (*i)) {
@@ -115,7 +117,7 @@ Timeline::recreate_views ()
                }
 
                shared_ptr<AudioContent> ac = dynamic_pointer_cast<AudioContent> (*i);
-               if (ac && !ac->audio_mapping().mapped_dcp_channels().empty ()) {
+               if (ac && !ac->audio_mapping().mapped_output_channels().empty ()) {
                        _views.push_back (shared_ptr<TimelineView> (new TimelineAudioContentView (*this, *i)));
                }
 
@@ -131,7 +133,7 @@ Timeline::recreate_views ()
 }
 
 void
-Timeline::playlist_content_changed (int property)
+Timeline::film_content_changed (int property)
 {
        ensure_ui_thread ();
 
@@ -142,7 +144,7 @@ Timeline::playlist_content_changed (int property)
                        setup_pixels_per_second ();
                }
                Refresh ();
-       } else if (property == AudioContentProperty::AUDIO_MAPPING) {
+       } else if (property == AudioContentProperty::AUDIO_STREAMS) {
                recreate_views ();
        }
 }
@@ -363,7 +365,7 @@ Timeline::set_position_from_event (wxMouseEvent& ev)
        
        if (_snap) {
 
-               DCPTime const new_end = new_position + _down_view->content()->length_after_trim () - 1;
+               DCPTime const new_end = new_position + _down_view->content()->length_after_trim () - DCPTime (1);
                /* Signed `distance' to nearest thing (i.e. negative is left on the timeline,
                   positive is right).
                */
@@ -377,9 +379,9 @@ Timeline::set_position_from_event (wxMouseEvent& ev)
                        }
 
                        maybe_snap (cv->content()->position(), new_position, nearest_distance);
-                       maybe_snap (cv->content()->position(), new_end + 1, nearest_distance);
-                       maybe_snap (cv->content()->end() + 1, new_position, nearest_distance);
-                       maybe_snap (cv->content()->end() + 1, new_end, nearest_distance);
+                       maybe_snap (cv->content()->position(), new_end + DCPTime (1), nearest_distance);
+                       maybe_snap (cv->content()->end() + DCPTime (1), new_position, nearest_distance);
+                       maybe_snap (cv->content()->end() + DCPTime (1), new_end, nearest_distance);
                }
                
                if (nearest_distance) {