labels follow edits fix, group only ungrouped edits, add reset to 7 plugins, add...
authorGood Guy <good1.2guy@gmail.com>
Sun, 13 Jan 2019 00:36:24 +0000 (17:36 -0700)
committerGood Guy <good1.2guy@gmail.com>
Sun, 13 Jan 2019 00:36:24 +0000 (17:36 -0700)
19 files changed:
cinelerra-5.1/cinelerra/mwindowedit.C
cinelerra-5.1/cinelerra/tipwindow.C
cinelerra-5.1/cinelerra/tracks.C
cinelerra-5.1/ffmpeg/video/h264-10bit.mp4 [new file with mode: 0644]
cinelerra-5.1/plugins/blur/blur.C
cinelerra-5.1/plugins/blur/blur.h
cinelerra-5.1/plugins/blur/blurwindow.C
cinelerra-5.1/plugins/blur/blurwindow.h
cinelerra-5.1/plugins/linearblur/linearblur.C
cinelerra-5.1/plugins/linearblur/linearblur.h [new file with mode: 0644]
cinelerra-5.1/plugins/polar/polar.C
cinelerra-5.1/plugins/radialblur/radialblur.C
cinelerra-5.1/plugins/radialblur/radialblur.h [new file with mode: 0644]
cinelerra-5.1/plugins/wave/wave.C
cinelerra-5.1/plugins/wave/wave.h [new file with mode: 0644]
cinelerra-5.1/plugins/whirl/whirl.C
cinelerra-5.1/plugins/zoomblur/zoomblur.C
cinelerra-5.1/plugins/zoomblur/zoomblur.h [new file with mode: 0644]
cinelerra-5.1/thirdparty/Makefile

index 67f4402..787ca44 100644 (file)
@@ -1880,18 +1880,16 @@ int MWindow::paste_edls(ArrayList<EDL*> *new_edls, int load_mode,
                if( load_mode != LOADMODE_RESOURCESONLY &&
                    load_mode != LOADMODE_ASSETSONLY ) {
 // Insert labels
+                       if( edl->session->labels_follow_edits ) {
 //printf("MWindow::paste_edls %f %f\n", current_position, edl_length);
-                       if( load_mode == LOADMODE_PASTE ||
-                           load_mode == LOADMODE_NESTED )
-                               edl->labels->insert_labels(new_edl->labels,
-                                       destination_tracks.total ? paste_position[0] : 0.0,
-                                       edl_length,
-                                       edit_labels);
-                       else
-                               edl->labels->insert_labels(new_edl->labels,
-                                       current_position,
-                                       edl_length,
-                                       edit_labels);
+                               if( load_mode == LOADMODE_PASTE || load_mode == LOADMODE_NESTED )
+                                       edl->labels->insert_labels(new_edl->labels,
+                                               destination_tracks.total ? paste_position[0] : 0.0,
+                                               edl_length, edit_labels);
+                               else
+                                       edl->labels->insert_labels(new_edl->labels, current_position,
+                                               edl_length, edit_labels);
+                       }
 //PRINT_TRACE
                        double total_length = new_edl->tracks->total_length();
                        for( Track *new_track=new_edl->tracks->first;
index 5ad9092..e367964 100644 (file)
@@ -127,7 +127,7 @@ void TipWindowGUI::create_objects()
 {
        lock_window("TipWindowGUI::create_objects");
        int x = 10, y = 10;
-       add_subwindow(tip_text = new BC_Title(x, y, thread->get_current_tip(0)));
+       add_subwindow(tip_text = new BC_Title(x, y, thread->get_current_tip(1)));
        y = get_h() - 30;
        BC_CheckBox *checkbox;
        add_subwindow(checkbox = new TipDisable(mwindow, this, x, y));
index b0305ed..4873fac 100644 (file)
@@ -660,6 +660,7 @@ int Tracks::new_group(int id)
        for( Track *track=first; track; track=track->next ) {
                if( !track->record ) continue;
                for( Edit *edit=track->edits->first; edit; edit=edit->next ) {
+                       if( edit->group_id > 0 ) continue;
                        if( !edit->is_selected ) continue;
                        edit->group_id = id;
                        ++count;
diff --git a/cinelerra-5.1/ffmpeg/video/h264-10bit.mp4 b/cinelerra-5.1/ffmpeg/video/h264-10bit.mp4
new file mode 100644 (file)
index 0000000..8f7e701
--- /dev/null
@@ -0,0 +1,6 @@
+mp4 libx264
+cin_pix_fmt=yuv420p10le
+# use framerate for 1 keyframe/sec, needed for seeks
+keyint_min=25
+profile=high10
+x264opts keyint=25
index bb9e6db..bc40439 100644 (file)
 
 
 BlurConfig::BlurConfig()
+{
+       reset();
+}
+
+void BlurConfig::reset()
 {
        vertical = 1;
        horizontal = 1;
index 6846ca0..b85e2bb 100644 (file)
@@ -47,6 +47,7 @@ class BlurConfig
 {
 public:
        BlurConfig();
+       void reset();
 
        int equivalent(BlurConfig &that);
        void copy_from(BlurConfig &that);
index 342d115..b8c4b5d 100644 (file)
@@ -32,9 +32,9 @@
 BlurWindow::BlurWindow(BlurMain *client)
  : PluginClientWindow(client,
        200,
-       330,
+       360,
        200,
-       330,
+       360,
        0)
 {
        this->client = client;
@@ -70,11 +70,28 @@ void BlurWindow::create_objects()
        add_subwindow(g = new BlurG(client, x, y));
        y += 30;
        add_subwindow(b = new BlurB(client, x, y));
+       y += 40;
+       add_subwindow(reset = new BlurReset(client, this, x, y));
 
        show_window();
        flush();
 }
 
+// for Reset button
+void BlurWindow::update()
+{
+       horizontal->update(client->config.horizontal);
+       vertical->update(client->config.vertical);
+       radius->update(client->config.radius);
+       radius_text->update((int64_t)client->config.radius);
+       a_key->update(client->config.a_key);
+       a->update(client->config.a);
+       r->update(client->config.r);
+       g->update(client->config.g);
+       b->update(client->config.b);
+}
+
+
 BlurRadius::BlurRadius(BlurMain *client, BlurWindow *gui, int x, int y)
  : BC_IPot(x,
        y,
@@ -225,4 +242,19 @@ int BlurB::handle_event()
        return 1;
 }
 
-
+BlurReset::BlurReset(BlurMain *client, BlurWindow *window, int x, int y)
+ : BC_GenericButton(x, y, _("Reset"))
+{
+       this->client = client;
+       this->window = window;
+}
+BlurReset::~BlurReset()
+{
+}
+int BlurReset::handle_event()
+{
+       client->config.reset();
+       window->update();
+       client->send_configure_change();
+       return 1;
+}
index 03dc14d..d5d900c 100644 (file)
@@ -42,6 +42,7 @@ class BlurR;
 class BlurG;
 class BlurB;
 class BlurAKey;
+class BlurReset;
 
 class BlurWindow : public PluginClientWindow
 {
@@ -50,6 +51,7 @@ public:
        ~BlurWindow();
 
        void create_objects();
+       void update();
 
        BlurMain *client;
        BlurVertical *vertical;
@@ -61,6 +63,7 @@ public:
        BlurG *g;
        BlurB *b;
        BlurAKey *a_key;
+       BlurReset *reset;
 };
 
 class BlurAKey : public BC_CheckBox
@@ -142,5 +145,15 @@ public:
        BlurWindow *window;
 };
 
+class BlurReset : public BC_GenericButton
+{
+public:
+       BlurReset(BlurMain *client, BlurWindow *window, int x, int y);
+       ~BlurReset();
+       int handle_event();
+       BlurMain *client;
+       BlurWindow *window;
+};
+
 
 #endif
index af6cb82..e389b08 100644 (file)
@@ -19,6 +19,7 @@
  *
  */
 
+
 #include <math.h>
 #include <stdint.h>
 #include <string.h>
@@ -27,6 +28,7 @@
 #include "clip.h"
 #include "bchash.h"
 #include "filexml.h"
+#include "linearblur.h"
 #include "keyframe.h"
 #include "language.h"
 #include "loadbalance.h"
 
 
 
-class LinearBlurMain;
-class LinearBlurEngine;
-
-
-
-
-
-class LinearBlurConfig
-{
-public:
-       LinearBlurConfig();
-
-       int equivalent(LinearBlurConfig &that);
-       void copy_from(LinearBlurConfig &that);
-       void interpolate(LinearBlurConfig &prev,
-               LinearBlurConfig &next,
-               long prev_frame,
-               long next_frame,
-               long current_frame);
-
-       int radius;
-       int steps;
-       int angle;
-       int r;
-       int g;
-       int b;
-       int a;
-};
-
-
-
-class LinearBlurSize : public BC_ISlider
-{
-public:
-       LinearBlurSize(LinearBlurMain *plugin,
-               int x,
-               int y,
-               int *output,
-               int min,
-               int max);
-       int handle_event();
-       LinearBlurMain *plugin;
-       int *output;
-};
-
-class LinearBlurToggle : public BC_CheckBox
-{
-public:
-       LinearBlurToggle(LinearBlurMain *plugin,
-               int x,
-               int y,
-               int *output,
-               char *string);
-       int handle_event();
-       LinearBlurMain *plugin;
-       int *output;
-};
-
-class LinearBlurWindow : public PluginClientWindow
-{
-public:
-       LinearBlurWindow(LinearBlurMain *plugin);
-       ~LinearBlurWindow();
-
-       void create_objects();
-
-       LinearBlurSize *angle, *steps, *radius;
-       LinearBlurToggle *r, *g, *b, *a;
-       LinearBlurMain *plugin;
-};
-
-
-
 
 
-// Output coords for a layer of blurring
-// Used for OpenGL only
-class LinearBlurLayer
-{
-public:
-       LinearBlurLayer() {};
-       int x, y;
-};
-
-class LinearBlurMain : public PluginVClient
-{
-public:
-       LinearBlurMain(PluginServer *server);
-       ~LinearBlurMain();
-
-       int process_buffer(VFrame *frame,
-               int64_t start_position,
-               double frame_rate);
-       int is_realtime();
-       void save_data(KeyFrame *keyframe);
-       void read_data(KeyFrame *keyframe);
-       void update_gui();
-       int handle_opengl();
 
-       PLUGIN_CLASS_MEMBERS(LinearBlurConfig)
+REGISTER_PLUGIN(LinearBlurMain)
 
-       void delete_tables();
-       VFrame *input, *output, *temp;
-       LinearBlurEngine *engine;
-       int **scale_y_table;
-       int **scale_x_table;
-       LinearBlurLayer *layer_table;
-       int table_entries;
-       int need_reconfigure;
-// The accumulation buffer is needed because 8 bits isn't precise enough
-       unsigned char *accum;
-};
 
-class LinearBlurPackage : public LoadPackage
-{
-public:
-       LinearBlurPackage();
-       int y1, y2;
-};
 
-class LinearBlurUnit : public LoadClient
-{
-public:
-       LinearBlurUnit(LinearBlurEngine *server, LinearBlurMain *plugin);
-       void process_package(LoadPackage *package);
-       LinearBlurEngine *server;
-       LinearBlurMain *plugin;
-};
 
-class LinearBlurEngine : public LoadServer
+LinearBlurConfig::LinearBlurConfig()
 {
-public:
-       LinearBlurEngine(LinearBlurMain *plugin,
-               int total_clients,
-               int total_packages);
-       void init_packages();
-       LoadClient* new_client();
-       LoadPackage* new_package();
-       LinearBlurMain *plugin;
-};
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-REGISTER_PLUGIN(LinearBlurMain)
-
-
+       reset();
+}
 
-LinearBlurConfig::LinearBlurConfig()
+void LinearBlurConfig::reset()
 {
        radius = 10;
        angle = 0;
@@ -263,9 +115,9 @@ void LinearBlurConfig::interpolate(LinearBlurConfig &prev,
 LinearBlurWindow::LinearBlurWindow(LinearBlurMain *plugin)
  : PluginClientWindow(plugin,
        230,
-       290,
+       320,
        230,
-       290,
+       320,
        0)
 {
        this->plugin = plugin;
@@ -298,13 +150,26 @@ void LinearBlurWindow::create_objects()
        add_subwindow(b = new LinearBlurToggle(plugin, x, y, &plugin->config.b, _("Blue")));
        y += 30;
        add_subwindow(a = new LinearBlurToggle(plugin, x, y, &plugin->config.a, _("Alpha")));
-       y += 30;
+       y += 40;
+       add_subwindow(reset = new LinearBlurReset(plugin, this, x, y));
 
        show_window();
        flush();
 }
 
 
+// for Reset button
+void LinearBlurWindow::update()
+{
+       radius->update(plugin->config.radius);
+       angle->update(plugin->config.angle);
+       steps->update(plugin->config.steps);
+       r->update(plugin->config.r);
+       g->update(plugin->config.g);
+       b->update(plugin->config.b);
+       a->update(plugin->config.a);
+}
+
 
 
 
@@ -357,6 +222,22 @@ int LinearBlurSize::handle_event()
 }
 
 
+LinearBlurReset::LinearBlurReset(LinearBlurMain *plugin, LinearBlurWindow *gui, int x, int y)
+ : BC_GenericButton(x, y, _("Reset"))
+{
+       this->plugin = plugin;
+       this->gui = gui;
+}
+LinearBlurReset::~LinearBlurReset()
+{
+}
+int LinearBlurReset::handle_event()
+{
+       plugin->config.reset();
+       gui->update();
+       plugin->send_configure_change();
+       return 1;
+}
 
 
 
diff --git a/cinelerra-5.1/plugins/linearblur/linearblur.h b/cinelerra-5.1/plugins/linearblur/linearblur.h
new file mode 100644 (file)
index 0000000..b0dfc7e
--- /dev/null
@@ -0,0 +1,197 @@
+
+/*
+ * CINELERRA
+ * Copyright (C) 2008 Adam Williams <broadcast at earthling dot net>
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+ *
+ */
+
+#ifndef LINEARBLUR_H
+#define LINEARBLUR_H
+
+
+#include <math.h>
+#include <stdint.h>
+#include <string.h>
+
+#include "bcdisplayinfo.h"
+#include "clip.h"
+#include "bchash.h"
+#include "filexml.h"
+#include "keyframe.h"
+#include "language.h"
+#include "loadbalance.h"
+#include "pluginvclient.h"
+#include "vframe.h"
+
+
+
+class LinearBlurMain;
+class LinearBlurWindow;
+class LinearBlurEngine;
+class LinearBlurReset;
+
+
+
+
+class LinearBlurConfig
+{
+public:
+       LinearBlurConfig();
+
+       void reset();
+       int equivalent(LinearBlurConfig &that);
+       void copy_from(LinearBlurConfig &that);
+       void interpolate(LinearBlurConfig &prev,
+               LinearBlurConfig &next,
+               long prev_frame,
+               long next_frame,
+               long current_frame);
+
+       int radius;
+       int steps;
+       int angle;
+       int r;
+       int g;
+       int b;
+       int a;
+};
+
+
+
+class LinearBlurSize : public BC_ISlider
+{
+public:
+       LinearBlurSize(LinearBlurMain *plugin,
+               int x,
+               int y,
+               int *output,
+               int min,
+               int max);
+       int handle_event();
+       LinearBlurMain *plugin;
+       int *output;
+};
+
+class LinearBlurToggle : public BC_CheckBox
+{
+public:
+       LinearBlurToggle(LinearBlurMain *plugin,
+               int x,
+               int y,
+               int *output,
+               char *string);
+       int handle_event();
+       LinearBlurMain *plugin;
+       int *output;
+};
+
+class LinearBlurReset : public BC_GenericButton
+{
+public:
+       LinearBlurReset(LinearBlurMain *plugin, LinearBlurWindow *gui, int x, int y);
+       ~LinearBlurReset();
+       int handle_event();
+       LinearBlurMain *plugin;
+       LinearBlurWindow *gui;
+};
+
+class LinearBlurWindow : public PluginClientWindow
+{
+public:
+       LinearBlurWindow(LinearBlurMain *plugin);
+       ~LinearBlurWindow();
+
+       void create_objects();
+       void update();
+
+       LinearBlurSize *angle, *steps, *radius;
+       LinearBlurToggle *r, *g, *b, *a;
+       LinearBlurMain *plugin;
+       LinearBlurReset *reset;
+};
+
+
+
+
+
+// Output coords for a layer of blurring
+// Used for OpenGL only
+class LinearBlurLayer
+{
+public:
+       LinearBlurLayer() {};
+       int x, y;
+};
+
+class LinearBlurMain : public PluginVClient
+{
+public:
+       LinearBlurMain(PluginServer *server);
+       ~LinearBlurMain();
+
+       int process_buffer(VFrame *frame,
+               int64_t start_position,
+               double frame_rate);
+       int is_realtime();
+       void save_data(KeyFrame *keyframe);
+       void read_data(KeyFrame *keyframe);
+       void update_gui();
+       int handle_opengl();
+
+       PLUGIN_CLASS_MEMBERS(LinearBlurConfig)
+
+       void delete_tables();
+       VFrame *input, *output, *temp;
+       LinearBlurEngine *engine;
+       int **scale_y_table;
+       int **scale_x_table;
+       LinearBlurLayer *layer_table;
+       int table_entries;
+       int need_reconfigure;
+// The accumulation buffer is needed because 8 bits isn't precise enough
+       unsigned char *accum;
+};
+
+class LinearBlurPackage : public LoadPackage
+{
+public:
+       LinearBlurPackage();
+       int y1, y2;
+};
+
+class LinearBlurUnit : public LoadClient
+{
+public:
+       LinearBlurUnit(LinearBlurEngine *server, LinearBlurMain *plugin);
+       void process_package(LoadPackage *package);
+       LinearBlurEngine *server;
+       LinearBlurMain *plugin;
+};
+
+class LinearBlurEngine : public LoadServer
+{
+public:
+       LinearBlurEngine(LinearBlurMain *plugin,
+               int total_clients,
+               int total_packages);
+       void init_packages();
+       LoadClient* new_client();
+       LoadPackage* new_package();
+       LinearBlurMain *plugin;
+};
+
+#endif
index 08933b5..cfae601 100644 (file)
@@ -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)
index 1847a20..035ab0a 100644 (file)
  *
  */
 
-#include <math.h>
-#include <stdint.h>
-#include <string.h>
-
-
-#include "affine.h"
-#include "bcdisplayinfo.h"
-#include "clip.h"
-#include "bchash.h"
-#include "filexml.h"
-#include "keyframe.h"
-#include "language.h"
-#include "loadbalance.h"
-#include "pluginvclient.h"
-#include "vframe.h"
-
-
-class RadialBlurMain;
-class RadialBlurEngine;
-
-
-
-
-
-class RadialBlurConfig
-{
-public:
-       RadialBlurConfig();
-
-       int equivalent(RadialBlurConfig &that);
-       void copy_from(RadialBlurConfig &that);
-       void interpolate(RadialBlurConfig &prev,
-               RadialBlurConfig &next,
-               long prev_frame,
-               long next_frame,
-               long current_frame);
-
-       int x;
-       int y;
-       int steps;
-       int angle;
-       int r;
-       int g;
-       int b;
-       int a;
-};
-
-
-
-class RadialBlurSize : public BC_ISlider
-{
-public:
-       RadialBlurSize(RadialBlurMain *plugin,
-               int x,
-               int y,
-               int *output,
-               int min,
-               int max);
-       int handle_event();
-       RadialBlurMain *plugin;
-       int *output;
-};
-
-class RadialBlurToggle : public BC_CheckBox
-{
-public:
-       RadialBlurToggle(RadialBlurMain *plugin,
-               int x,
-               int y,
-               int *output,
-               char *string);
-       int handle_event();
-       RadialBlurMain *plugin;
-       int *output;
-};
-
-class RadialBlurWindow : public PluginClientWindow
-{
-public:
-       RadialBlurWindow(RadialBlurMain *plugin);
-       ~RadialBlurWindow();
-
-       void create_objects();
-
-
-       RadialBlurSize *x, *y, *steps, *angle;
-       RadialBlurToggle *r, *g, *b, *a;
-       RadialBlurMain *plugin;
-};
 
+#include "radialblur.h"
 
 
 
+REGISTER_PLUGIN(RadialBlurMain)
 
 
-class RadialBlurMain : public PluginVClient
-{
-public:
-       RadialBlurMain(PluginServer *server);
-       ~RadialBlurMain();
-
-       int process_buffer(VFrame *frame,
-               int64_t start_position,
-               double frame_rate);
-       int is_realtime();
-       void save_data(KeyFrame *keyframe);
-       void read_data(KeyFrame *keyframe);
-       void update_gui();
-       int handle_opengl();
-
-       PLUGIN_CLASS_MEMBERS(RadialBlurConfig)
-
-       VFrame *input, *output, *temp;
-       RadialBlurEngine *engine;
-// Rotate engine only used for OpenGL
-       AffineEngine *rotate;
-};
-
-class RadialBlurPackage : public LoadPackage
-{
-public:
-       RadialBlurPackage();
-       int y1, y2;
-};
 
-class RadialBlurUnit : public LoadClient
-{
-public:
-       RadialBlurUnit(RadialBlurEngine *server, RadialBlurMain *plugin);
-       void process_package(LoadPackage *package);
-       RadialBlurEngine *server;
-       RadialBlurMain *plugin;
-};
-
-class RadialBlurEngine : public LoadServer
+RadialBlurConfig::RadialBlurConfig()
 {
-public:
-       RadialBlurEngine(RadialBlurMain *plugin,
-               int total_clients,
-               int total_packages);
-       void init_packages();
-       LoadClient* new_client();
-       LoadPackage* new_package();
-       RadialBlurMain *plugin;
-};
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-REGISTER_PLUGIN(RadialBlurMain)
-
+       reset();
+}
 
 
-RadialBlurConfig::RadialBlurConfig()
+void RadialBlurConfig::reset()
 {
        x = 50;
        y = 50;
@@ -257,9 +104,9 @@ void RadialBlurConfig::interpolate(RadialBlurConfig &prev,
 RadialBlurWindow::RadialBlurWindow(RadialBlurMain *plugin)
  : PluginClientWindow(plugin,
        230,
-       340,
+       370,
        230,
-       340,
+       370,
        0)
 {
        this->plugin = plugin;
@@ -296,13 +143,25 @@ void RadialBlurWindow::create_objects()
        add_subwindow(b = new RadialBlurToggle(plugin, x, y, &plugin->config.b, _("Blue")));
        y += 30;
        add_subwindow(a = new RadialBlurToggle(plugin, x, y, &plugin->config.a, _("Alpha")));
-       y += 30;
+       y += 40;
+       add_subwindow(reset = new RadialBlurReset(plugin, this, x, y));
 
        show_window();
        flush();
 }
 
-
+// for Reset button
+void RadialBlurWindow::update()
+{
+       this->x->update(plugin->config.x);
+       this->y->update(plugin->config.y);
+       angle->update(plugin->config.angle);
+       steps->update(plugin->config.steps);
+       r->update(plugin->config.r);
+       g->update(plugin->config.g);
+       b->update(plugin->config.b);
+       a->update(plugin->config.a);
+}
 
 
 
@@ -360,6 +219,26 @@ int RadialBlurSize::handle_event()
 
 
 
+RadialBlurReset::RadialBlurReset(RadialBlurMain *plugin, RadialBlurWindow *gui, int x, int y)
+ : BC_GenericButton(x, y, _("Reset"))
+{
+       this->plugin = plugin;
+       this->gui = gui;
+}
+RadialBlurReset::~RadialBlurReset()
+{
+}
+int RadialBlurReset::handle_event()
+{
+       plugin->config.reset();
+       gui->update();
+       plugin->send_configure_change();
+       return 1;
+}
+
+
+
+
 
 
 
diff --git a/cinelerra-5.1/plugins/radialblur/radialblur.h b/cinelerra-5.1/plugins/radialblur/radialblur.h
new file mode 100644 (file)
index 0000000..d16facf
--- /dev/null
@@ -0,0 +1,185 @@
+
+/*
+ * CINELERRA
+ * Copyright (C) 2008 Adam Williams <broadcast at earthling dot net>
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+ *
+ */
+
+#ifndef RADIALBLUR_H
+#define RADIALBLUR_H
+
+
+#include <math.h>
+#include <stdint.h>
+#include <string.h>
+
+
+#include "affine.h"
+#include "bcdisplayinfo.h"
+#include "clip.h"
+#include "bchash.h"
+#include "filexml.h"
+#include "keyframe.h"
+#include "language.h"
+#include "loadbalance.h"
+#include "pluginvclient.h"
+#include "vframe.h"
+
+
+class RadialBlurMain;
+class RadialBlurWindow;
+class RadialBlurEngine;
+class RadialBlurReset;
+
+
+
+
+class RadialBlurConfig
+{
+public:
+       RadialBlurConfig();
+
+       void reset();
+       int equivalent(RadialBlurConfig &that);
+       void copy_from(RadialBlurConfig &that);
+       void interpolate(RadialBlurConfig &prev,
+               RadialBlurConfig &next,
+               long prev_frame,
+               long next_frame,
+               long current_frame);
+
+       int x;
+       int y;
+       int steps;
+       int angle;
+       int r;
+       int g;
+       int b;
+       int a;
+};
+
+
+
+class RadialBlurSize : public BC_ISlider
+{
+public:
+       RadialBlurSize(RadialBlurMain *plugin,
+               int x,
+               int y,
+               int *output,
+               int min,
+               int max);
+       int handle_event();
+       RadialBlurMain *plugin;
+       int *output;
+};
+
+class RadialBlurToggle : public BC_CheckBox
+{
+public:
+       RadialBlurToggle(RadialBlurMain *plugin,
+               int x,
+               int y,
+               int *output,
+               char *string);
+       int handle_event();
+       RadialBlurMain *plugin;
+       int *output;
+};
+
+class RadialBlurReset : public BC_GenericButton
+{
+public:
+       RadialBlurReset(RadialBlurMain *plugin, RadialBlurWindow *gui, int x, int y);
+       ~RadialBlurReset();
+       int handle_event();
+       RadialBlurMain *plugin;
+       RadialBlurWindow *gui;
+};
+
+class RadialBlurWindow : public PluginClientWindow
+{
+public:
+       RadialBlurWindow(RadialBlurMain *plugin);
+       ~RadialBlurWindow();
+
+       void create_objects();
+       void update();
+
+       RadialBlurSize *x, *y, *steps, *angle;
+       RadialBlurToggle *r, *g, *b, *a;
+       RadialBlurMain *plugin;
+       RadialBlurReset *reset;
+};
+
+
+
+
+
+
+class RadialBlurMain : public PluginVClient
+{
+public:
+       RadialBlurMain(PluginServer *server);
+       ~RadialBlurMain();
+
+       int process_buffer(VFrame *frame,
+               int64_t start_position,
+               double frame_rate);
+       int is_realtime();
+       void save_data(KeyFrame *keyframe);
+       void read_data(KeyFrame *keyframe);
+       void update_gui();
+       int handle_opengl();
+
+       PLUGIN_CLASS_MEMBERS(RadialBlurConfig)
+
+       VFrame *input, *output, *temp;
+       RadialBlurEngine *engine;
+// Rotate engine only used for OpenGL
+       AffineEngine *rotate;
+};
+
+class RadialBlurPackage : public LoadPackage
+{
+public:
+       RadialBlurPackage();
+       int y1, y2;
+};
+
+class RadialBlurUnit : public LoadClient
+{
+public:
+       RadialBlurUnit(RadialBlurEngine *server, RadialBlurMain *plugin);
+       void process_package(LoadPackage *package);
+       RadialBlurEngine *server;
+       RadialBlurMain *plugin;
+};
+
+class RadialBlurEngine : public LoadServer
+{
+public:
+       RadialBlurEngine(RadialBlurMain *plugin,
+               int total_clients,
+               int total_packages);
+       void init_packages();
+       LoadClient* new_client();
+       LoadPackage* new_package();
+       RadialBlurMain *plugin;
+};
+
+#endif
index 03f537f..99e6dc4 100644 (file)
  *
  */
 
-#include "bcdisplayinfo.h"
-#include "clip.h"
-#include "bchash.h"
-#include "filexml.h"
-#include "guicast.h"
-#include "keyframe.h"
-#include "language.h"
-#include "loadbalance.h"
-#include "pluginvclient.h"
-#include "vframe.h"
+#include "wave.h"
 
-#include <math.h>
-#include <stdint.h>
-#include <string.h>
 
 
 
 
-#define SMEAR 0
-#define BLACKEN 1
 
 
 
-class WaveEffect;
-class WaveWindow;
-
-
-class WaveConfig
-{
-public:
-       WaveConfig();
-       void copy_from(WaveConfig &src);
-       int equivalent(WaveConfig &src);
-       void interpolate(WaveConfig &prev,
-               WaveConfig &next,
-               long prev_frame,
-               long next_frame,
-               long current_frame);
-       int mode;
-       int reflective;
-       float amplitude;
-       float phase;
-       float wavelength;
-};
-
-class WaveSmear : public BC_Radial
-{
-public:
-       WaveSmear(WaveEffect *plugin, WaveWindow *window, int x, int y);
-       int handle_event();
-       WaveEffect *plugin;
-       WaveWindow *window;
-};
-
-class WaveBlacken : public BC_Radial
-{
-public:
-       WaveBlacken(WaveEffect *plugin, WaveWindow *window, int x, int y);
-       int handle_event();
-       WaveEffect *plugin;
-       WaveWindow *window;
-};
-
-
-class WaveReflective : public BC_CheckBox
-{
-public:
-       WaveReflective(WaveEffect *plugin, int x, int y);
-       int handle_event();
-       WaveEffect *plugin;
-};
-
-class WaveAmplitude : public BC_FSlider
-{
-public:
-       WaveAmplitude(WaveEffect *plugin, int x, int y);
-       int handle_event();
-       WaveEffect *plugin;
-};
-
-class WavePhase : public BC_FSlider
-{
-public:
-       WavePhase(WaveEffect *plugin, int x, int y);
-       int handle_event();
-       WaveEffect *plugin;
-};
-
-class WaveLength : public BC_FSlider
-{
-public:
-       WaveLength(WaveEffect *plugin, int x, int y);
-       int handle_event();
-       WaveEffect *plugin;
-};
-
-
-
-
-
-
-
-
-
-class WaveWindow : public PluginClientWindow
-{
-public:
-       WaveWindow(WaveEffect *plugin);
-       ~WaveWindow();
-       void create_objects();
-       void update_mode();
-       WaveEffect *plugin;
-//     WaveSmear *smear;
-//     WaveBlacken *blacken;
-//     WaveReflective *reflective;
-       WaveAmplitude *amplitude;
-       WavePhase *phase;
-       WaveLength *wavelength;
-};
-
-
-
-
-
-
-
-class WaveServer : public LoadServer
-{
-public:
-       WaveServer(WaveEffect *plugin, int cpus);
-       void init_packages();
-       LoadClient* new_client();
-       LoadPackage* new_package();
-       WaveEffect *plugin;
-};
-
-class WavePackage : public LoadPackage
-{
-public:
-       WavePackage();
-       int row1, row2;
-};
-
-class WaveUnit : public LoadClient
-{
-public:
-       WaveUnit(WaveEffect *plugin, WaveServer *server);
-       void process_package(LoadPackage *package);
-       WaveEffect *plugin;
-};
-
-
-
-
-
-
-
-
-
-class WaveEffect : public PluginVClient
+WaveConfig::WaveConfig()
 {
-public:
-       WaveEffect(PluginServer *server);
-       ~WaveEffect();
-
-       PLUGIN_CLASS_MEMBERS(WaveConfig)
-       int process_realtime(VFrame *input, VFrame *output);
-       int is_realtime();
-       void save_data(KeyFrame *keyframe);
-       void read_data(KeyFrame *keyframe);
-       void update_gui();
-
-       VFrame *temp_frame;
-       VFrame *input, *output;
-       WaveServer *engine;
-};
-
-
-
-
-
-
-
-
-
-
-
+       reset();
+}
 
 
-WaveConfig::WaveConfig()
+void WaveConfig::reset()
 {
        mode = SMEAR;
        reflective = 0;
@@ -367,7 +193,22 @@ int WaveLength::handle_event()
        return 1;
 }
 
-
+WaveReset::WaveReset(WaveEffect *plugin, WaveWindow *gui, int x, int y)
+ : BC_GenericButton(x, y, _("Reset"))
+{
+       this->plugin = plugin;
+       this->gui = gui;
+}
+WaveReset::~WaveReset()
+{
+}
+int WaveReset::handle_event()
+{
+       plugin->config.reset();
+       gui->update();
+       plugin->send_configure_change();
+       return 1;
+}
 
 
 
@@ -376,7 +217,7 @@ int WaveLength::handle_event()
 
 
 WaveWindow::WaveWindow(WaveEffect *plugin)
- : PluginClientWindow(plugin, 335, 150, 335, 150, 0)
+ : PluginClientWindow(plugin, 335, 140, 335, 140, 0)
 {
        this->plugin = plugin;
 }
@@ -404,6 +245,8 @@ void WaveWindow::create_objects()
        y += 30;
        add_subwindow(new BC_Title(x, y, _("Wavelength:")));
        add_subwindow(wavelength = new WaveLength(plugin, x1, y));
+       y += 40;
+       add_subwindow(reset = new WaveReset(plugin, this, x, y));
 
        show_window();
        flush();
@@ -415,6 +258,16 @@ void WaveWindow::update_mode()
 //     blacken->update(plugin->config.mode == BLACKEN);
 }
 
+// for Reset button
+void WaveWindow::update()
+{
+       amplitude->update(plugin->config.amplitude);
+       phase->update(plugin->config.phase);
+       wavelength->update(plugin->config.wavelength);
+}
+
+
+
 
 
 
diff --git a/cinelerra-5.1/plugins/wave/wave.h b/cinelerra-5.1/plugins/wave/wave.h
new file mode 100644 (file)
index 0000000..99d11d3
--- /dev/null
@@ -0,0 +1,217 @@
+
+/*
+ * CINELERRA
+ * Copyright (C) 2008 Adam Williams <broadcast at earthling dot net>
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+ *
+ */
+
+#ifndef WAVE_H
+#define WAVE_H
+
+
+#include "bcdisplayinfo.h"
+#include "clip.h"
+#include "bchash.h"
+#include "filexml.h"
+#include "guicast.h"
+#include "keyframe.h"
+#include "language.h"
+#include "loadbalance.h"
+#include "pluginvclient.h"
+#include "vframe.h"
+
+#include <math.h>
+#include <stdint.h>
+#include <string.h>
+
+
+
+
+#define SMEAR 0
+#define BLACKEN 1
+
+
+
+class WaveEffect;
+class WaveWindow;
+class WaveReset;
+
+class WaveConfig
+{
+public:
+       WaveConfig();
+
+       void reset();
+       void copy_from(WaveConfig &src);
+       int equivalent(WaveConfig &src);
+       void interpolate(WaveConfig &prev,
+               WaveConfig &next,
+               long prev_frame,
+               long next_frame,
+               long current_frame);
+       int mode;
+       int reflective;
+       float amplitude;
+       float phase;
+       float wavelength;
+};
+
+class WaveSmear : public BC_Radial
+{
+public:
+       WaveSmear(WaveEffect *plugin, WaveWindow *window, int x, int y);
+       int handle_event();
+       WaveEffect *plugin;
+       WaveWindow *window;
+};
+
+class WaveBlacken : public BC_Radial
+{
+public:
+       WaveBlacken(WaveEffect *plugin, WaveWindow *window, int x, int y);
+       int handle_event();
+       WaveEffect *plugin;
+       WaveWindow *window;
+};
+
+
+class WaveReflective : public BC_CheckBox
+{
+public:
+       WaveReflective(WaveEffect *plugin, int x, int y);
+       int handle_event();
+       WaveEffect *plugin;
+};
+
+class WaveAmplitude : public BC_FSlider
+{
+public:
+       WaveAmplitude(WaveEffect *plugin, int x, int y);
+       int handle_event();
+       WaveEffect *plugin;
+};
+
+class WavePhase : public BC_FSlider
+{
+public:
+       WavePhase(WaveEffect *plugin, int x, int y);
+       int handle_event();
+       WaveEffect *plugin;
+};
+
+class WaveLength : public BC_FSlider
+{
+public:
+       WaveLength(WaveEffect *plugin, int x, int y);
+       int handle_event();
+       WaveEffect *plugin;
+};
+
+class WaveReset : public BC_GenericButton
+{
+public:
+       WaveReset(WaveEffect *plugin, WaveWindow *gui, int x, int y);
+       ~WaveReset();
+       int handle_event();
+       WaveEffect *plugin;
+       WaveWindow *gui;
+};
+
+
+
+
+
+
+
+class WaveWindow : public PluginClientWindow
+{
+public:
+       WaveWindow(WaveEffect *plugin);
+       ~WaveWindow();
+       void create_objects();
+       void update_mode();
+       void update();
+
+       WaveEffect *plugin;
+//     WaveSmear *smear;
+//     WaveBlacken *blacken;
+//     WaveReflective *reflective;
+       WaveAmplitude *amplitude;
+       WavePhase *phase;
+       WaveLength *wavelength;
+       WaveReset *reset;
+};
+
+
+
+
+
+
+
+class WaveServer : public LoadServer
+{
+public:
+       WaveServer(WaveEffect *plugin, int cpus);
+       void init_packages();
+       LoadClient* new_client();
+       LoadPackage* new_package();
+       WaveEffect *plugin;
+};
+
+class WavePackage : public LoadPackage
+{
+public:
+       WavePackage();
+       int row1, row2;
+};
+
+class WaveUnit : public LoadClient
+{
+public:
+       WaveUnit(WaveEffect *plugin, WaveServer *server);
+       void process_package(LoadPackage *package);
+       WaveEffect *plugin;
+};
+
+
+
+
+
+
+
+
+
+class WaveEffect : public PluginVClient
+{
+public:
+       WaveEffect(PluginServer *server);
+       ~WaveEffect();
+
+       PLUGIN_CLASS_MEMBERS(WaveConfig)
+       int process_realtime(VFrame *input, VFrame *output);
+       int is_realtime();
+       void save_data(KeyFrame *keyframe);
+       void read_data(KeyFrame *keyframe);
+       void update_gui();
+
+       VFrame *temp_frame;
+       VFrame *input, *output;
+       WaveServer *engine;
+};
+
+#endif
+
index af514fe..01d5ee0 100644 (file)
@@ -38,6 +38,7 @@
 class WhirlEffect;
 class WhirlWindow;
 class WhirlEngine;
+class WhirlReset;
 
 #define MAXRADIUS 100
 #define MAXPINCH 100
@@ -51,6 +52,7 @@ class WhirlConfig
 {
 public:
        WhirlConfig();
+       void reset();
 
        void copy_from(WhirlConfig &src);
        int equivalent(WhirlConfig &src);
@@ -94,15 +96,29 @@ public:
        WhirlEffect *plugin;
 };
 
+
+class WhirlReset : public BC_GenericButton
+{
+public:
+       WhirlReset(WhirlEffect *plugin, WhirlWindow *window, int x, int y);
+       ~WhirlReset();
+       int handle_event();
+       WhirlEffect *plugin;
+       WhirlWindow *window;
+};
+
+
 class WhirlWindow : public PluginClientWindow
 {
 public:
        WhirlWindow(WhirlEffect *plugin);
        void create_objects();
+       void update();
        WhirlEffect *plugin;
        WhirlRadius *radius;
        WhirlPinch *pinch;
        WhirlAngle *angle;
+       WhirlReset *reset;
 };
 
 
@@ -178,13 +194,16 @@ REGISTER_PLUGIN(WhirlEffect)
 
 
 
-
-
 WhirlConfig::WhirlConfig()
 {
-       angle = 0.0;
-       pinch = 0.0;
-       radius = 0.0;
+       reset();
+}
+
+void WhirlConfig::reset()
+{
+       angle = 180.0;  // 0.0;
+       pinch = 10.0;   // 0.0;
+       radius = 50.0;  // 0.0;
 }
 
 void WhirlConfig::copy_from(WhirlConfig &src)
@@ -227,9 +246,9 @@ void WhirlConfig::interpolate(WhirlConfig &prev,
 WhirlWindow::WhirlWindow(WhirlEffect *plugin)
  : PluginClientWindow(plugin,
        220,
-       200,
+       195,
        220,
-       200,
+       195,
        0)
 {
        this->plugin = plugin;
@@ -243,21 +262,29 @@ void WhirlWindow::create_objects()
        add_subwindow(new BC_Title(x, y, _("Radius")));
        y += 20;
        add_subwindow(radius = new WhirlRadius(plugin, x, y));
-       y += 40;
+       y += 30;
        add_subwindow(new BC_Title(x, y, _("Pinch")));
        y += 20;
        add_subwindow(pinch = new WhirlPinch(plugin, x, y));
-       y += 40;
+       y += 30;
        add_subwindow(new BC_Title(x, y, _("Angle")));
        y += 20;
        add_subwindow(angle = new WhirlAngle(plugin, x, y));
+       y += 35;
+       add_subwindow(reset = new WhirlReset(plugin, this, x, y));
 
        show_window();
        flush();
 }
 
 
-
+// for Reset button
+void WhirlWindow::update()
+{
+       radius->update(plugin->config.radius);
+       pinch->update(plugin->config.pinch);
+       angle->update(plugin->config.angle);
+}
 
 
 
@@ -334,6 +361,23 @@ int WhirlRadius::handle_event()
 
 
 
+WhirlReset::WhirlReset(WhirlEffect *plugin, WhirlWindow *window, int x, int y)
+ : BC_GenericButton(x, y, _("Reset"))
+{
+       this->plugin = plugin;
+       this->window = window;
+}
+WhirlReset::~WhirlReset()
+{
+}
+int WhirlReset::handle_event()
+{
+       plugin->config.reset();
+       window->update();
+       plugin->send_configure_change();
+       return 1;
+}
+
 
 
 
index 8336708..ad67e54 100644 (file)
  *
  */
 
-#include <math.h>
-#include <stdint.h>
-#include <string.h>
-
-#include "bcdisplayinfo.h"
-#include "bcsignals.h"
-#include "clip.h"
-#include "bchash.h"
-#include "filexml.h"
-#include "keyframe.h"
-#include "language.h"
-#include "loadbalance.h"
-#include "pluginvclient.h"
-#include "vframe.h"
-
-
-
-class ZoomBlurMain;
-class ZoomBlurEngine;
-
-
-
-
-
-class ZoomBlurConfig
-{
-public:
-       ZoomBlurConfig();
-
-       int equivalent(ZoomBlurConfig &that);
-       void copy_from(ZoomBlurConfig &that);
-       void interpolate(ZoomBlurConfig &prev,
-               ZoomBlurConfig &next,
-               long prev_frame,
-               long next_frame,
-               long current_frame);
-
-       int x;
-       int y;
-       int radius;
-       int steps;
-       int r;
-       int g;
-       int b;
-       int a;
-};
-
-
-
-class ZoomBlurSize : public BC_ISlider
-{
-public:
-       ZoomBlurSize(ZoomBlurMain *plugin,
-               int x,
-               int y,
-               int *output,
-               int min,
-               int max);
-       int handle_event();
-       ZoomBlurMain *plugin;
-       int *output;
-};
-
-class ZoomBlurToggle : public BC_CheckBox
-{
-public:
-       ZoomBlurToggle(ZoomBlurMain *plugin,
-               int x,
-               int y,
-               int *output,
-               char *string);
-       int handle_event();
-       ZoomBlurMain *plugin;
-       int *output;
-};
-
-class ZoomBlurWindow : public PluginClientWindow
-{
-public:
-       ZoomBlurWindow(ZoomBlurMain *plugin);
-       ~ZoomBlurWindow();
-
-       void create_objects();
-
-       ZoomBlurSize *x, *y, *radius, *steps;
-       ZoomBlurToggle *r, *g, *b, *a;
-       ZoomBlurMain *plugin;
-};
-
-
-
-
-
-// Output coords for a layer of blurring
-// Used for OpenGL only
-class ZoomBlurLayer
-{
-public:
-       ZoomBlurLayer() {};
-       float x1, y1, x2, y2;
-};
-
-class ZoomBlurMain : public PluginVClient
-{
-public:
-       ZoomBlurMain(PluginServer *server);
-       ~ZoomBlurMain();
-
-       int process_buffer(VFrame *frame,
-               int64_t start_position,
-               double frame_rate);
-       int is_realtime();
-       void save_data(KeyFrame *keyframe);
-       void read_data(KeyFrame *keyframe);
-       void update_gui();
-       int handle_opengl();
-
-       PLUGIN_CLASS_MEMBERS(ZoomBlurConfig)
-
-       void delete_tables();
-       VFrame *input, *output, *temp;
-       ZoomBlurEngine *engine;
-       int **scale_y_table;
-       int **scale_x_table;
-       ZoomBlurLayer *layer_table;
-       int table_entries;
-       int need_reconfigure;
-// The accumulation buffer is needed because 8 bits isn't precise enough
-       unsigned char *accum;
-};
-
-class ZoomBlurPackage : public LoadPackage
-{
-public:
-       ZoomBlurPackage();
-       int y1, y2;
-};
-
-class ZoomBlurUnit : public LoadClient
-{
-public:
-       ZoomBlurUnit(ZoomBlurEngine *server, ZoomBlurMain *plugin);
-       void process_package(LoadPackage *package);
-       ZoomBlurEngine *server;
-       ZoomBlurMain *plugin;
-};
-
-class ZoomBlurEngine : public LoadServer
-{
-public:
-       ZoomBlurEngine(ZoomBlurMain *plugin,
-               int total_clients,
-               int total_packages);
-       void init_packages();
-       LoadClient* new_client();
-       LoadPackage* new_package();
-       ZoomBlurMain *plugin;
-};
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
 
+#include "zoomblur.h"
 
 
 
@@ -201,6 +29,11 @@ REGISTER_PLUGIN(ZoomBlurMain)
 
 
 ZoomBlurConfig::ZoomBlurConfig()
+{
+       reset();
+}
+
+void ZoomBlurConfig::reset()
 {
        x = 50;
        y = 50;
@@ -269,9 +102,9 @@ void ZoomBlurConfig::interpolate(ZoomBlurConfig &prev,
 ZoomBlurWindow::ZoomBlurWindow(ZoomBlurMain *plugin)
  : PluginClientWindow(plugin,
        230,
-       340,
+       370,
        230,
-       340,
+       370,
        0)
 {
        this->plugin = plugin;
@@ -308,13 +141,25 @@ void ZoomBlurWindow::create_objects()
        add_subwindow(b = new ZoomBlurToggle(plugin, x, y, &plugin->config.b, _("Blue")));
        y += 30;
        add_subwindow(a = new ZoomBlurToggle(plugin, x, y, &plugin->config.a, _("Alpha")));
-       y += 30;
+       y += 40;
+       add_subwindow(reset = new ZoomBlurReset(plugin, this, x, y));
 
        show_window();
        flush();
 }
 
-
+// for Reset button
+void ZoomBlurWindow::update()
+{
+       this->x->update(plugin->config.x);
+       this->y->update(plugin->config.x);
+       radius->update(plugin->config.radius);
+       steps->update(plugin->config.steps);
+       r->update(plugin->config.r);
+       g->update(plugin->config.g);
+       b->update(plugin->config.b);
+       a->update(plugin->config.a);
+}
 
 
 
@@ -368,8 +213,22 @@ int ZoomBlurSize::handle_event()
 }
 
 
-
-
+ZoomBlurReset::ZoomBlurReset(ZoomBlurMain *plugin, ZoomBlurWindow *window, int x, int y)
+ : BC_GenericButton(x, y, _("Reset"))
+{
+       this->plugin = plugin;
+       this->window = window;
+}
+ZoomBlurReset::~ZoomBlurReset()
+{
+}
+int ZoomBlurReset::handle_event()
+{
+       plugin->config.reset();
+       window->update();
+       plugin->send_configure_change();
+       return 1;
+}
 
 
 
diff --git a/cinelerra-5.1/plugins/zoomblur/zoomblur.h b/cinelerra-5.1/plugins/zoomblur/zoomblur.h
new file mode 100644 (file)
index 0000000..32a00f1
--- /dev/null
@@ -0,0 +1,195 @@
+
+/*
+ * CINELERRA
+ * Copyright (C) 2008 Adam Williams <broadcast at earthling dot net>
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+ *
+ */
+
+#ifndef ZOOMBLUR_H
+#define ZOOMBLUR_H
+
+
+#include "bcdisplayinfo.h"
+#include "bcsignals.h"
+#include "clip.h"
+#include "bchash.h"
+#include "filexml.h"
+#include "keyframe.h"
+#include "language.h"
+#include "loadbalance.h"
+#include "pluginvclient.h"
+#include "vframe.h"
+
+
+
+class ZoomBlurMain;
+class ZoomBlurWindow;
+class ZoomBlurEngine;
+class ZoomBlurReset;
+
+
+
+
+class ZoomBlurConfig
+{
+public:
+       ZoomBlurConfig();
+
+       void reset();
+       int equivalent(ZoomBlurConfig &that);
+       void copy_from(ZoomBlurConfig &that);
+       void interpolate(ZoomBlurConfig &prev,
+               ZoomBlurConfig &next,
+               long prev_frame,
+               long next_frame,
+               long current_frame);
+
+       int x;
+       int y;
+       int radius;
+       int steps;
+       int r;
+       int g;
+       int b;
+       int a;
+};
+
+
+
+class ZoomBlurSize : public BC_ISlider
+{
+public:
+       ZoomBlurSize(ZoomBlurMain *plugin,
+               int x,
+               int y,
+               int *output,
+               int min,
+               int max);
+       int handle_event();
+       ZoomBlurMain *plugin;
+       int *output;
+};
+
+class ZoomBlurToggle : public BC_CheckBox
+{
+public:
+       ZoomBlurToggle(ZoomBlurMain *plugin,
+               int x,
+               int y,
+               int *output,
+               char *string);
+       int handle_event();
+       ZoomBlurMain *plugin;
+       int *output;
+};
+
+class ZoomBlurWindow : public PluginClientWindow
+{
+public:
+       ZoomBlurWindow(ZoomBlurMain *plugin);
+       ~ZoomBlurWindow();
+
+       void create_objects();
+       void update();
+
+       ZoomBlurSize *x, *y, *radius, *steps;
+       ZoomBlurToggle *r, *g, *b, *a;
+       ZoomBlurMain *plugin;
+       ZoomBlurReset *reset;
+};
+
+class ZoomBlurReset : public BC_GenericButton
+{
+public:
+       ZoomBlurReset(ZoomBlurMain *plugin, ZoomBlurWindow *window, int x, int y);
+       ~ZoomBlurReset();
+       int handle_event();
+       ZoomBlurMain *plugin;
+       ZoomBlurWindow *window;
+};
+
+
+
+
+// Output coords for a layer of blurring
+// Used for OpenGL only
+class ZoomBlurLayer
+{
+public:
+       ZoomBlurLayer() {};
+       float x1, y1, x2, y2;
+};
+
+class ZoomBlurMain : public PluginVClient
+{
+public:
+       ZoomBlurMain(PluginServer *server);
+       ~ZoomBlurMain();
+
+       int process_buffer(VFrame *frame,
+               int64_t start_position,
+               double frame_rate);
+       int is_realtime();
+       void save_data(KeyFrame *keyframe);
+       void read_data(KeyFrame *keyframe);
+       void update_gui();
+       int handle_opengl();
+
+       PLUGIN_CLASS_MEMBERS(ZoomBlurConfig)
+
+       void delete_tables();
+       VFrame *input, *output, *temp;
+       ZoomBlurEngine *engine;
+       int **scale_y_table;
+       int **scale_x_table;
+       ZoomBlurLayer *layer_table;
+       int table_entries;
+       int need_reconfigure;
+// The accumulation buffer is needed because 8 bits isn't precise enough
+       unsigned char *accum;
+};
+
+class ZoomBlurPackage : public LoadPackage
+{
+public:
+       ZoomBlurPackage();
+       int y1, y2;
+};
+
+class ZoomBlurUnit : public LoadClient
+{
+public:
+       ZoomBlurUnit(ZoomBlurEngine *server, ZoomBlurMain *plugin);
+       void process_package(LoadPackage *package);
+       ZoomBlurEngine *server;
+       ZoomBlurMain *plugin;
+};
+
+class ZoomBlurEngine : public LoadServer
+{
+public:
+       ZoomBlurEngine(ZoomBlurMain *plugin,
+               int total_clients,
+               int total_packages);
+       void init_packages();
+       LoadClient* new_client();
+       LoadPackage* new_package();
+       ZoomBlurMain *plugin;
+};
+
+
+#endif
index 2da7d7e..36101b9 100644 (file)
@@ -168,7 +168,7 @@ lame.cfg_params?=--enable-shared=no
 lame.mak_params?= ; cd $(call bld_path,lame,include); ln -sf . lame
 mjpegtools.cflags?="$(call inc_path,libjpeg) $(call ld_path,libjpeg,.libs)"
 mjpegtools.mak_params?=; ln -s . $(call bld_path,mjpegtools,utils)/mjpegtools 
-mjpegtools.cfg_params?= --enable-shared=no --without-libsdl
+mjpegtools.cfg_params?= --enable-shared=no --without-libsdl --without-v4l
 ladspa.cfg_vars?= CFLAGS+=' -Dinline="" '
 ladspa.mak_params?=; $(MAKE) -C ladspa* install DESTDIR=$(call bld_path,ladspa)
 libavc1394.cfg_vars?=PKG_CONFIG_PATH=$(call bld_path,libraw1394)