change to fixed rate refresh stratigy for vicons
[goodguy/history.git] / cinelerra-5.0 / plugins / lof / lofwindow.C
1 #include "lofwindow.h"
2 #include "language.h"
3
4 LofWindow::LofWindow(LofEffect *plugin)
5  : PluginClientWindow(plugin, 260, 160, 260, 160, 0)
6 {
7         this->plugin = plugin;
8 }
9
10 void LofWindow::create_objects()
11 {
12         int x = 10, y = 10;
13         BC_Title *title = new BC_Title(x, y, _("Show last good output frame"));
14         add_subwindow(title);  y += title->get_h() + 5;
15         title = new BC_Title(x+20, y, _("(you should fix the input)"));
16         add_subwindow(title);  y += title->get_h() + 20;
17         add_tool(errfrms = new LofToggle(this, &plugin->config.errs, x, y, _("errant frames")));
18         y += errfrms->get_h() + 5;
19         add_tool(misfrms = new LofToggle(this, &plugin->config.miss, x, y, _("missed frames")));
20         y += misfrms->get_h() + 5;
21         add_tool(mrkfrms = new LofToggle(this, &plugin->config.mark, x, y, _("mark fixed frames")));
22         show_window();
23         flush();
24 }
25
26 void LofWindow::update()
27 {
28         errfrms->update(plugin->config.errs);
29         misfrms->update(plugin->config.miss);
30         mrkfrms->update(plugin->config.mark);
31 }
32
33 LofToggle::LofToggle(LofWindow *lofwin, int *output, int x, int y, const char *lbl)
34  : BC_CheckBox(x, y, *output, lbl)
35 {
36         this->lofwin = lofwin;
37         this->output = output;
38 }
39
40 LofToggle::~LofToggle()
41 {
42 }
43
44 int LofToggle::handle_event()
45 {
46         *output = get_value();
47         lofwin->plugin->send_configure_change();
48         return 1;
49 }
50