Fixed initialisation of tf in file_open(). Without setting the memory to 0,
[cinelerra_cv/mob.git] / plugins / quark / quarkwindow.C
blob6b2bc12e5566b4ffac12db95abf4cf18e5996fe5
1 #include "bcdisplayinfo.h"
2 #include "quarkwindow.h"
4 #include <libintl.h>
5 #define _(String) gettext(String)
6 #define gettext_noop(String) String
7 #define N_(String) gettext_noop (String)
10 SharpenThread::SharpenThread(SharpenMain *client)
11  : Thread()
13         this->client = client;
14         set_synchronous(0);
15         gui_started.lock();
16         completion.lock();
19 SharpenThread::~SharpenThread()
21 // Window always deleted here
22         delete window;
24         
25 void SharpenThread::run()
27         BC_DisplayInfo info;
28         window = new SharpenWindow(client, 
29                 info.get_abs_cursor_x() - 105, 
30                 info.get_abs_cursor_y() - 60);
31         window->create_objects();
32         gui_started.unlock();
33         int result = window->run_window();
34         completion.unlock();
35 // Last command executed in thread
36         if(result) client->client_side_close();
44 SharpenWindow::SharpenWindow(SharpenMain *client, int x, int y)
45  : BC_Window(client->gui_string, 
46         x,
47         y,
48         210, 
49         120, 
50         210, 
51         120, 
52         0, 
53         0,
54         1)
55
56         this->client = client; 
59 SharpenWindow::~SharpenWindow()
63 int SharpenWindow::create_objects()
65         int x = 10, y = 10;
66         add_tool(new BC_Title(x, y, _("Sharpness")));
67         y += 20;
68         add_tool(sharpen_slider = new SharpenSlider(client, &(client->sharpness), x, y));
69         y += 30;
70         add_tool(sharpen_interlace = new SharpenInterlace(client, x, y));
71         y += 30;
72         add_tool(sharpen_horizontal = new SharpenHorizontal(client, x, y));
73         y += 30;
74         add_tool(sharpen_luminance = new SharpenLuminance(client, x, y));
75         show_window();
76         flush();
77         return 0;
80 int SharpenWindow::close_event()
82 // Set result to 1 to indicate a client side close
83         set_done(1);
84         return 1;
87 SharpenSlider::SharpenSlider(SharpenMain *client, float *output, int x, int y)
88  : BC_ISlider(x, 
89         y, 
90         0,
91         200, 
92         200,
93         0, 
94         MAXSHARPNESS, 
95         (int)*output, 
96         0, 
97         0, 
98         0)
100         this->client = client;
101         this->output = output;
103 SharpenSlider::~SharpenSlider()
106 int SharpenSlider::handle_event()
108         *output = get_value();
109         client->send_configure_change();
110         return 1;
116 SharpenInterlace::SharpenInterlace(SharpenMain *client, int x, int y)
117  : BC_CheckBox(x, y, client->interlace, _("Interlace"))
119         this->client = client;
121 SharpenInterlace::~SharpenInterlace()
124 int SharpenInterlace::handle_event()
126         client->interlace = get_value();
127         client->send_configure_change();
128         return 1;
134 SharpenHorizontal::SharpenHorizontal(SharpenMain *client, int x, int y)
135  : BC_CheckBox(x, y, client->horizontal, _("Horizontal only"))
137         this->client = client;
139 SharpenHorizontal::~SharpenHorizontal()
142 int SharpenHorizontal::handle_event()
144         client->horizontal = get_value();
145         client->send_configure_change();
146         return 1;
151 SharpenLuminance::SharpenLuminance(SharpenMain *client, int x, int y)
152  : BC_CheckBox(x, y, client->luminance, _("Luminance only"))
154         this->client = client;
156 SharpenLuminance::~SharpenLuminance()
159 int SharpenLuminance::handle_event()
161         client->luminance = get_value();
162         client->send_configure_change();
163         return 1;