prevent popup deactivation while button_down
[goodguy/history.git] / cinelerra-5.0 / cinelerra / automation.h
1
2 /*
3  * CINELERRA
4  * Copyright (C) 2008-2013 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 AUTOMATION_H
23 #define AUTOMATION_H
24
25 #include <stdio.h>
26 #include <stdint.h>
27
28 #include "arraylist.h"
29 #include "autoconf.inc"
30 #include "automation.inc"
31 #include "autos.inc"
32 #include "edl.inc"
33 #include "filexml.inc"
34 #include "maxchannels.h"
35 #include "module.inc"
36 #include "track.inc"
37
38 class Automation
39 {
40 public:
41         Automation(EDL *edl, Track *track);
42         virtual ~Automation();
43
44         virtual void create_objects();
45         void equivalent_output(Automation *automation, int64_t *result);
46         virtual Automation& operator=(Automation& automation);
47         virtual void copy_from(Automation *automation);
48         int load(FileXML *file);
49 // For copy automation, copy, and save
50         int copy(int64_t start, 
51                 int64_t end, 
52                 FileXML *xml, 
53                 int default_only,
54                 int active_only);
55         virtual void dump(FILE *fp);
56         virtual int direct_copy_possible(int64_t start, int direction);
57         virtual int direct_copy_possible_derived(int64_t start, int direction) { return 1; };
58 // For paste automation only
59         int paste(int64_t start, 
60                 int64_t length, 
61                 double scale,
62                 FileXML *file, 
63                 int default_only,
64                 int active_only,
65                 AutoConf *autoconf);
66
67 // Get projector coordinates if this is video automation
68         virtual void get_projector(float *x, 
69                 float *y, 
70                 float *z, 
71                 int64_t position,
72                 int direction);
73 // Get camera coordinates if this is video automation
74         virtual void get_camera(float *x, 
75                 float *y, 
76                 float *z, 
77                 int64_t position,
78                 int direction);
79
80 // Returns the point to restart background rendering at.
81 // -1 means nothing changed.
82         void clear(int64_t start, 
83                 int64_t end, 
84                 AutoConf *autoconf, 
85                 int shift_autos);
86         void set_automation_mode(int64_t start, 
87                 int64_t end,
88                 int mode, 
89                 AutoConf *autoconf);
90         void paste_silence(int64_t start, int64_t end);
91         void insert_track(Automation *automation, 
92                 int64_t start_unit, 
93 // Pad keyframes to this length.
94                 int64_t length_units,
95                 int replace_default);
96         void resample(double old_rate, double new_rate);
97         int64_t get_length();
98         virtual void get_extents(float *min, 
99                 float *max,
100                 int *coords_undefined,
101                 int64_t unit_start,
102                 int64_t unit_end);
103
104
105
106
107
108         Autos *autos[AUTOMATION_TOTAL];
109
110
111         EDL *edl;
112         Track *track;
113 };
114
115 #endif