vicon placement tweak, bclistbox select fixes, new ctrl-a/s shortcuts
[goodguy/cinelerra.git] / cinelerra-5.1 / cinelerra / patchgui.h
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 #ifndef PATCHGUI_H
23 #define PATCHGUI_H
24
25 #include "guicast.h"
26 #include "mwindow.inc"
27 #include "patchbay.inc"
28 #include "intauto.inc"
29 #include "track.inc"
30
31
32
33
34 class TitlePatch;
35 class PlayPatch;
36 class RecordPatch;
37 class AutoPatch;
38 class GangPatch;
39 class DrawPatch;
40 class MutePatch;
41 class ExpandPatch;
42 class NudgePatch;
43 class MixPatch;
44
45 class PatchGUI
46 {
47 public:
48         PatchGUI(MWindow *mwindow,
49                 PatchBay *patchbay,
50                 Track *track,
51                 int x,
52                 int y);
53         virtual ~PatchGUI();
54
55         virtual void create_objects();
56         virtual int reposition(int x, int y);
57         void toggle_behavior(int type,
58                 int value,
59                 BC_Toggle *toggle,
60                 int *output);
61         virtual int update(int x, int y);
62         virtual void synchronize_fade(float change) {};
63         void synchronize_faders(float change, int audio, int video);
64         char* calculate_nudge_text(int *changed);
65         int64_t calculate_nudge(const char *string);
66
67         MWindow *mwindow;
68         PatchBay *patchbay;
69         Track *track;
70 // Used by update routines so non-existent track doesn't need to be dereferenced
71 // to know it doesn't match the current EDL.
72         int track_id;
73         int data_type, mixer;
74         int x, y;
75 // Don't synchronize the fader if this is true.
76         int change_source;
77
78         TitlePatch *title;
79         RecordPatch *record;
80         PlayPatch *play;
81 //      AutoPatch *automate;
82         GangPatch *gang;
83         DrawPatch *draw;
84         MutePatch *mute;
85         ExpandPatch *expand;
86         NudgePatch *nudge;
87         MixPatch *mix;
88         char string_return[BCTEXTLEN];
89 };
90
91
92
93 class PlayPatch : public BC_Toggle
94 {
95 public:
96         PlayPatch(MWindow *mwindow, PatchGUI *patch, int x, int y);
97         int button_press_event();
98         int button_release_event();
99         MWindow *mwindow;
100         PatchGUI *patch;
101 };
102
103 class RecordPatch : public BC_Toggle
104 {
105 public:
106         RecordPatch(MWindow *mwindow, PatchGUI *patch, int x, int y);
107         int button_press_event();
108         int button_release_event();
109         MWindow *mwindow;
110         PatchGUI *patch;
111 };
112
113 class TitlePatch : public BC_TextBox
114 {
115 public:
116         TitlePatch(MWindow *mwindow, PatchGUI *patch, int x, int y, int w);
117         int handle_event();
118         void update(const char *text);
119         MWindow *mwindow;
120         PatchGUI *patch;
121 };
122
123 class AutoPatch : public BC_Toggle
124 {
125 public:
126         AutoPatch(MWindow *mwindow, PatchGUI *patch, int x, int y);
127         int button_press_event();
128         int button_release_event();
129         MWindow *mwindow;
130         PatchGUI *patch;
131 };
132
133 class GangPatch : public BC_Toggle
134 {
135 public:
136         GangPatch(MWindow *mwindow, PatchGUI *patch, int x, int y);
137         int button_press_event();
138         int button_release_event();
139         MWindow *mwindow;
140         PatchGUI *patch;
141 };
142
143 class DrawPatch : public BC_Toggle
144 {
145 public:
146         DrawPatch(MWindow *mwindow, PatchGUI *patch, int x, int y);
147         int button_press_event();
148         int button_release_event();
149         MWindow *mwindow;
150         PatchGUI *patch;
151 };
152
153 class MutePatch : public BC_Toggle
154 {
155 public:
156         MutePatch(MWindow *mwindow, PatchGUI *patch, int x, int y);
157         int button_press_event();
158         int button_release_event();
159         MWindow *mwindow;
160         PatchGUI *patch;
161 };
162
163 class ExpandPatch : public BC_Toggle
164 {
165 public:
166         ExpandPatch(MWindow *mwindow, PatchGUI *patch, int x, int y);
167         int button_press_event();
168         int button_release_event();
169         MWindow *mwindow;
170         PatchGUI *patch;
171 };
172
173 class NudgePatch : public BC_TextBox
174 {
175 public:
176         NudgePatch(MWindow *mwindow, PatchGUI *patch, int x, int y, int w);
177         int handle_event();
178         int button_press_event();
179         void update();
180         void set_value(int64_t value);
181         int64_t calculate_increment();
182
183         MWindow *mwindow;
184         PatchGUI *patch;
185 };
186
187 class MixPatch : public BC_Toggle
188 {
189 public:
190         MixPatch(MWindow *mwindow, PatchGUI *patch, int x, int y);
191         ~MixPatch();
192         int handle_event();
193         void update(int v);
194
195         MWindow *mwindow;
196         PatchGUI *patch;
197 };
198
199
200 #endif