r870: Merge 2.1:
[cinelerra_cv.git] / cinelerra / vtrack.h
blob93dfb8bd2d7d86d8ae0b6319dadcb68155f59007
1 #ifndef VTRACK_H
2 #define VTRACK_H
4 #include "arraylist.h"
5 #include "autoconf.inc"
6 #include "edl.inc"
7 #include "filexml.inc"
8 #include "floatautos.inc"
9 #include "linklist.h"
10 #include "track.h"
11 #include "vedit.inc"
12 #include "vframe.inc"
14 // CONVERTS FROM SAMPLES TO FRAMES
18 class VTrack : public Track
20 public:
21 VTrack(EDL *edl, Tracks *tracks);
22 ~VTrack();
24 int create_objects();
25 int load_defaults(BC_Hash *defaults);
26 void set_default_title();
27 PluginSet* new_plugins();
28 int is_playable(int64_t position, int direction);
29 int save_header(FileXML *file);
30 int save_derived(FileXML *file);
31 int load_header(FileXML *file, uint32_t load_flags);
32 int load_derived(FileXML *file, uint32_t load_flags);
33 int copy_settings(Track *track);
34 void synchronize_params(Track *track);
35 int64_t to_units(double position, int round);
36 double to_doubleunits(double position);
37 double from_units(int64_t position);
39 void calculate_input_transfer(Asset *asset, int64_t position, int direction,
40 float &in_x, float &in_y, float &in_w, float &in_h,
41 float &out_x, float &out_y, float &out_w, float &out_h);
43 void calculate_output_transfer(int64_t position, int direction,
44 float &in_x, float &in_y, float &in_w, float &in_h,
45 float &out_x, float &out_y, float &out_w, float &out_h);
47 int vertical_span(Theme *theme);
55 // ====================================== initialization
56 VTrack() {};
57 int create_derived_objs(int flash);
60 // ===================================== rendering
62 int get_projection(float &in_x1,
63 float &in_y1,
64 float &in_x2,
65 float &in_y2,
66 float &out_x1,
67 float &out_y1,
68 float &out_x2,
69 float &out_y2,
70 int frame_w,
71 int frame_h,
72 int64_t real_position,
73 int direction);
74 // Give whether compressed data can be copied directly from the track to the output file
75 int direct_copy_possible(int64_t current_frame, int direction, int use_nudge);
78 // ===================================== editing
80 int copy_derived(int64_t start, int64_t end, FileXML *xml);
81 int paste_derived(int64_t start, int64_t end, int64_t total_length, FileXML *xml, int &current_channel);
82 // use samples for paste_output
83 int paste_output(int64_t startproject, int64_t endproject, int64_t startsource, int64_t endsource, int layer, Asset *asset);
84 int clear_derived(int64_t start, int64_t end);
85 int copy_automation_derived(AutoConf *auto_conf, int64_t start, int64_t end, FileXML *xml);
86 int paste_automation_derived(int64_t start, int64_t end, int64_t total_length, FileXML *xml, int shift_autos, int &current_pan);
87 int clear_automation_derived(AutoConf *auto_conf, int64_t start, int64_t end, int shift_autos = 1);
88 int modify_handles(int64_t oldposition, int64_t newposition, int currentend);
89 int draw_autos_derived(float view_start, float zoom_units, AutoConf *auto_conf);
90 int draw_floating_autos_derived(float view_start, float zoom_units, AutoConf *auto_conf, int flash);
91 int select_auto_derived(float zoom_units, float view_start, AutoConf *auto_conf, int cursor_x, int cursor_y);
92 int move_auto_derived(float zoom_units, float view_start, AutoConf *auto_conf, int cursor_x, int cursor_y, int shift_down);
93 void translate(float offset_x, float offset_y, int do_camera);
95 // ===================================== for handles, titles, etc
97 // rounds up to integer frames for editing
98 int identical(int64_t sample1, int64_t sample2);
99 // no rounding for drawing
100 int get_dimensions(double &view_start,
101 double &view_units,
102 double &zoom_units);
104 private:
107 #endif