00001 #include "bcdisplayinfo.h"
00002 #include "language.h"
00003 #include "rgb601window.h"
00004
00005
00006
00007
00008
00009 PLUGIN_THREAD_OBJECT(RGB601Main, RGB601Thread, RGB601Window)
00010
00011
00012
00013
00014
00015
00016 RGB601Window::RGB601Window(RGB601Main *client, int x, int y)
00017 : BC_Window(client->gui_string,
00018 x,
00019 y,
00020 210,
00021 200,
00022 210,
00023 200,
00024 0,
00025 0,
00026 1)
00027 {
00028 this->client = client;
00029 }
00030
00031 RGB601Window::~RGB601Window()
00032 {
00033 }
00034
00035 int RGB601Window::create_objects()
00036 {
00037 int x = 10, y = 10;
00038
00039 add_tool(forward = new RGB601Direction(this,
00040 x,
00041 y,
00042 &client->config.direction,
00043 1,
00044 _("RGB -> 601 compression")));
00045 y += 30;
00046 add_tool(reverse = new RGB601Direction(this,
00047 x,
00048 y,
00049 &client->config.direction,
00050 2,
00051 _("601 -> RGB expansion")));
00052
00053 show_window();
00054 flush();
00055 return 0;
00056 }
00057
00058 void RGB601Window::update()
00059 {
00060 forward->update(client->config.direction == 1);
00061 reverse->update(client->config.direction == 2);
00062 }
00063
00064 WINDOW_CLOSE_EVENT(RGB601Window)
00065
00066 RGB601Direction::RGB601Direction(RGB601Window *window, int x, int y, int *output, int true_value, char *text)
00067 : BC_CheckBox(x, y, *output == true_value, text)
00068 {
00069 this->output = output;
00070 this->true_value = true_value;
00071 this->window = window;
00072 }
00073 RGB601Direction::~RGB601Direction()
00074 {
00075 }
00076
00077 int RGB601Direction::handle_event()
00078 {
00079 *output = get_value() ? true_value : 0;
00080 window->update();
00081 window->client->send_configure_change();
00082 return 1;
00083 }
00084