initial commit
[goodguy/history.git] / cinelerra-5.0 / cinelerra / patch.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 PATCH_H
23 #define PATCH_H
24
25 class PlayPatchOld;
26 class RecordPatchOld;
27 class TitlePatchOld;
28 class AutoPatchOld;
29 class DrawPatchOld;
30
31 #include "guicast.h"
32 #include "filexml.inc"
33 #include "mwindow.inc"
34 #include "module.inc"
35 #include "patch.inc"
36 #include "patchbay.inc"
37
38
39 // coordinates for widgets
40
41 #define PATCH_ROW2 23
42 #define PATCH_TITLE 3
43 #define PATCH_PLAY 7
44 #define PATCH_REC 27
45 #define PATCH_AUTO 47
46 #define PATCH_AUTO_TITLE 67
47 #define PATCH_DRAW 72
48 #define PATCH_DRAW_TITLE 97
49
50
51 class Patch : public ListItem<Patch>
52 {
53 public:
54         Patch() {};
55         Patch(MWindow *mwindow, PatchBay *patchbay, int data_type);
56         ~Patch();
57
58         int save(FileXML *xml);
59         int load(FileXML *xml);
60
61         void create_objects(char *text, int pixel); // linked list doesn't allow parameters in append()
62         int set_pixel(int pixel);
63         int set_title(char *new_title);
64         int flip_vertical();
65         int pixelmovement(int distance);
66
67         int pixel;      // distance from top of track window
68         int data_type;
69         int record;
70         int play;
71         int automate;
72         int draw;
73         char title[1024];
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89         PatchBay *patches;
90         MWindow *mwindow;
91
92         RecordPatchOld *recordpatch;
93         PlayPatchOld *playpatch;
94         TitlePatchOld *title_text;
95         AutoPatchOld *autopatch;
96         DrawPatchOld *drawpatch;
97         Module* get_module();    // return module of corresponding patch
98 };
99
100 class PlayPatchOld : public BC_Toggle
101 {
102 public:
103         PlayPatchOld(MWindow *mwindow, Patch *patch, int x, int y);
104         int handle_event();
105         int cursor_moved_over();
106         int button_release();
107         PatchBay *patches;
108         Patch *patch;
109 };
110
111 class RecordPatchOld : public BC_Toggle
112 {
113 public:
114         RecordPatchOld(MWindow *mwindow, Patch *patch, int x, int y);
115         int handle_event();
116         int cursor_moved_over();
117         int button_release();
118         Patch *patch;
119         PatchBay *patches;
120 };
121
122 class TitlePatchOld : public BC_TextBox
123 {
124 public:
125         TitlePatchOld(MWindow *mwindow, Patch *patch, char *text, int x, int y);
126         int handle_event();
127         Patch *patch;
128         PatchBay *patches;
129         Module *module;
130 };
131
132 class AutoPatchOld : public BC_Toggle
133 {
134 public:
135         AutoPatchOld(MWindow *mwindow, Patch *patch, int x, int y);
136         int handle_event();
137         int cursor_moved_over();
138         int button_release();
139         PatchBay *patches;
140         Patch *patch;
141 };
142
143 class DrawPatchOld : public BC_Toggle
144 {
145 public:
146         DrawPatchOld(MWindow *mwindow, Patch *patch, int x, int y);
147         int handle_event();
148         int cursor_moved_over();
149         PatchBay *patches;
150         Patch *patch;
151 };
152
153 #endif