4 #define _(String) gettext(String)
5 #define gettext_noop(String) String
6 #define N_(String) gettext_noop (String)
9 HueThread::HueThread(HueMain *client)
12 this->client = client;
13 synchronous = 1; // make thread wait for join
17 HueThread::~HueThread()
23 window = new HueWindow(client);
24 window->create_objects();
35 HueWindow::HueWindow(HueMain *client)
36 : BC_Window("", MEGREY, client->gui_string, 210, 170, 200, 170, 0, !client->show_initially)
37 { this->client = client; }
39 HueWindow::~HueWindow()
42 delete saturation_slider;
49 int HueWindow::create_objects()
52 add_tool(new BC_Title(x, y, _("Hue")));
53 add_tool(automation[0] = new AutomatedFn(client, this, x + 80, y, 0));
55 add_tool(hue_slider = new HueSlider(client, x, y));
57 add_tool(new BC_Title(x, y, _("Saturation")));
58 add_tool(automation[1] = new AutomatedFn(client, this, x + 80, y, 1));
60 add_tool(saturation_slider = new SaturationSlider(client, x, y));
62 add_tool(new BC_Title(x, y, _("Value")));
63 add_tool(automation[2] = new AutomatedFn(client, this, x + 80, y, 2));
65 add_tool(value_slider = new ValueSlider(client, x, y));
68 int HueWindow::close_event()
70 client->save_defaults();
72 client->send_hide_gui();
75 HueSlider::HueSlider(HueMain *client, int x, int y)
76 : BC_ISlider(x, y, 190, 30, 200, client->hue, -MAXHUE, MAXHUE, DKGREY, BLACK, 1)
78 this->client = client;
80 HueSlider::~HueSlider()
83 int HueSlider::handle_event()
85 client->hue = get_value();
86 client->send_configure_change();
89 SaturationSlider::SaturationSlider(HueMain *client, int x, int y)
90 : BC_ISlider(x, y, 190, 30, 200, client->saturation, -MAXVALUE, MAXVALUE, DKGREY, BLACK, 1)
92 this->client = client;
94 SaturationSlider::~SaturationSlider()
97 int SaturationSlider::handle_event()
99 client->saturation = get_value();
100 client->send_configure_change();
103 ValueSlider::ValueSlider(HueMain *client, int x, int y)
104 : BC_ISlider(x, y, 190, 30, 200, client->value, -MAXVALUE, MAXVALUE, DKGREY, BLACK, 1)
106 this->client = client;
108 ValueSlider::~ValueSlider()
111 int ValueSlider::handle_event()
113 client->value = get_value();
114 client->send_configure_change();
117 AutomatedFn::AutomatedFn(HueMain *client, HueWindow *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();