Main Page | Class Hierarchy | Alphabetical List | Class List | Directories | File List | Class Members | File Members

pluginpopup.C

Go to the documentation of this file.
00001 #include "language.h"
00002 #include "mainundo.h"
00003 #include "mwindow.h"
00004 #include "mwindowgui.h"
00005 #include "plugin.h"
00006 #include "plugindialog.h"
00007 #include "pluginpopup.h"
00008 #include "track.h"
00009 
00010 
00011 
00012 PluginPopup::PluginPopup(MWindow *mwindow, MWindowGUI *gui)
00013  : BC_PopupMenu(0, 
00014                 0, 
00015                 0, 
00016                 "", 
00017                 0)
00018 {
00019         this->mwindow = mwindow;
00020         this->gui = gui;
00021 }
00022 
00023 PluginPopup::~PluginPopup()
00024 {
00025 }
00026 
00027 void PluginPopup::create_objects()
00028 {
00029         add_item(change = new PluginPopupChange(mwindow, this));
00030         add_item(detach = new PluginPopupDetach(mwindow, this));
00031 //      add_item(in = new PluginPopupIn(mwindow, this));
00032 //      add_item(out = new PluginPopupOut(mwindow, this));
00033         add_item(show = new PluginPopupShow(mwindow, this));
00034         add_item(on = new PluginPopupOn(mwindow, this));
00035         add_item(new PluginPopupUp(mwindow, this));
00036         add_item(new PluginPopupDown(mwindow, this));
00037 }
00038 
00039 int PluginPopup::update(Plugin *plugin)
00040 {
00041 //printf("PluginPopup::update %p\n", plugin);
00042         on->set_checked(plugin->on);
00043 //      in->set_checked(plugin->in);
00044 //      out->set_checked(plugin->out);
00045         show->set_checked(plugin->show);
00046         this->plugin = plugin;
00047         return 0;
00048 }
00049 
00050 
00051 
00052 
00053 
00054 
00055 
00056 
00057 
00058 PluginPopupChange::PluginPopupChange(MWindow *mwindow, PluginPopup
00059 *popup)
00060  : BC_MenuItem(_("Change..."))
00061 {
00062         this->mwindow = mwindow;
00063         this->popup = popup;
00064         dialog_thread = new PluginDialogThread(mwindow);
00065 }
00066 
00067 PluginPopupChange::~PluginPopupChange()
00068 {
00069         delete dialog_thread;
00070 }
00071 
00072 int PluginPopupChange::handle_event()
00073 {
00074         dialog_thread->start_window(popup->plugin->track,
00075                 popup->plugin,
00076                 PROGRAM_NAME ": Change Effect");
00077 }
00078 
00079 
00080 
00081 
00082 
00083 
00084 
00085 
00086 PluginPopupDetach::PluginPopupDetach(MWindow *mwindow, PluginPopup *popup)
00087  : BC_MenuItem(_("Detach"))
00088 {
00089         this->mwindow = mwindow;
00090         this->popup = popup;
00091 }
00092 
00093 PluginPopupDetach::~PluginPopupDetach()
00094 {
00095 }
00096 
00097 int PluginPopupDetach::handle_event()
00098 {
00099         mwindow->hide_plugin(popup->plugin, 1);
00100         popup->plugin->track->detach_effect(popup->plugin);
00101         mwindow->save_backup();
00102         mwindow->undo->update_undo(_("detach effect"), LOAD_ALL);
00103         mwindow->gui->update(0,
00104                 1,
00105                 0,
00106                 0,
00107                 0, 
00108                 0,
00109                 0);
00110         mwindow->restart_brender();
00111         mwindow->sync_parameters(CHANGE_EDL);
00112         return 1;
00113 }
00114 
00115 
00116 
00117 
00118 
00119 
00120 
00121 PluginPopupIn::PluginPopupIn(MWindow *mwindow, PluginPopup *popup)
00122  : BC_MenuItem(_("Send"))
00123 {
00124         this->mwindow = mwindow;
00125         this->popup = popup;
00126 }
00127 
00128 PluginPopupIn::~PluginPopupIn()
00129 {
00130 }
00131 
00132 int PluginPopupIn::handle_event()
00133 {
00134         popup->plugin->in = !get_checked();
00135         mwindow->sync_parameters(CHANGE_EDL);
00136         return 1;
00137 }
00138 
00139 
00140 
00141 
00142 
00143 PluginPopupOut::PluginPopupOut(MWindow *mwindow, PluginPopup *popup)
00144  : BC_MenuItem(_("Receive"))
00145 {
00146         this->mwindow = mwindow;
00147         this->popup = popup;
00148 }
00149 
00150 PluginPopupOut::~PluginPopupOut()
00151 {
00152 }
00153 
00154 int PluginPopupOut::handle_event()
00155 {
00156         popup->plugin->out = !get_checked();
00157         mwindow->sync_parameters(CHANGE_EDL);
00158         return 1;
00159 }
00160 
00161 
00162 
00163 
00164 
00165 PluginPopupShow::PluginPopupShow(MWindow *mwindow, PluginPopup *popup)
00166  : BC_MenuItem(_("Show"))
00167 {
00168         this->mwindow = mwindow;
00169         this->popup = popup;
00170 }
00171 
00172 PluginPopupShow::~PluginPopupShow()
00173 {
00174 }
00175 
00176 int PluginPopupShow::handle_event()
00177 {
00178         mwindow->show_plugin(popup->plugin);
00179         return 1;
00180 }
00181 
00182 
00183 
00184 
00185 PluginPopupOn::PluginPopupOn(MWindow *mwindow, PluginPopup *popup)
00186  : BC_MenuItem(_("On"))
00187 {
00188         this->mwindow = mwindow;
00189         this->popup = popup;
00190 }
00191 
00192 PluginPopupOn::~PluginPopupOn()
00193 {
00194 }
00195 
00196 int PluginPopupOn::handle_event()
00197 {
00198         popup->plugin->on = !get_checked();
00199         mwindow->restart_brender();
00200         mwindow->sync_parameters(CHANGE_EDL);
00201         return 1;
00202 }
00203 
00204 
00205 PluginPopupUp::PluginPopupUp(MWindow *mwindow, PluginPopup *popup)
00206  : BC_MenuItem(_("Move up"))
00207 {
00208         this->mwindow = mwindow;
00209         this->popup = popup;
00210 }
00211 
00212 int PluginPopupUp::handle_event()
00213 {
00214         mwindow->move_plugins_up(popup->plugin->plugin_set);
00215         return 1;
00216 }
00217 
00218 
00219 
00220 PluginPopupDown::PluginPopupDown(MWindow *mwindow, PluginPopup *popup)
00221  : BC_MenuItem(_("Move down"))
00222 {
00223         this->mwindow = mwindow;
00224         this->popup = popup;
00225 }
00226 
00227 int PluginPopupDown::handle_event()
00228 {
00229         mwindow->move_plugins_down(popup->plugin->plugin_set);
00230         return 1;
00231 }
00232 

Generated on Sun Jan 8 13:38:58 2006 for Cinelerra-svn by  doxygen 1.4.4