r370: Heroine Virutal's official release 1.2.1
[cinelerra_cv/mob.git] / hvirtual / plugins / timeavg / timeavgwindow.C
blobc63d9e7606ced8dbe6c39d7f1612fb0028da28d4
1 #include "bcdisplayinfo.h"
2 #include "language.h"
3 #include "timeavgwindow.h"
5 PLUGIN_THREAD_OBJECT(TimeAvgMain, TimeAvgThread, TimeAvgWindow)
11 TimeAvgWindow::TimeAvgWindow(TimeAvgMain *client, int x, int y)
12  : BC_Window(client->gui_string, 
13         x, 
14         y, 
15         210, 
16         150, 
17         200, 
18         150, 
19         0, 
20         0,
21         1)
22
23         this->client = client; 
26 TimeAvgWindow::~TimeAvgWindow()
30 int TimeAvgWindow::create_objects()
32         int x = 10, y = 10;
33         add_tool(new BC_Title(x, y, _("Frames to average")));
34         y += 20;
35         add_tool(total_frames = new TimeAvgSlider(client, x, y));
36         y += 30;
37         add_tool(accum = new TimeAvgAccum(client, this, x, y));
38         y += 30;
39         add_tool(avg = new TimeAvgAvg(client, this, x, y));
40         y += 30;
41         add_tool(paranoid = new TimeAvgParanoid(client, x, y));
42         show_window();
43         flush();
44         return 0;
47 WINDOW_CLOSE_EVENT(TimeAvgWindow)
49 TimeAvgSlider::TimeAvgSlider(TimeAvgMain *client, int x, int y)
50  : BC_ISlider(x, 
51         y, 
52         0,
53         190, 
54         200, 
55         1, 
56         256, 
57         client->config.frames)
59         this->client = client;
61 TimeAvgSlider::~TimeAvgSlider()
64 int TimeAvgSlider::handle_event()
66         int result = get_value();
67         if(result < 1) result = 1;
68         client->config.frames = result;
69         client->send_configure_change();
70         return 1;
77 TimeAvgAccum::TimeAvgAccum(TimeAvgMain *client, TimeAvgWindow *gui, int x, int y)
78  : BC_Radial(x, 
79         y, 
80         client->config.accumulate,
81         "Accumulate")
83         this->client = client;
84         this->gui = gui;
86 int TimeAvgAccum::handle_event()
88         int result = get_value();
89         client->config.accumulate = result;
90         gui->avg->update(0);
91         client->send_configure_change();
92         return 1;
99 TimeAvgAvg::TimeAvgAvg(TimeAvgMain *client, TimeAvgWindow *gui, int x, int y)
100  : BC_Radial(x, 
101         y, 
102         !client->config.accumulate,
103         "Average")
105         this->client = client;
106         this->gui = gui;
108 int TimeAvgAvg::handle_event()
110         int result = get_value();
111         client->config.accumulate = !result;
112         gui->accum->update(0);
113         client->send_configure_change();
114         return 1;
121 TimeAvgParanoid::TimeAvgParanoid(TimeAvgMain *client, int x, int y)
122  : BC_CheckBox(x, 
123         y, 
124         client->config.paranoid,
125         "Reprocess frame again")
127         this->client = client;
129 int TimeAvgParanoid::handle_event()
131         int result = get_value();
132         client->config.paranoid = result;
133         client->send_configure_change();
134         return 1;