From: Good Guy Date: Sat, 5 Jan 2019 18:02:33 +0000 (-0700) Subject: igor b reset btns, reframert bug fix X-Git-Tag: 2019-08~127 X-Git-Url: https://cinelerra-gg.org/git/?a=commitdiff_plain;h=1c6e05239a27d92813c27c697ccac25378b9efa0;p=goodguy%2Fcinelerra.git igor b reset btns, reframert bug fix --- diff --git a/cinelerra-5.1/plugins/brightness/brightness.C b/cinelerra-5.1/plugins/brightness/brightness.C index 19bcae30..ccfcd904 100644 --- a/cinelerra-5.1/plugins/brightness/brightness.C +++ b/cinelerra-5.1/plugins/brightness/brightness.C @@ -35,8 +35,13 @@ REGISTER_PLUGIN(BrightnessMain) - BrightnessConfig::BrightnessConfig() +{ + reset(); +} + +void BrightnessConfig::reset() + { brightness = 0; contrast = 0; diff --git a/cinelerra-5.1/plugins/brightness/brightness.h b/cinelerra-5.1/plugins/brightness/brightness.h index c9b4472c..216dd4e4 100644 --- a/cinelerra-5.1/plugins/brightness/brightness.h +++ b/cinelerra-5.1/plugins/brightness/brightness.h @@ -36,6 +36,7 @@ public: BrightnessConfig(); int equivalent(BrightnessConfig &that); + void reset(); void copy_from(BrightnessConfig &that); void interpolate(BrightnessConfig &prev, BrightnessConfig &next, diff --git a/cinelerra-5.1/plugins/brightness/brightnesswindow.C b/cinelerra-5.1/plugins/brightness/brightnesswindow.C index 73542ca3..5a455e01 100644 --- a/cinelerra-5.1/plugins/brightness/brightnesswindow.C +++ b/cinelerra-5.1/plugins/brightness/brightnesswindow.C @@ -68,10 +68,21 @@ void BrightnessWindow::create_objects() add_tool(luma = new BrightnessLuma(client, x, y)); + + y += 35; + add_subwindow(reset = new BrightnessReset(client, this, x, y)); + show_window(); flush(); } +// for Reset button +void BrightnessWindow::update() +{ + brightness->update(client->config.brightness); + contrast->update(client->config.contrast); + luma->update(client->config.luma); +} BrightnessSlider::BrightnessSlider(BrightnessMain *client, float *output, @@ -138,3 +149,22 @@ int BrightnessLuma::handle_event() client->send_configure_change(); return 1; } + + +BrightnessReset::BrightnessReset(BrightnessMain *client, BrightnessWindow *window, int x, int y) + : BC_GenericButton(x, y, _("Reset")) +{ + this->client = client; + this->window = window; +} +BrightnessReset::~BrightnessReset() +{ +} +int BrightnessReset::handle_event() +{ + client->config.reset(); + window->update(); + client->send_configure_change(); + return 1; +} + diff --git a/cinelerra-5.1/plugins/brightness/brightnesswindow.h b/cinelerra-5.1/plugins/brightness/brightnesswindow.h index 6309641b..1d4300df 100644 --- a/cinelerra-5.1/plugins/brightness/brightnesswindow.h +++ b/cinelerra-5.1/plugins/brightness/brightnesswindow.h @@ -27,6 +27,7 @@ class BrightnessThread; class BrightnessWindow; class BrightnessSlider; class BrightnessLuma; +class BrightnessReset; #include "brightness.h" #include "guicast.h" @@ -40,13 +41,14 @@ class BrightnessWindow : public PluginClientWindow public: BrightnessWindow(BrightnessMain *client); ~BrightnessWindow(); - + void update(); void create_objects(); BrightnessMain *client; BrightnessSlider *brightness; BrightnessSlider *contrast; BrightnessLuma *luma; + BrightnessReset *reset; }; class BrightnessSlider : public BC_FSlider @@ -73,6 +75,16 @@ public: BrightnessMain *client; }; +class BrightnessReset : public BC_GenericButton +{ +public: + BrightnessReset(BrightnessMain *client, BrightnessWindow *window, int x, int y); + ~BrightnessReset(); + int handle_event(); + BrightnessMain *client; + BrightnessWindow *window; +}; + #endif diff --git a/cinelerra-5.1/plugins/gamma/gamma.C b/cinelerra-5.1/plugins/gamma/gamma.C index a81c5e85..71267770 100644 --- a/cinelerra-5.1/plugins/gamma/gamma.C +++ b/cinelerra-5.1/plugins/gamma/gamma.C @@ -42,6 +42,11 @@ REGISTER_PLUGIN(GammaMain) GammaConfig::GammaConfig() +{ + reset(); +} + +void GammaConfig::reset() { max = 1; gamma = 0.6; diff --git a/cinelerra-5.1/plugins/gamma/gamma.h b/cinelerra-5.1/plugins/gamma/gamma.h index 21cef587..0bc2eac5 100644 --- a/cinelerra-5.1/plugins/gamma/gamma.h +++ b/cinelerra-5.1/plugins/gamma/gamma.h @@ -40,6 +40,7 @@ public: GammaConfig(); int equivalent(GammaConfig &that); + void reset(); void copy_from(GammaConfig &that); void interpolate(GammaConfig &prev, GammaConfig &next, diff --git a/cinelerra-5.1/plugins/gamma/gammawindow.C b/cinelerra-5.1/plugins/gamma/gammawindow.C index 5b75102e..b00d3245 100644 --- a/cinelerra-5.1/plugins/gamma/gammawindow.C +++ b/cinelerra-5.1/plugins/gamma/gammawindow.C @@ -25,13 +25,6 @@ - - - - - - - GammaWindow::GammaWindow(GammaMain *client) : PluginClientWindow(client, 400, @@ -45,7 +38,7 @@ GammaWindow::GammaWindow(GammaMain *client) void GammaWindow::create_objects() { - int x = 10, y = 10; + int x = 10, y = 10, x1 = x; add_subwindow(histogram = new BC_SubWindow(x, y, get_w() - x * 2, @@ -56,6 +49,7 @@ void GammaWindow::create_objects() BC_Title *title; add_tool(title = new BC_Title(x, y, _("Maximum:"))); x += title->get_w() + 10; + x1 = x; // save x to align the two sliders add_tool(max_slider = new MaxSlider(client, this, x, @@ -70,10 +64,10 @@ void GammaWindow::create_objects() y += max_text->get_h() + 10; x = 10; add_tool(automatic = new GammaAuto(client, x, y)); - y += automatic->get_h() + 10; add_tool(title = new BC_Title(x, y, _("Gamma:"))); x += title->get_w() + 10; + x = x1; // recover x of the "MaxSlider" to align the "GammaSlider" add_tool(gamma_slider = new GammaSlider(client, this, x, @@ -93,6 +87,8 @@ void GammaWindow::create_objects() add_tool(new GammaColorPicker(client, this, x, y)); + add_tool(reset = new GammaReset(client, this, get_w()-110, y)); + show_window(); flush(); } @@ -315,3 +311,18 @@ int GammaColorPicker::handle_event() } +GammaReset::GammaReset(GammaMain *plugin, GammaWindow *gui, int x, int y) + : BC_GenericButton(x, y, _("Reset")) +{ + this->plugin = plugin; + this->gui = gui; +} + +int GammaReset::handle_event() +{ + plugin->config.reset(); + gui->update(); + plugin->send_configure_change(); + return 1; +} + diff --git a/cinelerra-5.1/plugins/gamma/gammawindow.h b/cinelerra-5.1/plugins/gamma/gammawindow.h index 475e1c8e..96d0ae2c 100644 --- a/cinelerra-5.1/plugins/gamma/gammawindow.h +++ b/cinelerra-5.1/plugins/gamma/gammawindow.h @@ -32,6 +32,7 @@ class GammaText; class GammaAuto; class GammaPlot; class GammaColorPicker; +class GammaReset; #include "filexml.h" #include "guicast.h" @@ -59,6 +60,7 @@ public: GammaText *gamma_text; GammaAuto *automatic; GammaPlot *plot; + GammaReset *reset; }; class MaxSlider : public BC_FSlider @@ -141,4 +143,13 @@ public: GammaWindow *gui; }; +class GammaReset : public BC_GenericButton +{ +public: + GammaReset(GammaMain *plugin, GammaWindow *gui, int x, int y); + int handle_event(); + GammaMain *plugin; + GammaWindow *gui; +}; + #endif diff --git a/cinelerra-5.1/plugins/huesaturation/huesaturation.C b/cinelerra-5.1/plugins/huesaturation/huesaturation.C index 727f54f2..7f050232 100644 --- a/cinelerra-5.1/plugins/huesaturation/huesaturation.C +++ b/cinelerra-5.1/plugins/huesaturation/huesaturation.C @@ -24,6 +24,7 @@ #include "clip.h" #include "bchash.h" #include "filexml.h" +#include "huesaturation.h" #include "guicast.h" #include "language.h" #include "loadbalance.h" @@ -36,142 +37,19 @@ #include -class HueEffect; - -#define MINHUE -180 -#define MAXHUE 180 -#define MINSATURATION -100 -#define MAXSATURATION 100 -#define MINVALUE -100 -#define MAXVALUE 100 - - - - - - -class HueConfig -{ -public: - HueConfig(); - - void copy_from(HueConfig &src); - int equivalent(HueConfig &src); - void interpolate(HueConfig &prev, - HueConfig &next, - long prev_frame, - long next_frame, - long current_frame); - float hue, saturation, value; -}; - -class HueSlider : public BC_FSlider -{ -public: - HueSlider(HueEffect *plugin, int x, int y, int w); - int handle_event(); - HueEffect *plugin; -}; - -class SaturationSlider : public BC_FSlider -{ -public: - SaturationSlider(HueEffect *plugin, int x, int y, int w); - int handle_event(); - char* get_caption(); - HueEffect *plugin; - char string[BCTEXTLEN]; -}; - -class ValueSlider : public BC_FSlider -{ -public: - ValueSlider(HueEffect *plugin, int x, int y, int w); - int handle_event(); - char* get_caption(); - HueEffect *plugin; - char string[BCTEXTLEN]; -}; - -class HueWindow : public PluginClientWindow -{ -public: - HueWindow(HueEffect *plugin); - void create_objects(); - HueEffect *plugin; - HueSlider *hue; - SaturationSlider *saturation; - ValueSlider *value; -}; +REGISTER_PLUGIN(HueEffect) -class HueEngine : public LoadServer -{ -public: - HueEngine(HueEffect *plugin, int cpus); - void init_packages(); - LoadClient* new_client(); - LoadPackage* new_package(); - HueEffect *plugin; -}; -class HuePackage : public LoadPackage -{ -public: - HuePackage(); - int row1, row2; -}; -class HueUnit : public LoadClient -{ -public: - HueUnit(HueEffect *plugin, HueEngine *server); - void process_package(LoadPackage *package); - HueEffect *plugin; -}; -class HueEffect : public PluginVClient +HueConfig::HueConfig() { -public: - HueEffect(PluginServer *server); - ~HueEffect(); - - - PLUGIN_CLASS_MEMBERS(HueConfig); - 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(); - - VFrame *input, *output; - HueEngine *engine; -}; - - - - - - - - - - - - - - - - - - - + reset(); +} -HueConfig::HueConfig() +void HueConfig::reset() { hue = saturation = value = 0; } @@ -294,13 +172,28 @@ char* ValueSlider::get_caption() } - +HueReset::HueReset(HueEffect *plugin, HueWindow *gui, int x, int y) + : BC_GenericButton(x, y, _("Reset")) +{ + this->plugin = plugin; + this->gui = gui; +} +HueReset::~HueReset() +{ +} +int HueReset::handle_event() +{ + plugin->config.reset(); + gui->update(); + plugin->send_configure_change(); + return 1; +} HueWindow::HueWindow(HueEffect *plugin) - : PluginClientWindow(plugin, 345, 100, 345, 100, 0) + : PluginClientWindow(plugin, 345, 145, 345, 145, 0) { this->plugin = plugin; } @@ -315,12 +208,20 @@ void HueWindow::create_objects() y += 30; add_subwindow(new BC_Title(x, y, _("Value:"))); add_subwindow(value = new ValueSlider(plugin, x1, y, 200)); + y += 40; + add_subwindow(reset = new HueReset(plugin, this, x, y)); show_window(); flush(); } - +// for Reset button +void HueWindow::update() +{ + hue->update(plugin->config.hue); + saturation->update(plugin->config.saturation); + value->update(plugin->config.value); +} @@ -519,7 +420,6 @@ void HueUnit::process_package(LoadPackage *package) -REGISTER_PLUGIN(HueEffect) HueEffect::HueEffect(PluginServer *server) diff --git a/cinelerra-5.1/plugins/huesaturation/huesaturation.h b/cinelerra-5.1/plugins/huesaturation/huesaturation.h new file mode 100644 index 00000000..f7e1b814 --- /dev/null +++ b/cinelerra-5.1/plugins/huesaturation/huesaturation.h @@ -0,0 +1,173 @@ + +/* + * CINELERRA + * Copyright (C) 2008 Adam Williams + * + * 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 HUESATURATION_H +#define HUESATURATION_H + +#include "bccolors.h" +#include "bcdisplayinfo.h" +#include "clip.h" +#include "bchash.h" +#include "filexml.h" +#include "guicast.h" +#include "language.h" +#include "loadbalance.h" +#include "bccolors.h" +#include "playback3d.h" +#include "pluginvclient.h" +#include "vframe.h" + +#include +#include + + +class HueEffect; +class HueWindow; +class HueReset; + +#define MINHUE -180 +#define MAXHUE 180 +#define MINSATURATION -100 +#define MAXSATURATION 100 +#define MINVALUE -100 +#define MAXVALUE 100 + + + + + + +class HueConfig +{ +public: + HueConfig(); + + void copy_from(HueConfig &src); + int equivalent(HueConfig &src); + void reset(); + void interpolate(HueConfig &prev, + HueConfig &next, + long prev_frame, + long next_frame, + long current_frame); + float hue, saturation, value; +}; + +class HueSlider : public BC_FSlider +{ +public: + HueSlider(HueEffect *plugin, int x, int y, int w); + int handle_event(); + HueEffect *plugin; +}; + +class SaturationSlider : public BC_FSlider +{ +public: + SaturationSlider(HueEffect *plugin, int x, int y, int w); + int handle_event(); + char* get_caption(); + HueEffect *plugin; + char string[BCTEXTLEN]; +}; + +class ValueSlider : public BC_FSlider +{ +public: + ValueSlider(HueEffect *plugin, int x, int y, int w); + int handle_event(); + char* get_caption(); + HueEffect *plugin; + char string[BCTEXTLEN]; +}; + +class HueReset : public BC_GenericButton +{ +public: + HueReset(HueEffect *plugin, HueWindow *gui, int x, int y); + ~HueReset(); + int handle_event(); + HueEffect *plugin; + HueWindow *gui; +}; + +class HueWindow : public PluginClientWindow +{ +public: + HueWindow(HueEffect *plugin); + void create_objects(); + void update(); + HueEffect *plugin; + HueSlider *hue; + SaturationSlider *saturation; + ValueSlider *value; + HueReset *reset; +}; + + +class HueEngine : public LoadServer +{ +public: + HueEngine(HueEffect *plugin, int cpus); + void init_packages(); + LoadClient* new_client(); + LoadPackage* new_package(); + HueEffect *plugin; +}; + +class HuePackage : public LoadPackage +{ +public: + HuePackage(); + int row1, row2; +}; + +class HueUnit : public LoadClient +{ +public: + HueUnit(HueEffect *plugin, HueEngine *server); + void process_package(LoadPackage *package); + HueEffect *plugin; +}; + +class HueEffect : public PluginVClient +{ +public: + HueEffect(PluginServer *server); + ~HueEffect(); + + + PLUGIN_CLASS_MEMBERS(HueConfig); + 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(); + + VFrame *input, *output; + HueEngine *engine; +}; + +#endif + diff --git a/cinelerra-5.1/plugins/reframert/reframert.C b/cinelerra-5.1/plugins/reframert/reframert.C index b39fa630..1c52881f 100644 --- a/cinelerra-5.1/plugins/reframert/reframert.C +++ b/cinelerra-5.1/plugins/reframert/reframert.C @@ -23,6 +23,7 @@ #include "clip.h" #include "bchash.h" #include "filexml.h" +#include "reframert.h" #include "guicast.h" #include "language.h" #include "pluginvclient.h" @@ -31,124 +32,6 @@ #include -class ReframeRT; -class ReframeRTWindow; - -class ReframeRTConfig -{ -public: - ReframeRTConfig(); - void boundaries(); - int equivalent(ReframeRTConfig &src); - void copy_from(ReframeRTConfig &src); - void interpolate(ReframeRTConfig &prev, - ReframeRTConfig &next, - int64_t prev_frame, - int64_t next_frame, - int64_t current_frame); -// was scale - double num; - double denom; - int stretch; - int interp; - int optic_flow; -}; - - -class ReframeRTNum : public BC_TumbleTextBox -{ -public: - ReframeRTNum(ReframeRT *plugin, - ReframeRTWindow *gui, - int x, - int y); - int handle_event(); - ReframeRT *plugin; -}; - -class ReframeRTDenom : public BC_TumbleTextBox -{ -public: - ReframeRTDenom(ReframeRT *plugin, - ReframeRTWindow *gui, - int x, - int y); - int handle_event(); - ReframeRT *plugin; -}; - -class ReframeRTStretch : public BC_Radial -{ -public: - ReframeRTStretch(ReframeRT *plugin, - ReframeRTWindow *gui, - int x, - int y); - int handle_event(); - ReframeRT *plugin; - ReframeRTWindow *gui; -}; - -class ReframeRTDownsample : public BC_Radial -{ -public: - ReframeRTDownsample(ReframeRT *plugin, - ReframeRTWindow *gui, - int x, - int y); - int handle_event(); - ReframeRT *plugin; - ReframeRTWindow *gui; -}; - -class ReframeRTInterpolate : public BC_CheckBox -{ -public: - ReframeRTInterpolate(ReframeRT *plugin, - ReframeRTWindow *gui, - int x, - int y); - int handle_event(); - ReframeRT *plugin; - ReframeRTWindow *gui; -}; - -class ReframeRTWindow : public PluginClientWindow -{ -public: - ReframeRTWindow(ReframeRT *plugin); - ~ReframeRTWindow(); - void create_objects(); - ReframeRT *plugin; - ReframeRTNum *num; - ReframeRTDenom *denom; - ReframeRTStretch *stretch; - ReframeRTDownsample *downsample; - ReframeRTInterpolate *interpolate; -}; - - -class ReframeRT : public PluginVClient -{ -public: - ReframeRT(PluginServer *server); - ~ReframeRT(); - - PLUGIN_CLASS_MEMBERS(ReframeRTConfig) - - void save_data(KeyFrame *keyframe); - void read_data(KeyFrame *keyframe); - void update_gui(); - int is_realtime(); - int is_synthesis(); - int process_buffer(VFrame *frame, - int64_t start_position, - double frame_rate); -}; - - - - @@ -157,6 +40,11 @@ REGISTER_PLUGIN(ReframeRT); ReframeRTConfig::ReframeRTConfig() +{ + reset(); +} + +void ReframeRTConfig::reset() { num = 1.0; denom = 1.0; @@ -220,7 +108,7 @@ void ReframeRTConfig::boundaries() ReframeRTWindow::ReframeRTWindow(ReframeRT *plugin) - : PluginClientWindow(plugin, 230, 190, 230, 190, 0) + : PluginClientWindow(plugin, 230, 235, 230, 235, 0) { this->plugin = plugin; } @@ -260,14 +148,19 @@ void ReframeRTWindow::create_objects() add_subwindow(downsample = new ReframeRTDownsample(plugin, this, x, y)); y += 30; add_subwindow(interpolate = new ReframeRTInterpolate(plugin, this, x, y)); - y += 30; - add_subwindow(stretch = new ReframeRTStretch(plugin, this, x, y)); - y += stretch->get_h() + plugin->get_theme()->widget_border; - add_subwindow(downsample = new ReframeRTDownsample(plugin, this, x, y)); + y += 40; + add_subwindow(reset = new ReframeRTReset(plugin, this, x, y)); show_window(); } - +void ReframeRTWindow::update() +{ + num->update((float)plugin->config.num); + denom->update((float)plugin->config.denom); + stretch->update(plugin->config.stretch); + downsample->update(!plugin->config.stretch); + interpolate->update(plugin->config.interp); +} @@ -377,6 +270,26 @@ int ReframeRTInterpolate::handle_event() return 1; } + +ReframeRTReset::ReframeRTReset(ReframeRT *plugin, ReframeRTWindow *gui, int x, int y) + : BC_GenericButton(x, y, _("Reset")) +{ + this->plugin = plugin; + this->gui = gui; +} +ReframeRTReset::~ReframeRTReset() +{ +} +int ReframeRTReset::handle_event() +{ + plugin->config.reset(); + gui->update(); + plugin->send_configure_change(); + return 1; +} + + + ReframeRT::ReframeRT(PluginServer *server) : PluginVClient(server) { diff --git a/cinelerra-5.1/plugins/reframert/reframert.h b/cinelerra-5.1/plugins/reframert/reframert.h new file mode 100644 index 00000000..f3e6e62d --- /dev/null +++ b/cinelerra-5.1/plugins/reframert/reframert.h @@ -0,0 +1,166 @@ + +/* + * CINELERRA + * Copyright (C) 2008-2016 Adam Williams + * + * 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 REFRAMERT_H +#define REFRAMERT_H + + +#include "bcdisplayinfo.h" +#include "clip.h" +#include "bchash.h" +#include "filexml.h" +#include "guicast.h" +#include "language.h" +#include "pluginvclient.h" +#include "theme.h" +#include "transportque.h" + + +class ReframeRT; +class ReframeRTWindow; +class ReframeRTReset; + +class ReframeRTConfig +{ +public: + ReframeRTConfig(); + void boundaries(); + int equivalent(ReframeRTConfig &src); + void reset(); + void copy_from(ReframeRTConfig &src); + void interpolate(ReframeRTConfig &prev, + ReframeRTConfig &next, + int64_t prev_frame, + int64_t next_frame, + int64_t current_frame); +// was scale + double num; + double denom; + int stretch; + int interp; + int optic_flow; +}; + + +class ReframeRTNum : public BC_TumbleTextBox +{ +public: + ReframeRTNum(ReframeRT *plugin, + ReframeRTWindow *gui, + int x, + int y); + int handle_event(); + ReframeRT *plugin; +}; + +class ReframeRTDenom : public BC_TumbleTextBox +{ +public: + ReframeRTDenom(ReframeRT *plugin, + ReframeRTWindow *gui, + int x, + int y); + int handle_event(); + ReframeRT *plugin; +}; + +class ReframeRTStretch : public BC_Radial +{ +public: + ReframeRTStretch(ReframeRT *plugin, + ReframeRTWindow *gui, + int x, + int y); + int handle_event(); + ReframeRT *plugin; + ReframeRTWindow *gui; +}; + +class ReframeRTDownsample : public BC_Radial +{ +public: + ReframeRTDownsample(ReframeRT *plugin, + ReframeRTWindow *gui, + int x, + int y); + int handle_event(); + ReframeRT *plugin; + ReframeRTWindow *gui; +}; + +class ReframeRTInterpolate : public BC_CheckBox +{ +public: + ReframeRTInterpolate(ReframeRT *plugin, + ReframeRTWindow *gui, + int x, + int y); + int handle_event(); + ReframeRT *plugin; + ReframeRTWindow *gui; +}; + +class ReframeRTReset : public BC_GenericButton +{ +public: + ReframeRTReset(ReframeRT *plugin, ReframeRTWindow *gui, int x, int y); + ~ReframeRTReset(); + int handle_event(); + ReframeRT *plugin; + ReframeRTWindow *gui; +}; + +class ReframeRTWindow : public PluginClientWindow +{ +public: + ReframeRTWindow(ReframeRT *plugin); + ~ReframeRTWindow(); + void create_objects(); + void update(); + ReframeRT *plugin; + ReframeRTNum *num; + ReframeRTDenom *denom; + ReframeRTStretch *stretch; + ReframeRTDownsample *downsample; + ReframeRTInterpolate *interpolate; + ReframeRTReset *reset; +}; + + +class ReframeRT : public PluginVClient +{ +public: + ReframeRT(PluginServer *server); + ~ReframeRT(); + + PLUGIN_CLASS_MEMBERS(ReframeRTConfig) + + void save_data(KeyFrame *keyframe); + void read_data(KeyFrame *keyframe); + void update_gui(); + int is_realtime(); + int is_synthesis(); + int process_buffer(VFrame *frame, + int64_t start_position, + double frame_rate); +}; + +#endif \ No newline at end of file diff --git a/cinelerra-5.1/plugins/sharpen/sharpen.C b/cinelerra-5.1/plugins/sharpen/sharpen.C index 9cbd1c7e..e540576c 100644 --- a/cinelerra-5.1/plugins/sharpen/sharpen.C +++ b/cinelerra-5.1/plugins/sharpen/sharpen.C @@ -39,6 +39,11 @@ REGISTER_PLUGIN(SharpenMain) SharpenConfig::SharpenConfig() +{ + reset(); +} + +void SharpenConfig::reset() { horizontal = 0; interlace = 0; diff --git a/cinelerra-5.1/plugins/sharpen/sharpen.h b/cinelerra-5.1/plugins/sharpen/sharpen.h index a58523a4..b6aefd56 100644 --- a/cinelerra-5.1/plugins/sharpen/sharpen.h +++ b/cinelerra-5.1/plugins/sharpen/sharpen.h @@ -44,6 +44,7 @@ public: void copy_from(SharpenConfig &that); int equivalent(SharpenConfig &that); + void reset(); void interpolate(SharpenConfig &prev, SharpenConfig &next, long prev_frame, diff --git a/cinelerra-5.1/plugins/sharpen/sharpenwindow.C b/cinelerra-5.1/plugins/sharpen/sharpenwindow.C index bbe0f519..310128f8 100644 --- a/cinelerra-5.1/plugins/sharpen/sharpenwindow.C +++ b/cinelerra-5.1/plugins/sharpen/sharpenwindow.C @@ -33,7 +33,7 @@ SharpenWindow::SharpenWindow(SharpenMain *client) - : PluginClientWindow(client, 230, 150, 230, 150, 0) + : PluginClientWindow(client, 230, 195, 230, 195, 0) //195 was 150 { this->client = client; } @@ -54,14 +54,19 @@ void SharpenWindow::create_objects() add_tool(sharpen_horizontal = new SharpenHorizontal(client, x, y)); y += 30; add_tool(sharpen_luminance = new SharpenLuminance(client, x, y)); + y += 40; + add_tool(reset = new SharpenReset(client, this, x, y)); show_window(); flush(); } - - - - +void SharpenWindow::update() +{ + sharpen_slider->update(client->config.sharpness); + sharpen_interlace->update(client->config.interlace); + sharpen_horizontal->update(client->config.horizontal); + sharpen_luminance->update(client->config.luminance); +} SharpenSlider::SharpenSlider(SharpenMain *client, float *output, int x, int y) : BC_ISlider(x, @@ -90,8 +95,6 @@ int SharpenSlider::handle_event() } - - SharpenInterlace::SharpenInterlace(SharpenMain *client, int x, int y) : BC_CheckBox(x, y, client->config.interlace, _("Interlace")) { @@ -108,8 +111,6 @@ int SharpenInterlace::handle_event() } - - SharpenHorizontal::SharpenHorizontal(SharpenMain *client, int x, int y) : BC_CheckBox(x, y, client->config.horizontal, _("Horizontal only")) { @@ -126,7 +127,6 @@ int SharpenHorizontal::handle_event() } - SharpenLuminance::SharpenLuminance(SharpenMain *client, int x, int y) : BC_CheckBox(x, y, client->config.luminance, _("Luminance only")) { @@ -142,3 +142,21 @@ int SharpenLuminance::handle_event() return 1; } + +SharpenReset::SharpenReset(SharpenMain *client, SharpenWindow *gui, int x, int y) + : BC_GenericButton(x, y, _("Reset")) +{ + this->client = client; + this->gui = gui; +} +SharpenReset::~SharpenReset() +{ +} +int SharpenReset::handle_event() +{ + client->config.reset(); + gui->update(); + client->send_configure_change(); + return 1; +} + diff --git a/cinelerra-5.1/plugins/sharpen/sharpenwindow.h b/cinelerra-5.1/plugins/sharpen/sharpenwindow.h index 2376fa96..6c5bffb9 100644 --- a/cinelerra-5.1/plugins/sharpen/sharpenwindow.h +++ b/cinelerra-5.1/plugins/sharpen/sharpenwindow.h @@ -39,6 +39,7 @@ class SharpenInterlace; class SharpenSlider; class SharpenHorizontal; class SharpenLuminance; +class SharpenReset; class SharpenWindow : public PluginClientWindow { @@ -47,12 +48,14 @@ public: ~SharpenWindow(); void create_objects(); + void update(); SharpenMain *client; SharpenSlider *sharpen_slider; SharpenInterlace *sharpen_interlace; SharpenHorizontal *sharpen_horizontal; SharpenLuminance *sharpen_luminance; + SharpenReset *reset; }; class SharpenSlider : public BC_ISlider @@ -96,5 +99,14 @@ public: SharpenMain *client; }; +class SharpenReset : public BC_GenericButton +{ +public: + SharpenReset(SharpenMain *client, SharpenWindow *gui, int x, int y); + ~SharpenReset(); + int handle_event(); + SharpenMain *client; + SharpenWindow *gui; +}; #endif