00001 #ifndef AUTOMATION_H
00002 #define AUTOMATION_H
00003
00004 #include "arraylist.h"
00005 #include "autoconf.inc"
00006 #include "automation.inc"
00007 #include "autos.inc"
00008 #include "edl.inc"
00009 #include "filexml.inc"
00010 #include "maxchannels.h"
00011 #include "module.inc"
00012 #include "track.inc"
00013
00014 #include <stdint.h>
00015
00016
00017
00018
00019 #define AUTOMATIONCLAMPS(value, autogrouptype) \
00020 if (autogrouptype == AUTOGROUPTYPE_AUDIO_FADE && value <= INFINITYGAIN) \
00021 value = INFINITYGAIN; \
00022 if (autogrouptype == AUTOGROUPTYPE_VIDEO_FADE) \
00023 CLAMP(value, 0, 100); \
00024 if (autogrouptype == AUTOGROUPTYPE_ZOOM && value < 0) \
00025 value = 0;
00026
00027 #define AUTOMATIONVIEWCLAMPS(value, autogrouptype) \
00028 if (autogrouptype == AUTOGROUPTYPE_ZOOM && value < 0) \
00029 value = 0;
00030
00031 class Automation
00032 {
00033 public:
00034 static int autogrouptypes_fixedrange[];
00035 Automation(EDL *edl, Track *track);
00036 virtual ~Automation();
00037
00038 int autogrouptype(int autoidx, Track *track);
00039 virtual int create_objects();
00040 void equivalent_output(Automation *automation, int64_t *result);
00041 virtual Automation& operator=(Automation& automation);
00042 virtual void copy_from(Automation *automation);
00043 int load(FileXML *file);
00044
00045 int copy(int64_t start,
00046 int64_t end,
00047 FileXML *xml,
00048 int default_only,
00049 int autos_only);
00050 virtual void dump();
00051 virtual int direct_copy_possible(int64_t start, int direction);
00052 virtual int direct_copy_possible_derived(int64_t start, int direction) { return 1; };
00053
00054 int paste(int64_t start,
00055 int64_t length,
00056 double scale,
00057 FileXML *file,
00058 int default_only,
00059 AutoConf *autoconf);
00060
00061
00062 virtual void get_projector(float *x,
00063 float *y,
00064 float *z,
00065 int64_t position,
00066 int direction);
00067
00068 virtual void get_camera(float *x,
00069 float *y,
00070 float *z,
00071 int64_t position,
00072 int direction);
00073
00074
00075
00076 void clear(int64_t start,
00077 int64_t end,
00078 AutoConf *autoconf,
00079 int shift_autos);
00080 void straighten(int64_t start,
00081 int64_t end,
00082 AutoConf *autoconf);
00083 void paste_silence(int64_t start, int64_t end);
00084 void insert_track(Automation *automation,
00085 int64_t start_unit,
00086 int64_t length_units,
00087 int replace_default);
00088 void resample(double old_rate, double new_rate);
00089 int64_t get_length();
00090 virtual void get_extents(float *min,
00091 float *max,
00092 int *coords_undefined,
00093 int64_t unit_start,
00094 int64_t unit_end,
00095 int autogrouptype);
00096
00097
00098
00099
00100
00101 Autos *autos[AUTOMATION_TOTAL];
00102
00103
00104 EDL *edl;
00105 Track *track;
00106 };
00107
00108 #endif