: BC_DialogThread()
{
this->mwindow = mwindow;
- this->plugin = 0;
+ this->plugin_id = -1;
this->plugin_type = PLUGIN_NONE;
}
// mwindow->gui->lock_window("PluginDialogThread::start_window");
this->track = track;
this->data_type = data_type;
- this->plugin = plugin;
this->is_mainmenu = is_mainmenu;
single_standalone = mwindow->edl->session->single_standalone;
plugin->calculate_title(plugin_title, 0);
this->shared_location = plugin->shared_location;
this->plugin_type = plugin->plugin_type;
+ this->plugin_id = plugin->orig_id;
}
else
{
this->shared_location.plugin = -1;
this->shared_location.module = -1;
this->plugin_type = PLUGIN_NONE;
+ this->plugin_id = -1;
}
strcpy(this->window_title, title);
selected_available = -1;
selected_shared = -1;
selected_modules = -1;
- thread->plugin = 0;
+ thread->plugin_id = -1;
thread->plugin_type = PLUGIN_NONE;
}
void PluginDialogThread::apply()
{
- if( mwindow->edl )
- mwindow->edl->session->single_standalone = single_standalone;
+ Plugin *plugin = 0;
+ EDL *edl = mwindow->edl;
+ if( edl )
+ edl->session->single_standalone = single_standalone;
if(plugin_type) {
mwindow->gui->lock_window("PluginDialogThread::run 3");
mwindow->undo->update_undo_before();
mwindow->insert_effect(plugin_title, &shared_location,
data_type, plugin_type, single_standalone);
}
- else {
- if( plugin ) {
- if( mwindow->edl->tracks->plugin_exists(plugin) ) {
- plugin->change_plugin(plugin_title,
- &shared_location, plugin_type);
- }
- }
- else {
- if( mwindow->edl->tracks->track_exists(track) ) {
- mwindow->insert_effect(plugin_title, &shared_location,
- track, 0, 0, 0, plugin_type);
- }
+ else if( (plugin=edl->tracks->plugin_exists(plugin_id)) != 0 ) {
+ plugin->change_plugin(plugin_title,
+ &shared_location, plugin_type);
+ }
+ else if( edl->tracks->track_exists(track) ) {
+ double start = edl->local_session->get_selectionstart(1);
+ double end = edl->local_session->get_selectionend(1);
+ if( start >= end ) {
+ start = 0;
+ end = track->get_length();
}
+ double length = end - start;
+ mwindow->insert_effect(plugin_title, &shared_location,
+ track, 0, start, length, plugin_type);
}
mwindow->save_backup();
mwindow->gui->update(1, NORMAL_DRAW, 0, 0, 1, 0, 0);
mwindow->gui->unlock_window();
}
- plugin = 0;
+ plugin_id = -1;
}
PluginDialogApply::PluginDialogApply(PluginDialog *dialog, int x, int y)