X-Git-Url: https://git.cinelerra-gg.org/git/?a=blobdiff_plain;f=cinelerra-5.1%2Fplugins%2Fswapchannels%2Fswapchannels.C;h=3fc831fbe1a739f6007ab380ea961041bd847d50;hb=9182a6f3c48a4d211b7e3527e08511bd531011c4;hp=cf169d26c99049b48f1dce1fa3b3a67fb6a53ae2;hpb=7fd85fb66168f6b518c5f2d73e04036e87faa0e1;p=goodguy%2Fcinelerra.git diff --git a/cinelerra-5.1/plugins/swapchannels/swapchannels.C b/cinelerra-5.1/plugins/swapchannels/swapchannels.C index cf169d26..3fc831fb 100644 --- a/cinelerra-5.1/plugins/swapchannels/swapchannels.C +++ b/cinelerra-5.1/plugins/swapchannels/swapchannels.C @@ -47,11 +47,16 @@ REGISTER_PLUGIN(SwapMain) SwapConfig::SwapConfig() +{ + reset_Config(); +} + +void SwapConfig::reset_Config() { red = RED_SRC; green = GREEN_SRC; blue = BLUE_SRC; - alpha = ALPHA_SRC; + alpha = ALPHA_SRC; } @@ -80,10 +85,10 @@ void SwapConfig::copy_from(SwapConfig &that) SwapWindow::SwapWindow(SwapMain *plugin) : PluginClientWindow(plugin, - 250, - 170, - 250, - 170, + xS(250), + yS(200), + xS(250), + yS(200), 0) { this->plugin = plugin; @@ -96,27 +101,32 @@ SwapWindow::~SwapWindow() void SwapWindow::create_objects() { - int x = 10, y = 10; - int margin = 30; + int xs10 = xS(10), xs30 = xS(30), xs160 = xS(160); + int ys5 = yS(5), ys10 = yS(10), ys40 = yS(40); + int x = xs10, y = ys10; + int margin = xs30; add_subwindow(new BC_Title(x, y, _("Swap channels"))); y += margin; - add_subwindow(new BC_Title(x + 160, y + 5, _("-> Red"))); + add_subwindow(new BC_Title(x + xs160, y + ys5, _("-> Red"))); add_subwindow(red = new SwapMenu(plugin, &(plugin->config.red), x, y)); red->create_objects(); y += margin; - add_subwindow(new BC_Title(x + 160, y + 5, _("-> Green"))); + add_subwindow(new BC_Title(x + xs160, y + ys5, _("-> Green"))); add_subwindow(green = new SwapMenu(plugin, &(plugin->config.green), x, y)); green->create_objects(); y += margin; - add_subwindow(new BC_Title(x + 160, y + 5, _("-> Blue"))); + add_subwindow(new BC_Title(x + xs160, y + ys5, _("-> Blue"))); add_subwindow(blue = new SwapMenu(plugin, &(plugin->config.blue), x, y)); blue->create_objects(); y += margin; - add_subwindow(new BC_Title(x + 160, y + 5, _("-> Alpha"))); + add_subwindow(new BC_Title(x + xs160, y + ys5, _("-> Alpha"))); add_subwindow(alpha = new SwapMenu(plugin, &(plugin->config.alpha), x, y)); alpha->create_objects(); + y += ys40; + add_subwindow(reset = new SwapReset(plugin, this, x, y)); + show_window(); flush(); } @@ -128,9 +138,8 @@ void SwapWindow::create_objects() - SwapMenu::SwapMenu(SwapMain *client, int *output, int x, int y) - : BC_PopupMenu(x, y, 150, client->output_to_text(*output)) + : BC_PopupMenu(x, y, xS(150), client->output_to_text(*output)) { this->client = client; this->output = output; @@ -171,7 +180,22 @@ int SwapItem::handle_event() - +SwapReset::SwapReset(SwapMain *plugin, SwapWindow *gui, int x, int y) + : BC_GenericButton(x, y, _("Reset")) +{ + this->plugin = plugin; + this->gui = gui; +} +SwapReset::~SwapReset() +{ +} +int SwapReset::handle_event() +{ + plugin->config.reset_Config(); + plugin->send_configure_change(); + plugin->update_gui(); + return 1; +}