add auto zoombar/status color, fix 3 batchrender boobies, rotate plugin tweaks, add...
[goodguy/cinelerra.git] / cinelerra-5.1 / plugins / aging / agingwindow.C
1
2 /*
3  * CINELERRA
4  * Copyright (C) 2008 Adam Williams <broadcast at earthling dot net>
5  *
6  * This program is free software; you can redistribute it and/or modify
7  * it under the terms of the GNU General Public License as published by
8  * the Free Software Foundation; either version 2 of the License, or
9  * (at your option) any later version.
10  *
11  * This program is distributed in the hope that it will be useful,
12  * but WITHOUT ANY WARRANTY; without even the implied warranty of
13  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
14  * GNU General Public License for more details.
15  *
16  * You should have received a copy of the GNU General Public License
17  * along with this program; if not, write to the Free Software
18  * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
19  *
20  */
21
22 #include "bcdisplayinfo.h"
23 #include "agingwindow.h"
24 #include "language.h"
25
26 AgingWindow::AgingWindow(AgingMain *plugin)
27  : PluginClientWindow(plugin, 300, 180, 300, 180, 0)
28 {
29         this->plugin = plugin;
30 }
31
32 AgingWindow::~AgingWindow()
33 {
34 }
35
36 void AgingWindow::create_objects()
37 {
38         int x = 10, y = 10;
39         BC_Title *title;
40         add_subwindow(title = new BC_Title(x, y, _("Aging:")));
41         y += title->get_h() + 15;
42
43         add_subwindow(color = new AgingCheckBox(this, x, y,
44                 &plugin->config.colorage, _("Grain")));
45         y += color->get_h() + 5;
46
47         add_subwindow(scratches = new AgingCheckBox(this, x, y,
48                 &plugin->config.scratch, _("Scratch")));
49         add_subwindow(scratch_count = new AgingISlider(this, x+100, y, 180,
50                 0,SCRATCH_MAX, &plugin->config.scratch_lines));
51         y += scratches->get_h() + 5;
52
53         add_subwindow(pits = new AgingCheckBox(this, x, y,
54                 &plugin->config.pits, _("Pits")));
55         add_subwindow(pit_count = new AgingISlider(this, x+100, y, 180,
56                 0,100, &plugin->config.pits_interval));
57         y += pits->get_h() + 5;
58
59         add_subwindow(dust = new AgingCheckBox(this, x, y,
60                 &plugin->config.dust, _("Dust")));
61         add_subwindow(dust_count = new AgingISlider(this, x+100, y, 180,
62                 0,100, &plugin->config.dust_interval));
63
64         show_window(1);
65 }
66
67
68 AgingISlider::AgingISlider(AgingWindow *win,
69                 int x, int y, int w, int min, int max, int *output)
70  : BC_ISlider(x, y, 0, w, w, min, max, *output)
71 {
72         this->win = win;
73         this->output = output;
74 }
75
76 AgingISlider::~AgingISlider()
77 {
78 }
79
80 int AgingISlider::handle_event()
81 {
82         int ret = BC_ISlider::handle_event();
83         win->plugin->send_configure_change();
84         return ret;
85 }
86
87 AgingCheckBox::AgingCheckBox(AgingWindow *win, int x, int y,
88                 int *output, const char *text)
89  : BC_CheckBox(x, y, output, text)
90 {
91         this->win = win;
92 }
93
94 int AgingCheckBox::handle_event()
95 {
96         int ret = BC_CheckBox::handle_event();
97         win->plugin->send_configure_change();
98         return ret;
99 }
100