r125: This commit was manufactured by cvs2svn to create tag 'r1_1_7-last'.
[cinelerra_cv/mob.git] / hvirtual / plugins / ivtc / ivtcwindow.C
blobc1f572a0d10c11a4d64233779aa889633510bbec
1 #include "bcdisplayinfo.h"
2 #include "ivtcwindow.h"
5 #include <libintl.h>
6 #define _(String) gettext(String)
7 #define gettext_noop(String) String
8 #define N_(String) gettext_noop (String)
11 PLUGIN_THREAD_OBJECT(IVTCMain, IVTCThread, IVTCWindow)
18 IVTCWindow::IVTCWindow(IVTCMain *client, int x, int y)
19  : BC_Window(client->gui_string, 
20         x,
21         y,
22         210, 
23         200, 
24         210, 
25         200, 
26         0, 
27         0,
28         1)
29
30         this->client = client; 
33 IVTCWindow::~IVTCWindow()
37 int IVTCWindow::create_objects()
39         int x = 10, y = 10;
40         static char *patterns[] = 
41         {
42                 "A  B  BC  CD  D",
43                 "AB  BC  CD  DE  EF"
44         };
45         
46         add_tool(new BC_Title(x, y, _("Pattern offset:")));
47         y += 20;
48         add_tool(frame_offset = new IVTCOffset(client, x, y));
49         y += 30;
50         add_tool(first_field = new IVTCFieldOrder(client, x, y));
51         y += 30;
52         add_tool(automatic = new IVTCAuto(client, x, y));
53         y += 40;
54         add_subwindow(new BC_Title(x, y, _("Pattern:")));
55         y += 20;
56         for(int i = 0; i < TOTAL_PATTERNS; i++)
57         {
58                 add_subwindow(pattern[i] = new IVTCPattern(client, 
59                         this, 
60                         i, 
61                         patterns[i], 
62                         x, 
63                         y));
64                 y += 20;
65         }
66         
67 //      y += 30;
68 //      add_tool(new BC_Title(x, y, _("Field threshold:")));
69 //      y += 20;
70 //      add_tool(threshold = new IVTCAutoThreshold(client, x, y));
71         show_window();
72         flush();
73         return 0;
76 WINDOW_CLOSE_EVENT(IVTCWindow)
78 IVTCOffset::IVTCOffset(IVTCMain *client, int x, int y)
79  : BC_TextBox(x, 
80         y, 
81         190,
82         1, 
83         client->config.frame_offset)
85         this->client = client;
87 IVTCOffset::~IVTCOffset()
90 int IVTCOffset::handle_event()
92         client->config.frame_offset = atol(get_text());
93         client->send_configure_change();
94         return 1;
100 IVTCFieldOrder::IVTCFieldOrder(IVTCMain *client, int x, int y)
101  : BC_CheckBox(x, y, client->config.first_field, _("Odd field first"))
103         this->client = client;
105 IVTCFieldOrder::~IVTCFieldOrder()
108 int IVTCFieldOrder::handle_event()
110         client->config.first_field = get_value();
111         client->send_configure_change();
112         return 1;
116 IVTCAuto::IVTCAuto(IVTCMain *client, int x, int y)
117  : BC_CheckBox(x, y, client->config.automatic, _("Automatic IVTC"))
119         this->client = client;
121 IVTCAuto::~IVTCAuto()
124 int IVTCAuto::handle_event()
126         client->config.automatic = get_value();
127         client->send_configure_change();
128         return 1;
131 IVTCPattern::IVTCPattern(IVTCMain *client, 
132         IVTCWindow *window, 
133         int number, 
134         char *text, 
135         int x, 
136         int y)
137  : BC_Radial(x, y, client->config.pattern == number, text)
139         this->window = window;
140         this->client = client;
141         this->number = number;
143 IVTCPattern::~IVTCPattern()
146 int IVTCPattern::handle_event()
148         for(int i = 0; i < TOTAL_PATTERNS; i++)
149         {
150                 if(i != number) window->pattern[i]->update(0);
151         }
152         client->config.pattern = number;
153         update(1);
154         client->send_configure_change();
155         return 1;
160 IVTCAutoThreshold::IVTCAutoThreshold(IVTCMain *client, int x, int y)
161  : BC_TextBox(x, y, 190, 1, client->config.auto_threshold)
163         this->client = client;
165 IVTCAutoThreshold::~IVTCAutoThreshold()
168 int IVTCAutoThreshold::handle_event()
170         client->config.auto_threshold = atof(get_text());
171         client->send_configure_change();
172         return 1;