add haupauge-1657 dual usb capture support, add deinterlace to recordmonitor, asset...
[goodguy/cinelerra.git] / cinelerra-5.1 / cinelerra / tracksedit.C
index 9cc095bff2de024210a239742aff9ab23cbb936d..7f46fcb228d10ed4a7c50d3ae9de87d12fd5fbaf 100644 (file)
@@ -120,6 +120,33 @@ void Tracks::clear_transitions(double start, double end)
        }
 }
 
+int Tracks::clear_hard_edges(double start, double end)
+{
+       for( Track *track=first; track; track=track->next ) {
+               if( !track->record ) continue;
+               int64_t start_units = track->to_units(start, 0);
+               int64_t end_units = track->to_units(end, 0);
+
+               for( Edit *edit=track->edits->first; edit; edit=edit->next ) {
+                       int64_t pos = edit->startproject;
+                       if( pos > end_units ) break;
+                       if( pos >= start_units ) {
+                               edit->hard_left = 0;
+                               if( edit->previous )
+                                       edit->previous->hard_right = 0;
+                       }
+                       pos += edit->length;
+                       if( pos > end_units ) break;
+                       if( pos >= start_units ) {
+                               edit->hard_right = 0;
+                               if( edit->next )
+                                       edit->next->hard_left = 0;
+                       }
+               }
+       }
+       return 0;
+}
+
 void Tracks::shuffle_edits(double start, double end)
 {
 // This doesn't affect automation or effects
@@ -155,19 +182,17 @@ void Tracks::reverse_edits(double start, double end)
                }
        }
 }
+
 void Tracks::align_edits(double start, double end)
 {
 // This doesn't affect automation or effects
-       ArrayList<double> times;
-
-       for(Track *current_track = first;
-               current_track;
-               current_track = current_track->next)
-       {
-               if(current_track->record)
-               {
-                       current_track->align_edits(start, end, &times);
-               }
+       Track *master_track = 0;
+       for( Track *track=first; track; track=track->next ) {
+               if( !track->record ) continue;
+               if( !master_track )
+                       master_track = track;
+               else
+                       track->align_edits(start, end, master_track);
        }
 }