remove whitespace at eol
[goodguy/history.git] / cinelerra-5.1 / plugins / rgb601 / rgb601window.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 "language.h"
24 #include "rgb601window.h"
25
26
27
28
29
30
31
32
33
34
35
36 RGB601Window::RGB601Window(RGB601Main *client)
37  : PluginClientWindow(client, 235, 100, 235, 100, 0)
38 {
39         this->client = client;
40 }
41
42 RGB601Window::~RGB601Window()
43 {
44 }
45
46 void RGB601Window::create_objects()
47 {
48         int x = 10, y = 10;
49
50         add_tool(forward = new RGB601Direction(this,
51                 x,
52                 y,
53                 &client->config.direction,
54                 1,
55                 _("RGB -> 601 compression")));
56         y += 30;
57         add_tool(reverse = new RGB601Direction(this,
58                 x,
59                 y,
60                 &client->config.direction,
61                 2,
62                 _("601 -> RGB expansion")));
63
64         show_window();
65         flush();
66 }
67
68 void RGB601Window::update()
69 {
70         forward->update(client->config.direction == 1);
71         reverse->update(client->config.direction == 2);
72 }
73
74
75
76 RGB601Direction::RGB601Direction(RGB601Window *window, int x, int y, int *output, int true_value, char *text)
77  : BC_CheckBox(x, y, *output == true_value, text)
78 {
79         this->output = output;
80         this->true_value = true_value;
81         this->window = window;
82 }
83 RGB601Direction::~RGB601Direction()
84 {
85 }
86
87 int RGB601Direction::handle_event()
88 {
89         *output = get_value() ? true_value : 0;
90         window->update();
91         window->client->send_configure_change();
92         return 1;
93 }
94