colorpicker rework, cin.desktop+shortcuts+license updates, edit titlebar colors+auto...
[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,
61                 int asset_h,
62                 int64_t position,
63                 int direction,
64                 float &in_x,
65                 float &in_y,
66                 float &in_w,
67                 float &in_h,
68                 float &out_x,
69                 float &out_y,
70                 float &out_w,
71                 float &out_h);
72
73         void calculate_output_transfer(int64_t position, int direction,
74                 float &in_x, float &in_y, float &in_w, float &in_h,
75                 float &out_x, float &out_y, float &out_w, float &out_h);
76
77         int vertical_span(Theme *theme);
78
79
80
81
82
83
84
85 // ====================================== initialization
86         VTrack() {};
87         int create_derived_objs(int flash);
88
89
90 // ===================================== rendering
91
92         int get_projection(float &in_x1,
93                 float &in_y1,
94                 float &in_x2,
95                 float &in_y2,
96                 float &out_x1,
97                 float &out_y1,
98                 float &out_x2,
99                 float &out_y2,
100                 int frame_w,
101                 int frame_h,
102                 int64_t real_position,
103                 int direction);
104 // Give whether compressed data can be copied directly from the track to the output file
105         int direct_copy_possible(int64_t current_frame, int direction, int use_nudge);
106
107
108 // ===================================== editing
109
110         int copy_derived(int64_t start, int64_t end, FileXML *xml);
111         int paste_derived(int64_t start, int64_t end, int64_t total_length, FileXML *xml, int &current_channel);
112 // use samples for paste_output
113         int paste_output(int64_t startproject, int64_t endproject, int64_t startsource, int64_t endsource, int layer, Asset *asset);
114         int clear_derived(int64_t start, int64_t end);
115         int copy_automation_derived(AutoConf *auto_conf, int64_t start, int64_t end, FileXML *xml);
116         int paste_automation_derived(int64_t start, int64_t end, int64_t total_length, FileXML *xml, int shift_autos, int &current_pan);
117         int clear_automation_derived(AutoConf *auto_conf, int64_t start, int64_t end, int shift_autos = 1);
118         int modify_handles(int64_t oldposition, int64_t newposition, int currentend);
119         int draw_autos_derived(float view_start, float zoom_units, AutoConf *auto_conf);
120         int draw_floating_autos_derived(float view_start, float zoom_units, AutoConf *auto_conf, int flash);
121         int select_auto_derived(float zoom_units, float view_start, AutoConf *auto_conf, int cursor_x, int cursor_y);
122         int move_auto_derived(float zoom_units, float view_start, AutoConf *auto_conf, int cursor_x, int cursor_y, int shift_down);
123         void translate(float offset_x, float offset_y, int do_camera);
124
125 // ===================================== for handles, titles, etc
126
127 // rounds up to integer frames for editing
128         int identical(int64_t sample1, int64_t sample2);
129 // no rounding for drawing
130 //      int get_dimensions(double &view_start,
131 //              double &view_units,
132 //              double &zoom_units);
133
134 private:
135 };
136
137 #endif