X-Git-Url: https://git.cinelerra-gg.org/git/?p=goodguy%2Fcinelerra.git;a=blobdiff_plain;f=cinelerra-5.1%2Fplugins%2Fpolar%2Fpolar.C;h=cfae601ada8b49e07e51c9f5994f2e94b87e10fb;hp=08933b59bf7c052ac5e8a4171c3eb2de5556eef9;hb=a64e7d16c44bba0d137936227fc55871bb26c903;hpb=7fd85fb66168f6b518c5f2d73e04036e87faa0e1 diff --git a/cinelerra-5.1/plugins/polar/polar.C b/cinelerra-5.1/plugins/polar/polar.C index 08933b59..cfae601a 100644 --- a/cinelerra-5.1/plugins/polar/polar.C +++ b/cinelerra-5.1/plugins/polar/polar.C @@ -42,6 +42,7 @@ class PolarEffect; class PolarEngine; class PolarWindow; +class PolarReset; class PolarConfig @@ -49,6 +50,7 @@ class PolarConfig public: PolarConfig(); + void reset(); void copy_from(PolarConfig &src); int equivalent(PolarConfig &src); void interpolate(PolarConfig &prev, @@ -82,14 +84,26 @@ public: PolarEffect *plugin; }; +class PolarReset : public BC_GenericButton +{ +public: + PolarReset(PolarEffect *plugin, PolarWindow *window, int x, int y); + ~PolarReset(); + int handle_event(); + PolarEffect *plugin; + PolarWindow *window; +}; + class PolarWindow : public PluginClientWindow { public: PolarWindow(PolarEffect *plugin); void create_objects(); + void update(); PolarEffect *plugin; PolarDepth *depth; PolarAngle *angle; + PolarReset *reset; }; @@ -148,14 +162,18 @@ REGISTER_PLUGIN(PolarEffect) PolarConfig::PolarConfig() { - angle = 0.0; - depth = 0.0; + reset(); +} + +void PolarConfig::reset() +{ + angle = 1.0; // 0.0; + depth = 1.0; // 0.0; backwards = 0; invert = 0; polar_to_rectangular = 1; } - void PolarConfig::copy_from(PolarConfig &src) { this->angle = src.angle; @@ -191,9 +209,9 @@ void PolarConfig::interpolate(PolarConfig &prev, PolarWindow::PolarWindow(PolarEffect *plugin) : PluginClientWindow(plugin, 270, - 100, + 122, 270, - 100, + 122, 0) { this->plugin = plugin; @@ -207,12 +225,19 @@ void PolarWindow::create_objects() y += 40; add_subwindow(new BC_Title(x, y, _("Angle:"))); add_subwindow(angle = new PolarAngle(plugin, x + 50, y)); + y += 40; + add_subwindow(reset = new PolarReset(plugin, this, x, y)); show_window(); flush(); } - +// for Reset button +void PolarWindow::update() +{ + depth->update(plugin->config.depth); + angle->update(plugin->config.angle); +} @@ -262,6 +287,24 @@ int PolarAngle::handle_event() +PolarReset::PolarReset(PolarEffect *plugin, PolarWindow *window, int x, int y) + : BC_GenericButton(x, y, _("Reset")) +{ + this->plugin = plugin; + this->window = window; +} +PolarReset::~PolarReset() +{ +} +int PolarReset::handle_event() +{ + plugin->config.reset(); + window->update(); + plugin->send_configure_change(); + return 1; +} + + PolarEffect::PolarEffect(PluginServer *server)