r969: Render format selector: Do not change the path name when the format is changed.
[cinelerra_cv/ct.git] / plugins / polar / polarwindow.C
blobef5f191b466cc7b4b4f84584aa192f3ca4bc28dd
1 #include "polarwindow.h"
3 #include <libintl.h>
4 #define _(String) gettext(String)
5 #define gettext_noop(String) String
6 #define N_(String) gettext_noop (String)
9 PLUGIN_THREAD_OBJECT(PolarMain, PolarThread, PolarWindow)
17 PolarWindow::PolarWindow(PolarMain *client)
18  : BC_Window("", 
19         MEGREY, 
20         client->gui_string, 
21         210, 
22         120, 
23         200, 
24         120, 
25         0, 
26         !client->show_initially)
28         this->client = client; 
31 PolarWindow::~PolarWindow()
33         delete depth_slider;
34         delete angle_slider;
35         delete automation[0];
36         delete automation[1];
39 int PolarWindow::create_objects()
41         int x = 10, y = 10;
42         add_tool(new BC_Title(x, y, _("Depth")));
43         add_tool(automation[0] = new AutomatedFn(client, this, x + 80, y, 0));
44         y += 20;
45         add_tool(depth_slider = new DepthSlider(client, x, y));
46         y += 35;
47         add_tool(new BC_Title(x, y, _("Angle")));
48         add_tool(automation[1] = new AutomatedFn(client, this, x + 80, y, 1));
49         y += 20;
50         add_tool(angle_slider = new AngleSlider(client, x, y));
53 int PolarWindow::close_event()
55         client->save_defaults();
56         hide_window();
57         client->send_hide_gui();
60 DepthSlider::DepthSlider(PolarMain *client, int x, int y)
61  : BC_ISlider(x, y, 190, 30, 200, client->depth, 0, MAXDEPTH, DKGREY, BLACK, 1)
63         this->client = client;
65 DepthSlider::~DepthSlider()
68 int DepthSlider::handle_event()
70         client->depth = get_value();
71         client->send_configure_change();
74 AngleSlider::AngleSlider(PolarMain *client, int x, int y)
75  : BC_ISlider(x, y, 190, 30, 200, client->angle, 0, MAXANGLE, DKGREY, BLACK, 1)
77         this->client = client;
79 AngleSlider::~AngleSlider()
82 int AngleSlider::handle_event()
84         client->angle = get_value();
85         client->send_configure_change();
88 AutomatedFn::AutomatedFn(PolarMain *client, PolarWindow *window, int x, int y, int number)
89  : BC_CheckBox(x, y, 16, 16, client->automated_function == number, _("Automate"))
91         this->client = client;
92         this->window = window;
93         this->number = number;
96 AutomatedFn::~AutomatedFn()
100 int AutomatedFn::handle_event()
102         for(int i = 0; i < 2; i++)
103         {
104                 if(i != number) window->automation[i]->update(0);
105         }
106         update(1);
107         client->automated_function = number;
108         client->send_configure_change();