r370: Heroine Virutal's official release 1.2.1
[cinelerra_cv/mob.git] / hvirtual / plugins / rgb601 / rgb601window.C
blob1b861c0a3bcbe267142099acaf033386b47cae9f
1 #include "bcdisplayinfo.h"
2 #include "language.h"
3 #include "rgb601window.h"
9 PLUGIN_THREAD_OBJECT(RGB601Main, RGB601Thread, RGB601Window)
16 RGB601Window::RGB601Window(RGB601Main *client, int x, int y)
17  : BC_Window(client->gui_string, 
18         x,
19         y,
20         210, 
21         200, 
22         210, 
23         200, 
24         0, 
25         0,
26         1)
27
28         this->client = client; 
31 RGB601Window::~RGB601Window()
35 int RGB601Window::create_objects()
37         int x = 10, y = 10;
38         
39         add_tool(forward = new RGB601Direction(this, x, y, &client->config.direction, 1, _("RGB -> 601")));
40         y += 30;
41         add_tool(reverse = new RGB601Direction(this, x, y, &client->config.direction, 2, _("601 -> RGB")));
43         show_window();
44         flush();
45         return 0;
48 void RGB601Window::update()
50         forward->update(client->config.direction == 1);
51         reverse->update(client->config.direction == 2);
54 WINDOW_CLOSE_EVENT(RGB601Window)
56 RGB601Direction::RGB601Direction(RGB601Window *window, int x, int y, int *output, int true_value, char *text)
57  : BC_CheckBox(x, y, *output == true_value, text)
59         this->output = output;
60         this->true_value = true_value;
61         this->window = window;
63 RGB601Direction::~RGB601Direction()
66         
67 int RGB601Direction::handle_event()
69         *output = get_value() ? true_value : 0;
70         window->update();
71         window->client->send_configure_change();
72         return 1;