mask mousewheel segv bug, mask opengl sw fallback read to ram, fix tiff config withou...
[goodguy/cinelerra.git] / cinelerra-5.1 / cinelerra / pluginset.C
index cdc4a7848d1bd7faa778d3bf6274521afc253ea2..e1f1215e9f6beba10f7bd85ac7f7aa6062296269 100644 (file)
@@ -343,6 +343,19 @@ void PluginSet::shift_effects(int64_t start, int64_t length, int edit_autos)
        }
 }
 
+void PluginSet::paste_silence(int64_t start, int64_t end, int edit_autos)
+{
+       Plugin *new_plugin = (Plugin *) insert_new_edit(start);
+       int64_t length = end - start;
+       new_plugin->length = length;
+       while( (new_plugin=(Plugin *)new_plugin->next) != 0 ) {
+               new_plugin->startproject += length;
+               if( !edit_autos ) continue;
+               new_plugin->keyframes->default_auto->position += length;
+               new_plugin->keyframes->paste_silence(start, end);
+       }
+}
+
 void PluginSet::copy(int64_t start, int64_t end, FileXML *file)
 {
        file->tag.set_title("PLUGINSET");
@@ -429,6 +442,13 @@ int PluginSet::optimize()
        int result = 1;
        Plugin *current_edit;
 
+// trim plugins before position 0
+       while( first && first->startproject+first->length < 0 )
+               delete first;
+       if( first && first->startproject < 0 ) {
+               first->length += first->startproject;
+               first->startproject = 0;
+       }
 
 // Delete keyframes out of range
        for(current_edit = (Plugin*)first;