X-Git-Url: https://git.cinelerra-gg.org/git/?a=blobdiff_plain;f=cinelerra-5.1%2Fplugins%2Fswapframes%2Fswapframes.C;h=6e37f7a06429ab7e53da524ccc3fcd4443c13423;hb=2e28d225c343f02500594688bf8d0528df40600c;hp=60a8a98c000314b286e2a972c5dbf6f7b3a58acc;hpb=7fd85fb66168f6b518c5f2d73e04036e87faa0e1;p=goodguy%2Fcinelerra.git diff --git a/cinelerra-5.1/plugins/swapframes/swapframes.C b/cinelerra-5.1/plugins/swapframes/swapframes.C index 60a8a98c..6e37f7a0 100644 --- a/cinelerra-5.1/plugins/swapframes/swapframes.C +++ b/cinelerra-5.1/plugins/swapframes/swapframes.C @@ -45,6 +45,11 @@ REGISTER_PLUGIN(SwapFrames) SwapFramesConfig::SwapFramesConfig() +{ + reset(); +} + +void SwapFramesConfig::reset() { on = 1; swap_even = 1; @@ -155,12 +160,34 @@ int SwapFramesOdd::handle_event() + +SwapFramesReset::SwapFramesReset(SwapFrames *plugin, SwapFramesWindow *gui, int x, int y) + : BC_GenericButton(x, y, _("Reset")) +{ + this->plugin = plugin; + this->gui = gui; +} +SwapFramesReset::~SwapFramesReset() +{ +} +int SwapFramesReset::handle_event() +{ + plugin->config.reset(); + gui->update(); + plugin->send_configure_change(); + return 1; +} + + + + + SwapFramesWindow::SwapFramesWindow(SwapFrames *plugin) : PluginClientWindow(plugin, 260, - 130, + 135, 260, - 130, + 135, 0) { this->plugin = plugin; @@ -183,10 +210,20 @@ void SwapFramesWindow::create_objects() this, x, y)); + + y += 35; + add_subwindow(reset = new SwapFramesReset(plugin, this, x, y)); + show_window(); } - +// for Reset button +void SwapFramesWindow::update() +{ + on->update(plugin->config.swap_even); + swap_even->update(plugin->config.swap_even); + swap_odd->update(!plugin->config.swap_even); +}