repair default keyframe load, tweak init default histogram threshold
[goodguy/history.git] / cinelerra-5.1 / 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         PatchBay *patches;
76         MWindow *mwindow;
77
78         RecordPatchOld *recordpatch;
79         PlayPatchOld *playpatch;
80         TitlePatchOld *title_text;
81         AutoPatchOld *autopatch;
82         DrawPatchOld *drawpatch;
83         Module* get_module();    // return module of corresponding patch
84 };
85
86 class PlayPatchOld : public BC_Toggle
87 {
88 public:
89         PlayPatchOld(MWindow *mwindow, Patch *patch, int x, int y);
90         int handle_event();
91         int cursor_moved_over();
92         int button_release();
93         PatchBay *patches;
94         Patch *patch;
95 };
96
97 class RecordPatchOld : public BC_Toggle
98 {
99 public:
100         RecordPatchOld(MWindow *mwindow, Patch *patch, int x, int y);
101         int handle_event();
102         int cursor_moved_over();
103         int button_release();
104         Patch *patch;
105         PatchBay *patches;
106 };
107
108 class TitlePatchOld : public BC_TextBox
109 {
110 public:
111         TitlePatchOld(MWindow *mwindow, Patch *patch, char *text, int x, int y);
112         int handle_event();
113         Patch *patch;
114         PatchBay *patches;
115         Module *module;
116 };
117
118 class AutoPatchOld : public BC_Toggle
119 {
120 public:
121         AutoPatchOld(MWindow *mwindow, Patch *patch, int x, int y);
122         int handle_event();
123         int cursor_moved_over();
124         int button_release();
125         PatchBay *patches;
126         Patch *patch;
127 };
128
129 class DrawPatchOld : public BC_Toggle
130 {
131 public:
132         DrawPatchOld(MWindow *mwindow, Patch *patch, int x, int y);
133         int handle_event();
134         int cursor_moved_over();
135         PatchBay *patches;
136         Patch *patch;
137 };
138
139 #endif