1 #include "bcdisplayinfo.h"
3 #include "timeavgwindow.h"
5 PLUGIN_THREAD_OBJECT(TimeAvgMain, TimeAvgThread, TimeAvgWindow)
8 #define MAX_FRAMES 1024
11 TimeAvgWindow::TimeAvgWindow(TimeAvgMain *client, int x, int y)
12 : BC_Window(client->gui_string,
23 this->client = client;
26 TimeAvgWindow::~TimeAvgWindow()
30 int TimeAvgWindow::create_objects()
33 add_tool(new BC_Title(x, y, _("Frames to average")));
35 add_tool(total_frames = new TimeAvgSlider(client, x, y));
37 add_tool(accum = new TimeAvgAccum(client, this, x, y));
39 add_tool(avg = new TimeAvgAvg(client, this, x, y));
41 add_tool(inclusive_or = new TimeAvgOr(client, this, x, y));
43 add_tool(paranoid = new TimeAvgParanoid(client, x, y));
45 add_tool(no_subtract = new TimeAvgNoSubtract(client, x, y));
51 WINDOW_CLOSE_EVENT(TimeAvgWindow)
53 TimeAvgSlider::TimeAvgSlider(TimeAvgMain *client, int x, int y)
61 client->config.frames)
63 this->client = client;
65 TimeAvgSlider::~TimeAvgSlider()
68 int TimeAvgSlider::handle_event()
70 int result = get_value();
71 if(result < 1) result = 1;
72 client->config.frames = result;
73 client->send_configure_change();
89 TimeAvgAccum::TimeAvgAccum(TimeAvgMain *client, TimeAvgWindow *gui, int x, int y)
92 client->config.mode == TimeAvgConfig::ACCUMULATE,
95 this->client = client;
98 int TimeAvgAccum::handle_event()
100 int result = get_value();
101 client->config.mode = TimeAvgConfig::ACCUMULATE;
103 gui->inclusive_or->update(0);
104 client->send_configure_change();
112 TimeAvgAvg::TimeAvgAvg(TimeAvgMain *client, TimeAvgWindow *gui, int x, int y)
115 client->config.mode == TimeAvgConfig::AVERAGE,
118 this->client = client;
121 int TimeAvgAvg::handle_event()
123 int result = get_value();
124 client->config.mode = TimeAvgConfig::AVERAGE;
125 gui->accum->update(0);
126 gui->inclusive_or->update(0);
127 client->send_configure_change();
133 TimeAvgOr::TimeAvgOr(TimeAvgMain *client, TimeAvgWindow *gui, int x, int y)
136 client->config.mode == TimeAvgConfig::OR,
139 this->client = client;
142 int TimeAvgOr::handle_event()
144 int result = get_value();
145 client->config.mode = TimeAvgConfig::OR;
146 gui->accum->update(0);
148 client->send_configure_change();
154 TimeAvgParanoid::TimeAvgParanoid(TimeAvgMain *client, int x, int y)
157 client->config.paranoid,
158 _("Reprocess frame again"))
160 this->client = client;
162 int TimeAvgParanoid::handle_event()
164 int result = get_value();
165 client->config.paranoid = result;
166 client->send_configure_change();
174 TimeAvgNoSubtract::TimeAvgNoSubtract(TimeAvgMain *client, int x, int y)
177 client->config.nosubtract,
178 _("Disable subtraction"))
180 this->client = client;
182 int TimeAvgNoSubtract::handle_event()
184 int result = get_value();
185 client->config.nosubtract = result;
186 client->send_configure_change();