1 #include "bezierautos.h"
5 #include "edlsession.h"
7 #include "floatautos.h"
10 #include "maskautos.h"
11 #include "overlayframe.inc"
12 #include "transportque.inc"
13 #include "vautomation.h"
16 VAutomation::VAutomation(EDL *edl, Track *track)
17 : Automation(edl, track)
23 VAutomation::~VAutomation()
28 int VAutomation::create_objects()
30 Automation::create_objects();
31 fade_autos = new FloatAutos(edl, track, LTGREY, 0, 100, 100);
32 fade_autos->create_objects();
33 ((FloatAuto*)fade_autos->default_auto)->value = 100;
34 mode_autos = new IntAutos(edl, track);
35 mode_autos->create_objects();
36 mask_autos = new MaskAutos(edl, track);
37 mask_autos->create_objects();
38 ((IntAuto*)mode_autos->default_auto)->value = TRANSFER_NORMAL;
39 camera_autos = new BezierAutos(edl,
45 edl->session->output_w,
46 edl->session->output_h);
47 camera_autos->create_objects();
49 projector_autos = new BezierAutos(edl,
55 edl->session->output_w,
56 edl->session->output_h);
57 projector_autos->create_objects();
58 czoom_autos = new FloatAutos(edl, track, LTGREY, 0, 10, 1.0);
59 czoom_autos->create_objects();
60 ((FloatAuto*)czoom_autos->default_auto)->value = 1;
61 pzoom_autos = new FloatAutos(edl, track, LTGREY, 0, 10, 1.0);
62 pzoom_autos->create_objects();
63 ((FloatAuto*)pzoom_autos->default_auto)->value = 1;
69 int VAutomation::direct_copy_possible(int64_t start, int direction)
71 BezierAuto *before = 0, *after = 0;
72 FloatAuto *previous = 0, *next = 0;
74 int64_t end = (direction == PLAY_FORWARD) ? (start + 1) : (start - 1);
76 if(!Automation::direct_copy_possible(start, direction))
79 //printf("VAutomation::direct_copy_possible 1\n");
80 // Automation is constant
82 if(fade_autos->automation_is_constant(start, end, direction, constant))
84 //printf("VAutomation::direct_copy_possible 2 %f\n", fade_autos->get_automation_constant(start, end));
85 if(!EQUIV(constant, 100))
92 //printf("VAutomation::direct_copy_possible 3\n");
93 // Track must not be muted
94 if(mute_autos->automation_is_constant(start, end))
96 //printf("VAutomation::direct_copy_possible 4 %d\n", mute_autos->get_automation_constant(start, end));
97 if(mute_autos->get_automation_constant(start, end) > 0)
103 //printf("VAutomation::direct_copy_possible 5\n");
104 // Projector must be centered in an output channel
105 z = pzoom_autos->get_value(start, direction, previous, next);
106 if(!EQUIV(z, 1)) return 0;
108 projector_autos->get_center(x,
115 // FIXME develop channel search using track->get_projection
117 !EQUIV(y, 0)) return 0;
119 //printf("VAutomation::direct_copy_possible 6 %f %f %f\n", x, y, z);
123 // Camera must be centered
125 z = czoom_autos->get_value(start, direction, previous, next);
126 if(!EQUIV(z, 1)) return 0;
132 camera_autos->get_center(x,
140 //printf("VAutomation::direct_copy_possible 8 %f %f\n", x, y);
141 // Translation no longer used
143 !EQUIV(y, 0)) return 0;
144 //printf("VAutomation::direct_copy_possible 9\n");
146 // No mask must exist
147 //printf("VAutomation::direct_copy_possible 1\n");
148 if(mask_autos->mask_exists(start, direction))
150 //printf("VAutomation::direct_copy_possible 7\n");