}
-PluginSet& PluginSet::operator=(PluginSet& plugins)
-{
-printf("PluginSet::operator= 1\n");
- copy_from(&plugins);
- return *this;
-}
-
void PluginSet::copy_from(PluginSet *src)
{
while(last) delete last;
Plugin *new_plugin;
append(new_plugin = (Plugin*)create_edit());
new_plugin->copy_from(current);
+// update gui_id when copying edl
+ new_plugin->gui_id = current->gui_id;
}
this->record = src->record;
}
KeyFrame *PluginSet::nearest_keyframe(int64_t pos, int dir)
{
+ if( first && pos < first->startproject )
+ pos = first->startproject;
+ else if( last && pos > last->startproject+last->length )
+ pos = last->startproject+last->length;
+ KeyFrame *keyframe = 0;
Plugin *plugin = (Plugin*)editof(pos, dir, 0);
- if( !plugin ) return 0;
- KeyFrame *keyframe = (KeyFrame *)(dir == PLAY_FORWARD ?
- plugin->keyframes->nearest_after(pos) :
- plugin->keyframes->nearest_before(pos));
+ if( dir == PLAY_FORWARD ) {
+ for( ; !keyframe && plugin; plugin=(Plugin*)plugin->next ) {
+ if( plugin->plugin_type == PLUGIN_NONE ) continue;
+ keyframe = (KeyFrame *)plugin->keyframes->nearest_after(pos);
+ }
+ }
+ else {
+ for( ; !keyframe && plugin; plugin=(Plugin*)plugin->previous ) {
+ if( plugin->plugin_type == PLUGIN_NONE ) continue;
+ keyframe = (KeyFrame *)plugin->keyframes->nearest_before(pos);
+ }
+ }
return keyframe;
}