3 #include "mwindowgui.h"
5 #include "plugindialog.h"
6 #include "pluginpopup.h"
10 #define _(String) gettext(String)
11 #define gettext_noop(String) String
12 #define N_(String) gettext_noop (String)
15 PluginPopup::PluginPopup(MWindow *mwindow, MWindowGUI *gui)
22 this->mwindow = mwindow;
26 PluginPopup::~PluginPopup()
30 void PluginPopup::create_objects()
32 add_item(attach = new PluginPopupAttach(mwindow, this));
33 add_item(detach = new PluginPopupDetach(mwindow, this));
34 // add_item(in = new PluginPopupIn(mwindow, this));
35 // add_item(out = new PluginPopupOut(mwindow, this));
36 add_item(show = new PluginPopupShow(mwindow, this));
37 add_item(on = new PluginPopupOn(mwindow, this));
38 add_item(new PluginPopupUp(mwindow, this));
39 add_item(new PluginPopupDown(mwindow, this));
42 int PluginPopup::update(Plugin *plugin)
44 //printf("PluginPopup::update %p\n", plugin);
45 on->set_checked(plugin->on);
46 // in->set_checked(plugin->in);
47 // out->set_checked(plugin->out);
48 show->set_checked(plugin->show);
49 this->plugin = plugin;
61 PluginPopupAttach::PluginPopupAttach(MWindow *mwindow, PluginPopup *popup)
62 : BC_MenuItem(_("Attach..."))
64 this->mwindow = mwindow;
66 dialog_thread = new PluginDialogThread(mwindow);
69 PluginPopupAttach::~PluginPopupAttach()
74 int PluginPopupAttach::handle_event()
76 dialog_thread->start_window(popup->plugin->track,
78 PROGRAM_NAME ": Attach Effect");
87 PluginPopupDetach::PluginPopupDetach(MWindow *mwindow, PluginPopup *popup)
88 : BC_MenuItem(_("Detach"))
90 this->mwindow = mwindow;
94 PluginPopupDetach::~PluginPopupDetach()
98 int PluginPopupDetach::handle_event()
100 mwindow->hide_plugin(popup->plugin, 1);
101 mwindow->undo->update_undo_before(_("detach effect"), LOAD_ALL);
102 popup->plugin->track->detach_effect(popup->plugin);
103 mwindow->save_backup();
104 mwindow->undo->update_undo_after();
105 mwindow->gui->update(0,
112 mwindow->restart_brender();
113 mwindow->sync_parameters(CHANGE_EDL);
123 PluginPopupIn::PluginPopupIn(MWindow *mwindow, PluginPopup *popup)
124 : BC_MenuItem(_("Send"))
126 this->mwindow = mwindow;
130 PluginPopupIn::~PluginPopupIn()
134 int PluginPopupIn::handle_event()
136 popup->plugin->in = !get_checked();
137 mwindow->sync_parameters(CHANGE_EDL);
145 PluginPopupOut::PluginPopupOut(MWindow *mwindow, PluginPopup *popup)
146 : BC_MenuItem(_("Receive"))
148 this->mwindow = mwindow;
152 PluginPopupOut::~PluginPopupOut()
156 int PluginPopupOut::handle_event()
158 popup->plugin->out = !get_checked();
159 mwindow->sync_parameters(CHANGE_EDL);
167 PluginPopupShow::PluginPopupShow(MWindow *mwindow, PluginPopup *popup)
168 : BC_MenuItem(_("Show"))
170 this->mwindow = mwindow;
174 PluginPopupShow::~PluginPopupShow()
178 int PluginPopupShow::handle_event()
180 mwindow->show_plugin(popup->plugin);
187 PluginPopupOn::PluginPopupOn(MWindow *mwindow, PluginPopup *popup)
188 : BC_MenuItem(_("On"))
190 this->mwindow = mwindow;
194 PluginPopupOn::~PluginPopupOn()
198 int PluginPopupOn::handle_event()
200 popup->plugin->on = !get_checked();
201 mwindow->restart_brender();
202 mwindow->sync_parameters(CHANGE_EDL);
207 PluginPopupUp::PluginPopupUp(MWindow *mwindow, PluginPopup *popup)
208 : BC_MenuItem(_("Move up"))
210 this->mwindow = mwindow;
214 int PluginPopupUp::handle_event()
216 mwindow->move_plugins_up(popup->plugin->plugin_set);
222 PluginPopupDown::PluginPopupDown(MWindow *mwindow, PluginPopup *popup)
223 : BC_MenuItem(_("Move down"))
225 this->mwindow = mwindow;
229 int PluginPopupDown::handle_event()
231 mwindow->move_plugins_down(popup->plugin->plugin_set);