4 * Copyright (C) 2008 Adam Williams <broadcast at earthling dot net>
6 * This program is free software; you can redistribute it and/or modify
7 * it under the terms of the GNU General Public License as published by
8 * the Free Software Foundation; either version 2 of the License, or
9 * (at your option) any later version.
11 * This program is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 * GNU General Public License for more details.
16 * You should have received a copy of the GNU General Public License
17 * along with this program; if not, write to the Free Software
18 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
22 #include "bcdisplayinfo.h"
23 #include "deinterwindow.h"
33 DeInterlaceWindow::DeInterlaceWindow(DeInterlaceMain *client)
34 : PluginClientWindow(client,
41 this->client = client;
44 DeInterlaceWindow::~DeInterlaceWindow()
48 void DeInterlaceWindow::create_objects()
51 add_tool(new BC_Title(x, y, _("Select lines to keep")));
53 add_tool(none = new DeInterlaceOption(client, this, DEINTERLACE_NONE, x, y, _("Do nothing")));
55 add_tool(odd_fields = new DeInterlaceOption(client, this, DEINTERLACE_EVEN, x, y, _("Odd lines")));
57 add_tool(even_fields = new DeInterlaceOption(client, this, DEINTERLACE_ODD, x, y, _("Even lines")));
59 add_tool(average_fields = new DeInterlaceOption(client, this, DEINTERLACE_AVG, x, y, _("Average lines")));
61 add_tool(swap_odd_fields = new DeInterlaceOption(client, this, DEINTERLACE_SWAP_ODD, x, y, _("Swap odd fields")));
63 add_tool(swap_even_fields = new DeInterlaceOption(client, this, DEINTERLACE_SWAP_EVEN, x, y, _("Swap even fields")));
65 add_tool(avg_even = new DeInterlaceOption(client, this, DEINTERLACE_AVG_EVEN, x, y, _("Average even lines")));
67 // draw_line(170, y + 5, 190, y + 5);
68 // draw_line(190, y + 5, 190, y + 70);
69 // draw_line(150, y + 70, 190, y + 70);
71 add_tool(avg_odd = new DeInterlaceOption(client, this, DEINTERLACE_AVG_ODD, x, y, _("Average odd lines")));
72 // draw_line(170, y + 5, 190, y + 5);
74 // add_tool(adaptive = new DeInterlaceAdaptive(client, x, y));
75 // add_tool(threshold = new DeInterlaceThreshold(client, x + 100, y));
77 // char string[BCTEXTLEN];
78 // get_status_string(string, 0);
79 // add_tool(status = new BC_Title(x, y, string));
84 void DeInterlaceWindow::get_status_string(char *string, int changed_rows)
86 sprintf(string, _("Changed rows: %d\n"), changed_rows);
89 int DeInterlaceWindow::set_mode(int mode, int recursive)
91 none->update(mode == DEINTERLACE_NONE);
92 odd_fields->update(mode == DEINTERLACE_EVEN);
93 even_fields->update(mode == DEINTERLACE_ODD);
94 average_fields->update(mode == DEINTERLACE_AVG);
95 swap_odd_fields->update(mode == DEINTERLACE_SWAP_ODD);
96 swap_even_fields->update(mode == DEINTERLACE_SWAP_EVEN);
97 avg_even->update(mode == DEINTERLACE_AVG_EVEN);
98 avg_odd->update(mode == DEINTERLACE_AVG_ODD);
100 client->config.mode = mode;
103 client->send_configure_change();
108 DeInterlaceOption::DeInterlaceOption(DeInterlaceMain *client,
109 DeInterlaceWindow *window,
114 : BC_Radial(x, y, client->config.mode == output, text)
116 this->client = client;
117 this->window = window;
118 this->output = output;
121 DeInterlaceOption::~DeInterlaceOption()
124 int DeInterlaceOption::handle_event()
126 window->set_mode(output, 0);
131 // DeInterlaceAdaptive::DeInterlaceAdaptive(DeInterlaceMain *client, int x, int y)
132 // : BC_CheckBox(x, y, client->config.adaptive, _("Adaptive"))
134 // this->client = client;
136 // int DeInterlaceAdaptive::handle_event()
138 // client->config.adaptive = get_value();
139 // client->send_configure_change();
145 // DeInterlaceThreshold::DeInterlaceThreshold(DeInterlaceMain *client, int x, int y)
146 // : BC_IPot(x, y, client->config.threshold, 0, 100)
148 // this->client = client;
150 // int DeInterlaceThreshold::handle_event()
152 // client->config.threshold = get_value();
153 // client->send_configure_change();