Handle multiple audio streams in a single piece of content
[dcpomatic.git] / src / wx / timeline.cc
index 9c70a001e0bc2709ebfea53cfe91fa02568056a6..c1713bb61262e2bcc27047a60eadb2b9186baf47 100644 (file)
@@ -142,7 +142,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 +363,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 +377,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) {