add BC_SCALE env var for hi def monitors, cleanup theme data
[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, xS(300), yS(180), xS(300), yS(180), 0)
28 {
29         this->plugin = plugin;
30 }
31
32 AgingWindow::~AgingWindow()
33 {
34 }
35
36 void AgingWindow::create_objects()
37 {
38         int xs100 = xS(100);
39         int ys5 = yS(5), ys15 = yS(15), ys180 = yS(180);
40         int x = xS(10), y = yS(10);
41         BC_Title *title;
42         add_subwindow(title = new BC_Title(x, y, _("Aging:")));
43         y += title->get_h() + ys15;
44
45         add_subwindow(color = new AgingCheckBox(this, x, y,
46                 &plugin->config.colorage, _("Grain")));
47         y += color->get_h() + ys5;
48
49         add_subwindow(scratches = new AgingCheckBox(this, x, y,
50                 &plugin->config.scratch, _("Scratch")));
51         add_subwindow(scratch_count = new AgingISlider(this, x+xs100, y, ys180,
52                 0,SCRATCH_MAX, &plugin->config.scratch_lines));
53         y += scratches->get_h() + ys5;
54
55         add_subwindow(pits = new AgingCheckBox(this, x, y,
56                 &plugin->config.pits, _("Pits")));
57         add_subwindow(pit_count = new AgingISlider(this, x+xs100, y, ys180,
58                 0,100, &plugin->config.pits_interval));
59         y += pits->get_h() + ys5;
60
61         add_subwindow(dust = new AgingCheckBox(this, x, y,
62                 &plugin->config.dust, _("Dust")));
63         add_subwindow(dust_count = new AgingISlider(this, x+xs100, y, ys180,
64                 0,100, &plugin->config.dust_interval));
65
66         show_window(1);
67 }
68
69
70 AgingISlider::AgingISlider(AgingWindow *win,
71                 int x, int y, int w, int min, int max, int *output)
72  : BC_ISlider(x, y, 0, w, w, min, max, *output)
73 {
74         this->win = win;
75         this->output = output;
76 }
77
78 AgingISlider::~AgingISlider()
79 {
80 }
81
82 int AgingISlider::handle_event()
83 {
84         int ret = BC_ISlider::handle_event();
85         win->plugin->send_configure_change();
86         return ret;
87 }
88
89 AgingCheckBox::AgingCheckBox(AgingWindow *win, int x, int y,
90                 int *output, const char *text)
91  : BC_CheckBox(x, y, output, text)
92 {
93         this->win = win;
94 }
95
96 int AgingCheckBox::handle_event()
97 {
98         int ret = BC_CheckBox::handle_event();
99         win->plugin->send_configure_change();
100         return ret;
101 }
102