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)
}
-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;
// 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)