mask mousewheel segv bug, mask opengl sw fallback read to ram, fix tiff config withou...
[goodguy/cinelerra.git] / cinelerra-5.1 / cinelerra / plugin.C
index 25023190bab85b6eb8dfcbb6e08a7189cc60e6a0..5890808b5617010cb93fff45858fb0e2765fcd86 100644 (file)
@@ -100,10 +100,7 @@ int Plugin::operator==(Edit& that)
 
 int Plugin::silence()
 {
-       if(plugin_type != PLUGIN_NONE)
-               return 0;
-       else
-               return 1;
+       return plugin_type == PLUGIN_NONE ? 1 : 0;
 }
 
 void Plugin::clear_keyframes(int64_t start, int64_t end)
@@ -112,7 +109,21 @@ void Plugin::clear_keyframes(int64_t start, int64_t end)
 }
 
 
-void Plugin::copy_from(Edit *edit)
+void Plugin::init(const char *title,
+       int64_t unit_position, int64_t unit_length, int plugin_type,
+       SharedLocation *shared_location, KeyFrame *default_keyframe)
+{
+       if( title ) strcpy(this->title, title);
+       if( shared_location ) this->shared_location = *shared_location;
+       this->plugin_type = plugin_type;
+       if( default_keyframe )
+               *this->keyframes->default_auto = *default_keyframe;
+       this->keyframes->default_auto->position = unit_position;
+       this->startproject = unit_position;
+       this->length = unit_length;
+}
+
+void Plugin::copy_base(Edit *edit)
 {
        Plugin *plugin = (Plugin*)edit;
 
@@ -129,8 +140,12 @@ void Plugin::copy_from(Edit *edit)
 // Should reconfigure this based on where the first track is now.
        this->shared_location = plugin->shared_location;
        strcpy(this->title, plugin->title);
+}
 
-       copy_keyframes(plugin);
+void Plugin::copy_from(Edit *edit)
+{
+       copy_base(edit);
+       copy_keyframes((Plugin*)edit);
 }
 
 void Plugin::copy_keyframes(Plugin *plugin)