X-Git-Url: https://git.cinelerra-gg.org/git/?p=goodguy%2Fcinelerra.git;a=blobdiff_plain;f=cinelerra-5.1%2Fcinelerra%2Fplugin.C;h=5890808b5617010cb93fff45858fb0e2765fcd86;hp=25023190bab85b6eb8dfcbb6e08a7189cc60e6a0;hb=fb661e853152fd63537629a20f493a4cdcd4f019;hpb=7fd85fb66168f6b518c5f2d73e04036e87faa0e1 diff --git a/cinelerra-5.1/cinelerra/plugin.C b/cinelerra-5.1/cinelerra/plugin.C index 25023190..5890808b 100644 --- a/cinelerra-5.1/cinelerra/plugin.C +++ b/cinelerra-5.1/cinelerra/plugin.C @@ -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)