4 #include "mwindowgui.h"
6 #include "plugindialog.h"
7 #include "pluginpopup.h"
12 PluginPopup::PluginPopup(MWindow *mwindow, MWindowGUI *gui)
19 this->mwindow = mwindow;
23 PluginPopup::~PluginPopup()
27 void PluginPopup::create_objects()
29 add_item(change = new PluginPopupChange(mwindow, this));
30 add_item(detach = new PluginPopupDetach(mwindow, this));
31 // add_item(in = new PluginPopupIn(mwindow, this));
32 // add_item(out = new PluginPopupOut(mwindow, this));
33 add_item(show = new PluginPopupShow(mwindow, this));
34 add_item(on = new PluginPopupOn(mwindow, this));
35 add_item(new PluginPopupUp(mwindow, this));
36 add_item(new PluginPopupDown(mwindow, this));
39 int PluginPopup::update(Plugin *plugin)
41 //printf("PluginPopup::update %p\n", plugin);
42 on->set_checked(plugin->on);
43 // in->set_checked(plugin->in);
44 // out->set_checked(plugin->out);
45 show->set_checked(plugin->show);
46 this->plugin = plugin;
58 PluginPopupChange::PluginPopupChange(MWindow *mwindow, PluginPopup
60 : BC_MenuItem(_("Change..."))
62 this->mwindow = mwindow;
64 dialog_thread = new PluginDialogThread(mwindow);
67 PluginPopupChange::~PluginPopupChange()
72 int PluginPopupChange::handle_event()
74 dialog_thread->start_window(popup->plugin->track,
76 PROGRAM_NAME ": Change Effect");
86 PluginPopupDetach::PluginPopupDetach(MWindow *mwindow, PluginPopup *popup)
87 : BC_MenuItem(_("Detach"))
89 this->mwindow = mwindow;
93 PluginPopupDetach::~PluginPopupDetach()
97 int PluginPopupDetach::handle_event()
99 mwindow->hide_plugin(popup->plugin, 1);
100 popup->plugin->track->detach_effect(popup->plugin);
101 mwindow->save_backup();
102 mwindow->undo->update_undo(_("detach effect"), LOAD_ALL);
103 mwindow->gui->update(0,
110 mwindow->restart_brender();
111 mwindow->sync_parameters(CHANGE_EDL);
121 PluginPopupIn::PluginPopupIn(MWindow *mwindow, PluginPopup *popup)
122 : BC_MenuItem(_("Send"))
124 this->mwindow = mwindow;
128 PluginPopupIn::~PluginPopupIn()
132 int PluginPopupIn::handle_event()
134 popup->plugin->in = !get_checked();
135 mwindow->sync_parameters(CHANGE_EDL);
143 PluginPopupOut::PluginPopupOut(MWindow *mwindow, PluginPopup *popup)
144 : BC_MenuItem(_("Receive"))
146 this->mwindow = mwindow;
150 PluginPopupOut::~PluginPopupOut()
154 int PluginPopupOut::handle_event()
156 popup->plugin->out = !get_checked();
157 mwindow->sync_parameters(CHANGE_EDL);
165 PluginPopupShow::PluginPopupShow(MWindow *mwindow, PluginPopup *popup)
166 : BC_MenuItem(_("Show"))
168 this->mwindow = mwindow;
172 PluginPopupShow::~PluginPopupShow()
176 int PluginPopupShow::handle_event()
178 mwindow->show_plugin(popup->plugin);
185 PluginPopupOn::PluginPopupOn(MWindow *mwindow, PluginPopup *popup)
186 : BC_MenuItem(_("On"))
188 this->mwindow = mwindow;
192 PluginPopupOn::~PluginPopupOn()
196 int PluginPopupOn::handle_event()
198 popup->plugin->on = !get_checked();
199 mwindow->gui->update(0, 1, 0, 0, 0, 0, 0);
200 mwindow->restart_brender();
201 mwindow->sync_parameters(CHANGE_EDL);
206 PluginPopupUp::PluginPopupUp(MWindow *mwindow, PluginPopup *popup)
207 : BC_MenuItem(_("Move up"))
209 this->mwindow = mwindow;
213 int PluginPopupUp::handle_event()
215 mwindow->move_plugins_up(popup->plugin->plugin_set);
221 PluginPopupDown::PluginPopupDown(MWindow *mwindow, PluginPopup *popup)
222 : BC_MenuItem(_("Move down"))
224 this->mwindow = mwindow;
228 int PluginPopupDown::handle_event()
230 mwindow->move_plugins_down(popup->plugin->plugin_set);