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 type;
00082
00083
00084
00085 virtual void dump();
00086
00087
00088
00089
00090
00091
00092 int clear_all();
00093 int insert(int64_t start, int64_t end);
00094 int paste_silence(int64_t start, int64_t end);
00095 int copy(int64_t start,
00096 int64_t end,
00097 FileXML *xml,
00098 int default_only,
00099 int autos_only);
00100
00101 void clear(int64_t start,
00102 int64_t end,
00103 int shift_autos);
00104 int clear_auto(int64_t position);
00105 int save(FileXML *xml);
00106 virtual int slope_adjustment(int64_t ax, double slope);
00107 int release_auto();
00108 virtual int release_auto_derived() {};
00109 Auto* append_auto();
00110 int scale_time(float rate_scale, int scale_edits, int scale_autos, int64_t start, int64_t end);
00111
00112
00113 int get_neighbors(int64_t start, int64_t end, Auto **before, Auto **after);
00114
00115 virtual int automation_is_constant(int64_t start, int64_t end);
00116 virtual double get_automation_constant(int64_t start, int64_t end);
00117 int init_automation(int64_t &buffer_position,
00118 int64_t &input_start,
00119 int64_t &input_end,
00120 int &automate,
00121 double &constant,
00122 int64_t input_position,
00123 int64_t buffer_len,
00124 Auto **before,
00125 Auto **after,
00126 int reverse);
00127
00128 int init_slope(Auto **current_auto,
00129 double &slope_start,
00130 double &slope_value,
00131 double &slope_position,
00132 int64_t &input_start,
00133 int64_t &input_end,
00134 Auto **before,
00135 Auto **after,
00136 int reverse);
00137
00138 int get_slope(Auto **current_auto,
00139 double &slope_start,
00140 double &slope_end,
00141 double &slope_value,
00142 double &slope,
00143 int64_t buffer_len,
00144 int64_t buffer_position,
00145 int reverse);
00146
00147 int advance_slope(Auto **current_auto,
00148 double &slope_start,
00149 double &slope_value,
00150 double &slope_position,
00151 int reverse);
00152
00153 Auto* autoof(int64_t position);
00154
00155 Auto* nearest_before(int64_t position);
00156 Auto* nearest_after(int64_t position);
00157
00158 Auto *selected;
00159 int skip_selected;
00160 int64_t selected_position, selected_position_;
00161 double selected_value, selected_value_;
00162 float virtual_h;
00163 int virtual_center;
00164 int stack_number;
00165 int stack_total;
00166 };
00167
00168
00169
00170
00171
00172
00173 #endif