a/v per track data height, boxblur power fix, add french expanders
[goodguy/cinelerra.git] / cinelerra-5.1 / cinelerra / vtrack.h
1
2 /*
3  * CINELERRA
4  * Copyright (C) 2008 Adam Williams <broadcast at earthling dot net>
5  *
6  * This program is free software; you can redistribute it and/or modify
7  * it under the terms of the GNU General Public License as published by
8  * the Free Software Foundation; either version 2 of the License, or
9  * (at your option) any later version.
10  *
11  * This program is distributed in the hope that it will be useful,
12  * but WITHOUT ANY WARRANTY; without even the implied warranty of
13  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
14  * GNU General Public License for more details.
15  *
16  * You should have received a copy of the GNU General Public License
17  * along with this program; if not, write to the Free Software
18  * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
19  *
20  */
21
22 #ifndef VTRACK_H
23 #define VTRACK_H
24
25 #include "arraylist.h"
26 #include "autoconf.inc"
27 #include "edl.inc"
28 #include "filexml.inc"
29 #include "floatautos.inc"
30 #include "linklist.h"
31 #include "track.h"
32 #include "vedit.inc"
33 #include "vframe.inc"
34
35
36
37
38
39 class VTrack : public Track
40 {
41 public:
42         VTrack(EDL *edl, Tracks *tracks);
43         ~VTrack();
44
45         void create_objects();
46         int load_defaults(BC_Hash *defaults);
47         void set_default_title();
48         PluginSet* new_plugins();
49         int is_playable(int64_t position, int direction);
50         int save_header(FileXML *file);
51         int save_derived(FileXML *file);
52         int load_header(FileXML *file, uint32_t load_flags);
53         int load_derived(FileXML *file, uint32_t load_flags);
54         int copy_settings(Track *track);
55         void synchronize_params(Track *track);
56         int64_t to_units(double position, int round);
57         double to_doubleunits(double position);
58         double from_units(int64_t position);
59
60         void calculate_input_transfer(int asset_w, int asset_h,
61                 int64_t position, int direction,
62                 float &in_x, float &in_y, float &in_w, float &in_h,
63                 float &out_x, float &out_y, float &out_w, float &out_h);
64
65         void calculate_output_transfer(int64_t position, int direction,
66                 float &in_x, float &in_y, float &in_w, float &in_h,
67                 float &out_x, float &out_y, float &out_w, float &out_h);
68
69         int vertical_span(Theme *theme);
70
71
72
73
74
75
76
77 // ====================================== initialization
78         int create_derived_objs(int flash);
79
80
81 // ===================================== rendering
82
83         int get_projection(float &in_x1,
84                 float &in_y1,
85                 float &in_x2,
86                 float &in_y2,
87                 float &out_x1,
88                 float &out_y1,
89                 float &out_x2,
90                 float &out_y2,
91                 int frame_w,
92                 int frame_h,
93                 int64_t real_position,
94                 int direction);
95 // Give whether compressed data can be copied directly from the track to the output file
96         int direct_copy_possible(int64_t current_frame, int direction, int use_nudge);
97
98
99 // ===================================== editing
100
101         int copy_derived(int64_t start, int64_t end, FileXML *xml);
102         int paste_derived(int64_t start, int64_t end, int64_t total_length, FileXML *xml, int &current_channel);
103 // use samples for paste_output
104         int paste_output(int64_t startproject, int64_t endproject, int64_t startsource, int64_t endsource, int layer, Asset *asset);
105         int clear_derived(int64_t start, int64_t end);
106         int copy_automation_derived(AutoConf *auto_conf, int64_t start, int64_t end, FileXML *xml);
107         int paste_automation_derived(int64_t start, int64_t end, int64_t total_length, FileXML *xml, int shift_autos, int &current_pan);
108         int clear_automation_derived(AutoConf *auto_conf, int64_t start, int64_t end, int shift_autos = 1);
109         int modify_handles(int64_t oldposition, int64_t newposition, int currentend);
110         int draw_autos_derived(float view_start, float zoom_units, AutoConf *auto_conf);
111         int draw_floating_autos_derived(float view_start, float zoom_units, AutoConf *auto_conf, int flash);
112         int select_auto_derived(float zoom_units, float view_start, AutoConf *auto_conf, int cursor_x, int cursor_y);
113         int move_auto_derived(float zoom_units, float view_start, AutoConf *auto_conf, int cursor_x, int cursor_y, int shift_down);
114         void set_fauto_xy(int fauto, float x, float y);
115         void translate(int fauto, float dx, float dy, int all);
116
117 // ===================================== for handles, titles, etc
118
119 // rounds up to integer frames for editing
120         int identical(int64_t sample1, int64_t sample2);
121 // no rounding for drawing
122 //      int get_dimensions(double &view_start,
123 //              double &view_units,
124 //              double &zoom_units);
125
126 private:
127 };
128
129 #endif