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, 235, 100, 235, 100, 0)
39 this->client = client;
42 RGB601Window::~RGB601Window()
46 void RGB601Window::create_objects()
50 add_tool(forward = new RGB601Direction(this,
53 &client->config.direction,
55 _("RGB -> 601 compression")));
57 add_tool(reverse = new RGB601Direction(this,
60 &client->config.direction,
62 _("601 -> RGB expansion")));
68 void RGB601Window::update()
70 forward->update(client->config.direction == 1);
71 reverse->update(client->config.direction == 2);
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)
79 this->output = output;
80 this->true_value = true_value;
81 this->window = window;
83 RGB601Direction::~RGB601Direction()
87 int RGB601Direction::handle_event()
89 *output = get_value() ? true_value : 0;
91 window->client->send_configure_change();