r969: Render format selector: Do not change the path name when the format is changed.
[cinelerra_cv/ct.git] / cinelerra / automation.h
blob774e67388f526729b951b55ac6ab4de0693d7d10
1 #ifndef AUTOMATION_H
2 #define AUTOMATION_H
4 #include "arraylist.h"
5 #include "autoconf.inc"
6 #include "automation.inc"
7 #include "autos.inc"
8 #include "edl.inc"
9 #include "filexml.inc"
10 #include "maxchannels.h"
11 #include "module.inc"
12 #include "track.inc"
14 #include <stdint.h>
16 // Match the clipping at per cinelerra/virtualanode.C which contains:
17 // if(fade_value <= INFINITYGAIN) fade_value = 0;
18 // in reality, this should be matched to a user-defined minimum in the preferences
19 #define AUTOMATIONCLAMPS(value, autogrouptype) \
20 if (autogrouptype == AUTOGROUPTYPE_AUDIO_FADE && value <= INFINITYGAIN) \
21 value = INFINITYGAIN; \
22 if (autogrouptype == AUTOGROUPTYPE_VIDEO_FADE) \
23 CLAMP(value, 0, 100); \
24 if (autogrouptype == AUTOGROUPTYPE_ZOOM && value < 0) \
25 value = 0;
27 #define AUTOMATIONVIEWCLAMPS(value, autogrouptype) \
28 if (autogrouptype == AUTOGROUPTYPE_ZOOM && value < 0) \
29 value = 0;
31 class Automation
33 public:
34 static int autogrouptypes_fixedrange[];
35 Automation(EDL *edl, Track *track);
36 virtual ~Automation();
38 int autogrouptype(int autoidx, Track *track);
39 virtual int create_objects();
40 void equivalent_output(Automation *automation, int64_t *result);
41 virtual Automation& operator=(Automation& automation);
42 virtual void copy_from(Automation *automation);
43 int load(FileXML *file);
44 // For copy automation, copy, and save
45 int copy(int64_t start,
46 int64_t end,
47 FileXML *xml,
48 int default_only,
49 int autos_only);
50 virtual void dump();
51 virtual int direct_copy_possible(int64_t start, int direction);
52 virtual int direct_copy_possible_derived(int64_t start, int direction) { return 1; };
53 // For paste automation only
54 int paste(int64_t start,
55 int64_t length,
56 double scale,
57 FileXML *file,
58 int default_only,
59 AutoConf *autoconf);
61 // Get projector coordinates if this is video automation
62 virtual void get_projector(float *x,
63 float *y,
64 float *z,
65 int64_t position,
66 int direction);
67 // Get camera coordinates if this is video automation
68 virtual void get_camera(float *x,
69 float *y,
70 float *z,
71 int64_t position,
72 int direction);
74 // Returns the point to restart background rendering at.
75 // -1 means nothing changed.
76 void clear(int64_t start,
77 int64_t end,
78 AutoConf *autoconf,
79 int shift_autos);
80 void straighten(int64_t start,
81 int64_t end,
82 AutoConf *autoconf);
83 void paste_silence(int64_t start, int64_t end);
84 void insert_track(Automation *automation,
85 int64_t start_unit,
86 int64_t length_units,
87 int replace_default);
88 void resample(double old_rate, double new_rate);
89 int64_t get_length();
90 virtual void get_extents(float *min,
91 float *max,
92 int *coords_undefined,
93 int64_t unit_start,
94 int64_t unit_end,
95 int autogrouptype);
101 Autos *autos[AUTOMATION_TOTAL];
104 EDL *edl;
105 Track *track;
108 #endif