1 #include "bcdisplayinfo.h"
2 #include "ivtcwindow.h"
6 #define _(String) gettext(String)
7 #define gettext_noop(String) String
8 #define N_(String) gettext_noop (String)
11 PLUGIN_THREAD_OBJECT(IVTCMain, IVTCThread, IVTCWindow)
18 IVTCWindow::IVTCWindow(IVTCMain *client, int x, int y)
19 : BC_Window(client->gui_string,
30 this->client = client;
33 IVTCWindow::~IVTCWindow()
37 int IVTCWindow::create_objects()
40 static char *patterns[] =
46 add_tool(new BC_Title(x, y, _("Pattern offset:")));
48 add_tool(frame_offset = new IVTCOffset(client, x, y));
50 add_tool(first_field = new IVTCFieldOrder(client, x, y));
52 add_tool(automatic = new IVTCAuto(client, x, y));
54 add_subwindow(new BC_Title(x, y, _("Pattern:")));
56 for(int i = 0; i < TOTAL_PATTERNS; i++)
58 add_subwindow(pattern[i] = new IVTCPattern(client,
68 // add_tool(new BC_Title(x, y, _("Field threshold:")));
70 // add_tool(threshold = new IVTCAutoThreshold(client, x, y));
76 WINDOW_CLOSE_EVENT(IVTCWindow)
78 IVTCOffset::IVTCOffset(IVTCMain *client, int x, int y)
83 client->config.frame_offset)
85 this->client = client;
87 IVTCOffset::~IVTCOffset()
90 int IVTCOffset::handle_event()
92 client->config.frame_offset = atol(get_text());
93 client->send_configure_change();
100 IVTCFieldOrder::IVTCFieldOrder(IVTCMain *client, int x, int y)
101 : BC_CheckBox(x, y, client->config.first_field, _("Odd field first"))
103 this->client = client;
105 IVTCFieldOrder::~IVTCFieldOrder()
108 int IVTCFieldOrder::handle_event()
110 client->config.first_field = get_value();
111 client->send_configure_change();
116 IVTCAuto::IVTCAuto(IVTCMain *client, int x, int y)
117 : BC_CheckBox(x, y, client->config.automatic, _("Automatic IVTC"))
119 this->client = client;
121 IVTCAuto::~IVTCAuto()
124 int IVTCAuto::handle_event()
126 client->config.automatic = get_value();
127 client->send_configure_change();
131 IVTCPattern::IVTCPattern(IVTCMain *client,
137 : BC_Radial(x, y, client->config.pattern == number, text)
139 this->window = window;
140 this->client = client;
141 this->number = number;
143 IVTCPattern::~IVTCPattern()
146 int IVTCPattern::handle_event()
148 for(int i = 0; i < TOTAL_PATTERNS; i++)
150 if(i != number) window->pattern[i]->update(0);
152 client->config.pattern = number;
154 client->send_configure_change();
160 IVTCAutoThreshold::IVTCAutoThreshold(IVTCMain *client, int x, int y)
161 : BC_TextBox(x, y, 190, 1, client->config.auto_threshold)
163 this->client = client;
165 IVTCAutoThreshold::~IVTCAutoThreshold()
168 int IVTCAutoThreshold::handle_event()
170 client->config.auto_threshold = atof(get_text());
171 client->send_configure_change();