4 * Copyright (C) 2008 Adam Williams <broadcast at earthling dot net>
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.
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.
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
22 #include "bcdisplayinfo.h"
24 #include "rgb601window.h"
36 RGB601Window::RGB601Window(RGB601Main *client)
37 : PluginClientWindow(client,
44 this->client = client;
47 RGB601Window::~RGB601Window()
51 void RGB601Window::create_objects()
55 add_tool(forward = new RGB601Direction(this,
58 &client->config.direction,
60 _("RGB -> 601 compression")));
62 add_tool(reverse = new RGB601Direction(this,
65 &client->config.direction,
67 _("601 -> RGB expansion")));
73 void RGB601Window::update()
75 forward->update(client->config.direction == 1);
76 reverse->update(client->config.direction == 2);
81 RGB601Direction::RGB601Direction(RGB601Window *window, int x, int y, int *output, int true_value, char *text)
82 : BC_CheckBox(x, y, *output == true_value, text)
84 this->output = output;
85 this->true_value = true_value;
86 this->window = window;
88 RGB601Direction::~RGB601Direction()
92 int RGB601Direction::handle_event()
94 *output = get_value() ? true_value : 0;
96 window->client->send_configure_change();