color coded keyframe curves, keyframe popups, cwin scrollbar fixes
[goodguy/history.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
44 class PatchGUI
45 {
46 public:
47         PatchGUI(MWindow *mwindow, 
48                 PatchBay *patchbay, 
49                 Track *track, 
50                 int x, 
51                 int y);
52         virtual ~PatchGUI();
53
54         virtual void create_objects();
55         virtual int reposition(int x, int y);
56         void toggle_behavior(int type, 
57                 int value,
58                 BC_Toggle *toggle,
59                 int *output);
60         virtual int update(int x, int y);
61         virtual void synchronize_fade(float change) {};
62         void synchronize_faders(float change, int audio, int video);
63         char* calculate_nudge_text(int *changed);
64         int64_t calculate_nudge(const char *string);
65
66         MWindow *mwindow;
67         PatchBay *patchbay;
68         Track *track;
69 // Used by update routines so non-existent track doesn't need to be dereferenced
70 // to know it doesn't match the current EDL.
71         int track_id;
72         int data_type;
73         int x, y;
74 // Don't synchronize the fader if this is true.
75         int change_source;
76
77         TitlePatch *title;
78         RecordPatch *record;
79         PlayPatch *play;
80 //      AutoPatch *automate;
81         GangPatch *gang;
82         DrawPatch *draw;
83         MutePatch *mute;
84         ExpandPatch *expand;
85         NudgePatch *nudge;
86         char string_return[BCTEXTLEN];
87 };
88
89
90
91 class PlayPatch : public BC_Toggle
92 {
93 public:
94         PlayPatch(MWindow *mwindow, PatchGUI *patch, int x, int y);
95         int button_press_event();
96         int button_release_event();
97         MWindow *mwindow;
98         PatchGUI *patch;
99 };
100
101 class RecordPatch : public BC_Toggle
102 {
103 public:
104         RecordPatch(MWindow *mwindow, PatchGUI *patch, int x, int y);
105         int button_press_event();
106         int button_release_event();
107         MWindow *mwindow;
108         PatchGUI *patch;
109 };
110
111 class TitlePatch : public BC_TextBox
112 {
113 public:
114         TitlePatch(MWindow *mwindow, PatchGUI *patch, int x, int y);
115         int handle_event();
116         MWindow *mwindow;
117         PatchGUI *patch;
118 };
119
120 class AutoPatch : public BC_Toggle
121 {
122 public:
123         AutoPatch(MWindow *mwindow, PatchGUI *patch, int x, int y);
124         int button_press_event();
125         int button_release_event();
126         MWindow *mwindow;
127         PatchGUI *patch;
128 };
129
130 class GangPatch : public BC_Toggle
131 {
132 public:
133         GangPatch(MWindow *mwindow, PatchGUI *patch, int x, int y);
134         int button_press_event();
135         int button_release_event();
136         MWindow *mwindow;
137         PatchGUI *patch;
138 };
139
140 class DrawPatch : public BC_Toggle
141 {
142 public:
143         DrawPatch(MWindow *mwindow, PatchGUI *patch, int x, int y);
144         int button_press_event();
145         int button_release_event();
146         MWindow *mwindow;
147         PatchGUI *patch;
148 };
149
150 class MutePatch : public BC_Toggle
151 {
152 public:
153         MutePatch(MWindow *mwindow, PatchGUI *patch, int x, int y);
154         int button_press_event();
155         int button_release_event();
156         MWindow *mwindow;
157         PatchGUI *patch;
158 };
159
160 class ExpandPatch : public BC_Toggle
161 {
162 public:
163         ExpandPatch(MWindow *mwindow, PatchGUI *patch, int x, int y);
164         int button_press_event();
165         int button_release_event();
166         MWindow *mwindow;
167         PatchGUI *patch;
168 };
169
170 class NudgePatch : public BC_TextBox
171 {
172 public:
173         NudgePatch(MWindow *mwindow, PatchGUI *patch, int x, int y, int w);
174         int handle_event();
175         int button_press_event();
176         void update();
177         void set_value(int64_t value);
178         int64_t calculate_increment();
179
180         MWindow *mwindow;
181         PatchGUI *patch;
182 };
183
184
185 #endif