play_off preview tweak, zoombar auto_color fix, deactivate popupmenu on click while...
[goodguy/cinelerra.git] / cinelerra-5.1 / cinelerra / apanel.C
1
2 /*
3  * CINELERRA
4  * Copyright (C) 2008 Adam Williams <broadcast at earthling dot net>
5  *
6  * This program is free software; you can redistribute it and/or modify
7  * it under the terms of the GNU General Public License as published by
8  * the Free Software Foundation; either version 2 of the License, or
9  * (at your option) any later version.
10  *
11  * This program is distributed in the hope that it will be useful,
12  * but WITHOUT ANY WARRANTY; without even the implied warranty of
13  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
14  * GNU General Public License for more details.
15  *
16  * You should have received a copy of the GNU General Public License
17  * along with this program; if not, write to the Free Software
18  * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
19  *
20  */
21
22 #include "apanel.h"
23 #include "cwindowgui.h"
24 #include "language.h"
25
26
27 APanel::APanel(MWindow *mwindow, CWindowGUI *subwindow, int x, int y, int w, int h)
28 {
29         this->mwindow = mwindow;
30         this->subwindow = subwindow;
31         this->x = x;
32         this->y = y;
33         this->w = w;
34         this->h = h;
35 }
36
37 APanel::~APanel()
38 {
39 }
40
41 void APanel::create_objects()
42 {
43         int x = this->x + 5, y = this->y + 10;
44         char string[BCTEXTLEN];
45         int x1 = x;
46
47         subwindow->add_subwindow(new BC_Title(x, y, _("Automation")));
48         y += 20;
49         for(int i = 0; i < PLUGINS; i++)
50         {
51                 sprintf(string, _("Plugin %d"), i + 1);
52                 subwindow->add_subwindow(new BC_Title(x, y, string, SMALLFONT));
53                 subwindow->add_subwindow(plugin_autos[i] = new APanelPluginAuto(mwindow, this, x, y + 20));
54                 if(x == x1)
55                 {
56                         x += plugin_autos[i]->get_w();
57                 }
58                 else
59                 {
60                         x = x1;
61                         y += plugin_autos[i]->get_h() + 20;
62                 }
63         }
64
65         subwindow->add_subwindow(mute = new APanelMute(mwindow, this, x, y));
66         y += mute->get_h();
67         subwindow->add_subwindow(play = new APanelPlay(mwindow, this, x, y));
68 }
69
70
71
72
73 APanelPluginAuto::APanelPluginAuto(MWindow *mwindow, APanel *gui, int x, int y)
74  : BC_FPot(x,
75                 y,
76                 0,
77                 -1,
78                 1)
79 {
80         this->mwindow = mwindow;
81         this->gui = gui;
82 }
83 int APanelPluginAuto::handle_event()
84 {
85         return 1;
86 }
87
88 APanelMute::APanelMute(MWindow *mwindow, APanel *gui, int x, int y)
89  : BC_CheckBox(x, y, 0, _("Mute"))
90 {
91         this->mwindow = mwindow;
92         this->gui = gui;
93 }
94 int APanelMute::handle_event()
95 {
96         return 1;
97 }
98
99
100 APanelPlay::APanelPlay(MWindow *mwindow, APanel *gui, int x, int y)
101  : BC_CheckBox(x, y, 1, _("Play"))
102 {
103         this->mwindow = mwindow;
104         this->gui = gui;
105 }
106 int APanelPlay::handle_event()
107 {
108         return 1;
109 }
110
111