00001 #ifndef AUTOS_H
00002 #define AUTOS_H
00003
00004
00005
00006
00007 #include "auto.h"
00008 #include "edl.inc"
00009 #include "guicast.h"
00010 #include "filexml.inc"
00011 #include "track.inc"
00012
00013 #define AUTOS_VIRTUAL_HEIGHT 160
00014
00015 class Autos : public List<Auto>
00016 {
00017 public:
00018 Autos(EDL *edl,
00019 Track *track);
00020
00021 virtual ~Autos();
00022
00023 void resample(double old_rate, double new_rate);
00024
00025 virtual void create_objects();
00026 void equivalent_output(Autos *autos, int64_t startproject, int64_t *result);
00027 void copy_from(Autos *autos);
00028 virtual Auto* new_auto();
00029
00030
00031
00032
00033
00034 Auto* get_prev_auto(int64_t position, int direction, Auto* ¤t, int use_default = 1);
00035 Auto* get_prev_auto(int direction, Auto* ¤t);
00036 Auto* get_next_auto(int64_t position, int direction, Auto* ¤t, int use_default = 1);
00037
00038 int auto_exists_for_editing(double position);
00039
00040 Auto* get_auto_at_position(double position = -1);
00041
00042
00043 Auto* get_auto_for_editing(double position = -1);
00044
00045
00046 Auto* insert_auto(int64_t position);
00047
00048
00049 Auto* insert_auto_for_editing(int64_t position);
00050 void insert_track(Autos *automation,
00051 int64_t start_unit,
00052 int64_t length_units,
00053 int replace_default);
00054 virtual int load(FileXML *xml);
00055 void paste(int64_t start,
00056 int64_t length,
00057 double scale,
00058 FileXML *file,
00059 int default_only);
00060 void remove_nonsequential(Auto *keyframe);
00061 void optimize();
00062
00063
00064 int get_type();
00065 int64_t get_length();
00066 virtual void get_extents(float *min,
00067 float *max,
00068 int *coords_undefined,
00069 int64_t unit_start,
00070 int64_t unit_end);
00071
00072 EDL *edl;
00073 Track *track;
00074
00075
00076
00077
00078
00079 Auto *default_auto;
00080
00081 int autoidx;
00082 int autogrouptype;
00083 int type;
00084
00085
00086
00087 virtual void dump();
00088
00089
00090
00091
00092
00093
00094 int clear_all();
00095 int insert(int64_t start, int64_t end);
00096 int paste_silence(int64_t start, int64_t end);
00097 int copy(int64_t start,
00098 int64_t end,
00099 FileXML *xml,
00100 int default_only,
00101 int autos_only);
00102
00103 void clear(int64_t start,
00104 int64_t end,
00105 int shift_autos);
00106 virtual void straighten(int64_t start, int64_t end);
00107 int clear_auto(int64_t position);
00108 int save(FileXML *xml);
00109 virtual int slope_adjustment(int64_t ax, double slope);
00110 int release_auto();
00111 virtual int release_auto_derived() {};
00112 Auto* append_auto();
00113 int scale_time(float rate_scale, int scale_edits, int scale_autos, int64_t start, int64_t end);
00114
00115
00116 int get_neighbors(int64_t start, int64_t end, Auto **before, Auto **after);
00117
00118 virtual int automation_is_constant(int64_t start, int64_t end);
00119 virtual double get_automation_constant(int64_t start, int64_t end);
00120 int init_automation(int64_t &buffer_position,
00121 int64_t &input_start,
00122 int64_t &input_end,
00123 int &automate,
00124 double &constant,
00125 int64_t input_position,
00126 int64_t buffer_len,
00127 Auto **before,
00128 Auto **after,
00129 int reverse);
00130
00131 int init_slope(Auto **current_auto,
00132 double &slope_start,
00133 double &slope_value,
00134 double &slope_position,
00135 int64_t &input_start,
00136 int64_t &input_end,
00137 Auto **before,
00138 Auto **after,
00139 int reverse);
00140
00141 int get_slope(Auto **current_auto,
00142 double &slope_start,
00143 double &slope_end,
00144 double &slope_value,
00145 double &slope,
00146 int64_t buffer_len,
00147 int64_t buffer_position,
00148 int reverse);
00149
00150 int advance_slope(Auto **current_auto,
00151 double &slope_start,
00152 double &slope_value,
00153 double &slope_position,
00154 int reverse);
00155
00156 Auto* autoof(int64_t position);
00157
00158 Auto* nearest_before(int64_t position);
00159 Auto* nearest_after(int64_t position);
00160
00161 Auto *selected;
00162 int skip_selected;
00163 int64_t selected_position, selected_position_;
00164 double selected_value, selected_value_;
00165 float virtual_h;
00166 int virtual_center;
00167 int stack_number;
00168 int stack_total;
00169 };
00170
00171
00172
00173
00174
00175
00176 #endif