4 * Copyright (C) 2008 Adam Williams <broadcast at earthling dot net>
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.
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.
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
25 #include "arraylist.h"
26 #include "autoconf.inc"
28 #include "filexml.inc"
29 #include "floatautos.inc"
39 class VTrack : public Track
42 VTrack(EDL *edl, Tracks *tracks);
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);
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);
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);
69 int vertical_span(Theme *theme);
77 // ====================================== initialization
78 int create_derived_objs(int flash);
81 // ===================================== rendering
83 int get_projection(float &in_x1,
93 int64_t real_position,
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);
99 // ===================================== editing
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 ¤t_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 ¤t_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);
117 // ===================================== for handles, titles, etc
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);