4 #define _(String) gettext(String)
5 #define gettext_noop(String) String
6 #define N_(String) gettext_noop (String)
9 YUVThread::YUVThread(YUVMain *client)
12 this->client = client;
13 synchronous = 1; // make thread wait for join
17 YUVThread::~YUVThread()
23 window = new YUVWindow(client);
24 window->create_objects();
35 YUVWindow::YUVWindow(YUVMain *client)
36 : BC_Window("", MEGREY, client->gui_string, 210, 170, 200, 170, 0, !client->show_initially)
37 { this->client = client; }
39 YUVWindow::~YUVWindow()
49 int YUVWindow::create_objects()
52 add_tool(new BC_Title(x, y, _("Y:")));
53 add_tool(automation[0] = new AutomatedFn(client, this, x + 80, y, 0));
55 add_tool(y_slider = new YSlider(client, x, y));
57 add_tool(new BC_Title(x, y, _("U:")));
58 add_tool(automation[1] = new AutomatedFn(client, this, x + 80, y, 1));
60 add_tool(u_slider = new USlider(client, x, y));
62 add_tool(new BC_Title(x, y, _("V:")));
63 add_tool(automation[2] = new AutomatedFn(client, this, x + 80, y, 2));
65 add_tool(v_slider = new VSlider(client, x, y));
68 int YUVWindow::close_event()
70 client->save_defaults();
72 client->send_hide_gui();
75 YSlider::YSlider(YUVMain *client, int x, int y)
76 : BC_ISlider(x, y, 190, 30, 200, client->y, -MAXVALUE, MAXVALUE, DKGREY, BLACK, 1)
78 this->client = client;
83 int YSlider::handle_event()
85 client->y = get_value();
86 client->send_configure_change();
89 USlider::USlider(YUVMain *client, int x, int y)
90 : BC_ISlider(x, y, 190, 30, 200, client->u, -MAXVALUE, MAXVALUE, DKGREY, BLACK, 1)
92 this->client = client;
97 int USlider::handle_event()
99 client->u = get_value();
100 client->send_configure_change();
103 VSlider::VSlider(YUVMain *client, int x, int y)
104 : BC_ISlider(x, y, 190, 30, 200, client->v, -MAXVALUE, MAXVALUE, DKGREY, BLACK, 1)
106 this->client = client;
111 int VSlider::handle_event()
113 client->v = get_value();
114 client->send_configure_change();
117 AutomatedFn::AutomatedFn(YUVMain *client, YUVWindow *window, int x, int y, int number)
118 : BC_CheckBox(x, y, 16, 16, client->automated_function == number, _("Automate"))
120 this->client = client;
121 this->window = window;
122 this->number = number;
125 AutomatedFn::~AutomatedFn()
129 int AutomatedFn::handle_event()
131 for(int i = 0; i < 3; i++)
133 if(i != number) window->automation[i]->update(0);
136 client->automated_function = number;
137 client->send_configure_change();