descratch again reworked + icons, add agingtv plugin params, add alias chkbox in...
[goodguy/history.git] / cinelerra-5.1 / plugins / aging / agingwindow.C
index 6d9770513a72099137713ea7a014d2942ec81196..9c702d7ed42610fabfd24d7b14d490adcbf72e36 100644 (file)
@@ -2,43 +2,31 @@
 /*
  * 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
- * 
+ *
  */
 
 #include "bcdisplayinfo.h"
 #include "agingwindow.h"
 #include "language.h"
 
-
-
-
-
-
-
-
-AgingWindow::AgingWindow(AgingMain *client)
- : PluginClientWindow(client, 
-       300, 
-       170, 
-       300, 
-       170, 
-       0)
-{ 
-       this->client = client; 
+AgingWindow::AgingWindow(AgingMain *plugin)
+ : PluginClientWindow(plugin, 300, 180, 300, 180, 0)
+{
+       this->plugin = plugin;
 }
 
 AgingWindow::~AgingWindow()
@@ -48,171 +36,65 @@ AgingWindow::~AgingWindow()
 void AgingWindow::create_objects()
 {
        int x = 10, y = 10;
-       add_subwindow(new BC_Title(x, y, 
-               "Film aging from EffectTV\n"
-               "Copyright (C) 2001 FUKUCHI Kentarou")
-       );
-//     
-//     y += 50;
-//     add_subwindow(color = new AgingColor(x, y, client));    
-//     
-//     y += 25;
-//     add_subwindow(scratches = new AgingScratches(x, y, client));
-//     add_subwindow(scratch_count = new AgingScratchCount(x + 100, y + 10, client));
-//     
-//     y += 25;
-//     add_subwindow(pits = new AgingPits(x, y, client));
-//     add_subwindow(pit_count = new AgingPitCount(x + 100, y + 10, client));
-//     
-//     y += 25;
-//     add_subwindow(dust = new AgingDust(x, y, client));
-//     add_subwindow(dust_count = new AgingDustCount(x + 100, y + 10, client));
-
-       show_window();
-       flush();
-}
-
+       BC_Title *title;
+       add_subwindow(title = new BC_Title(x, y, _("Aging:")));
+       y += title->get_h() + 15;
 
+       add_subwindow(color = new AgingCheckBox(this, x, y,
+               &plugin->config.colorage, _("Grain")));
+       y += color->get_h() + 5;
 
+       add_subwindow(scratches = new AgingCheckBox(this, x, y,
+               &plugin->config.scratch, _("Scratch")));
+       add_subwindow(scratch_count = new AgingISlider(this, x+100, y, 180,
+               0,SCRATCH_MAX, &plugin->config.scratch_lines));
+       y += scratches->get_h() + 5;
 
+       add_subwindow(pits = new AgingCheckBox(this, x, y,
+               &plugin->config.pits, _("Pits")));
+       add_subwindow(pit_count = new AgingISlider(this, x+100, y, 180,
+               0,100, &plugin->config.pits_interval));
+       y += pits->get_h() + 5;
 
+       add_subwindow(dust = new AgingCheckBox(this, x, y,
+               &plugin->config.dust, _("Dust")));
+       add_subwindow(dust_count = new AgingISlider(this, x+100, y, 180,
+               0,100, &plugin->config.dust_interval));
 
-
-
-AgingColor::AgingColor(int x, int y, AgingMain *plugin)
- : BC_CheckBox(x, y, plugin->config.colorage, _("Grain"))
-{
-       this->plugin = plugin;
-}
-
-int AgingColor::handle_event()
-{
-       return 1;
+       show_window(1);
 }
 
 
-
-
-
-AgingScratches::AgingScratches(int x, int y, AgingMain *plugin)
- : BC_CheckBox(x, y, plugin->config.scratch, _("Scratch"))
+AgingISlider::AgingISlider(AgingWindow *win,
+               int x, int y, int w, int min, int max, int *output)
+ : BC_ISlider(x, y, 0, w, w, min, max, *output)
 {
-       this->plugin = plugin;
+       this->win = win;
+       this->output = output;
 }
 
-int AgingScratches::handle_event()
+AgingISlider::~AgingISlider()
 {
-       return 1;
 }
 
-
-
-
-
-
-
-
-
-AgingScratchCount::AgingScratchCount(int x, int y, AgingMain *plugin)
- : BC_ISlider(x, 
-                       y,
-                       0,
-                       180, 
-                       180, 
-                       0, 
-                       SCRATCH_MAX, 
-                       plugin->config.scratch_lines)
+int AgingISlider::handle_event()
 {
-       this->plugin = plugin;
+       int ret = BC_ISlider::handle_event();
+       win->plugin->send_configure_change();
+       return ret;
 }
 
-int AgingScratchCount::handle_event()
+AgingCheckBox::AgingCheckBox(AgingWindow *win, int x, int y,
+               int *output, const char *text)
+ : BC_CheckBox(x, y, output, text)
 {
-       return 1;
+       this->win = win;
 }
 
-
-
-
-
-
-AgingPits::AgingPits(int x, int y, AgingMain *plugin)
- : BC_CheckBox(x, y, plugin->config.pits, _("Pits"))
-{
-       this->plugin = plugin;
-}
-
-int AgingPits::handle_event()
+int AgingCheckBox::handle_event()
 {
-       return 1;
+       int ret = BC_CheckBox::handle_event();
+       win->plugin->send_configure_change();
+       return ret;
 }
 
-
-
-
-
-
-AgingPitCount::AgingPitCount(int x, int y, AgingMain *plugin)
- : BC_ISlider(x, 
-                       y,
-                       0,
-                       180, 
-                       180, 
-                       0, 
-                       100, 
-                       plugin->config.pit_count)
-{
-       this->plugin = plugin;
-}
-
-int AgingPitCount::handle_event()
-{
-       return 1;
-}
-
-
-
-
-
-
-
-
-
-AgingDust::AgingDust(int x, int y, AgingMain *plugin)
- : BC_CheckBox(x, y, plugin->config.dust, _("Dust"))
-{
-       this->plugin = plugin;
-}
-
-int AgingDust::handle_event()
-{
-       return 1;
-}
-
-
-
-
-
-AgingDustCount::AgingDustCount(int x, int y, AgingMain *plugin)
- : BC_ISlider(x, 
-                       y,
-                       0,
-                       180, 
-                       180, 
-                       0, 
-                       100, 
-                       plugin->config.dust_count)
-{
-       this->plugin = plugin;
-}
-
-int AgingDustCount::handle_event()
-{
-       return 1;
-}
-
-
-
-
-
-