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 int ys10 = yS(10), ys25 = yS(25);
52 int x = xs10, y = ys10;
53 add_tool(new BC_Title(x, y, _("Select lines to keep")));
55 add_tool(none = new DeInterlaceOption(client, this, DEINTERLACE_NONE, x, y, _("Do nothing")));
57 add_tool(odd_fields = new DeInterlaceOption(client, this, DEINTERLACE_EVEN, x, y, _("Odd lines")));
59 add_tool(even_fields = new DeInterlaceOption(client, this, DEINTERLACE_ODD, x, y, _("Even lines")));
61 add_tool(average_fields = new DeInterlaceOption(client, this, DEINTERLACE_AVG, x, y, _("Average lines")));
63 add_tool(swap_odd_fields = new DeInterlaceOption(client, this, DEINTERLACE_SWAP_ODD, x, y, _("Swap odd fields")));
65 add_tool(swap_even_fields = new DeInterlaceOption(client, this, DEINTERLACE_SWAP_EVEN, x, y, _("Swap even fields")));
67 add_tool(avg_even = new DeInterlaceOption(client, this, DEINTERLACE_AVG_EVEN, x, y, _("Average even lines")));
69 // draw_line(170, y + 5, 190, y + 5);
70 // draw_line(190, y + 5, 190, y + 70);
71 // draw_line(150, y + 70, 190, y + 70);
73 add_tool(avg_odd = new DeInterlaceOption(client, this, DEINTERLACE_AVG_ODD, x, y, _("Average odd lines")));
74 // draw_line(170, y + 5, 190, y + 5);
76 // add_tool(adaptive = new DeInterlaceAdaptive(client, x, y));
77 // add_tool(threshold = new DeInterlaceThreshold(client, x + 100, y));
79 // char string[BCTEXTLEN];
80 // get_status_string(string, 0);
81 // add_tool(status = new BC_Title(x, y, string));
86 void DeInterlaceWindow::get_status_string(char *string, int changed_rows)
88 sprintf(string, _("Changed rows: %d\n"), changed_rows);
91 int DeInterlaceWindow::set_mode(int mode, int recursive)
93 none->update(mode == DEINTERLACE_NONE);
94 odd_fields->update(mode == DEINTERLACE_EVEN);
95 even_fields->update(mode == DEINTERLACE_ODD);
96 average_fields->update(mode == DEINTERLACE_AVG);
97 swap_odd_fields->update(mode == DEINTERLACE_SWAP_ODD);
98 swap_even_fields->update(mode == DEINTERLACE_SWAP_EVEN);
99 avg_even->update(mode == DEINTERLACE_AVG_EVEN);
100 avg_odd->update(mode == DEINTERLACE_AVG_ODD);
102 client->config.mode = mode;
105 client->send_configure_change();
110 DeInterlaceOption::DeInterlaceOption(DeInterlaceMain *client,
111 DeInterlaceWindow *window,
116 : BC_Radial(x, y, client->config.mode == output, text)
118 this->client = client;
119 this->window = window;
120 this->output = output;
123 DeInterlaceOption::~DeInterlaceOption()
126 int DeInterlaceOption::handle_event()
128 window->set_mode(output, 0);
133 // DeInterlaceAdaptive::DeInterlaceAdaptive(DeInterlaceMain *client, int x, int y)
134 // : BC_CheckBox(x, y, client->config.adaptive, _("Adaptive"))
136 // this->client = client;
138 // int DeInterlaceAdaptive::handle_event()
140 // client->config.adaptive = get_value();
141 // client->send_configure_change();
147 // DeInterlaceThreshold::DeInterlaceThreshold(DeInterlaceMain *client, int x, int y)
148 // : BC_IPot(x, y, client->config.threshold, 0, 100)
150 // this->client = client;
152 // int DeInterlaceThreshold::handle_event()
154 // client->config.threshold = get_value();
155 // client->send_configure_change();