1 #include "apatchgui.inc"
4 #include "edlsession.h"
8 PanAuto::PanAuto(EDL *edl, PanAutos *autos)
9 : Auto(edl, (Autos*)autos)
11 bzero(values, MAXCHANNELS * sizeof(float));
12 handle_x = handle_y = 0;
19 int PanAuto::operator==(Auto &that)
21 PanAuto *panauto = (PanAuto*)&that;
23 return handle_x == panauto->handle_x &&
24 handle_y == panauto->handle_y;
27 void PanAuto::rechannel()
29 BC_Pan::stick_to_values(values,
30 edl->session->audio_channels,
31 edl->session->achannel_positions,
38 void PanAuto::load(FileXML *file)
40 bzero(values, MAXCHANNELS * sizeof(float));
41 position = file->tag.get_property("POSITION", (int64_t)0);
42 handle_x = file->tag.get_property("HANDLE_X", (int64_t)handle_x);
43 handle_y = file->tag.get_property("HANDLE_Y", (int64_t)handle_y);
44 for(int i = 0; i < edl->session->audio_channels; i++)
46 char string[BCTEXTLEN];
47 sprintf(string, "VALUE%d", i);
48 values[i] = file->tag.get_property(string, values[i]);
52 void PanAuto::copy(int64_t start, int64_t end, FileXML *file, int default_auto)
54 file->tag.set_title("AUTO");
56 file->tag.set_property("POSITION", 0);
58 file->tag.set_property("POSITION", position - start);
59 file->tag.set_property("HANDLE_X", (int64_t)handle_x);
60 file->tag.set_property("HANDLE_Y", (int64_t)handle_y);
61 for(int i = 0; i < edl->session->audio_channels; i++)
63 char string[BCTEXTLEN];
64 sprintf(string, "VALUE%d", i);
65 file->tag.set_property(string, values[i]);
71 void PanAuto::copy_from(Auto *that)
73 Auto::copy_from(that);
75 PanAuto *pan_auto = (PanAuto*)that;
76 memcpy(this->values, pan_auto->values, MAXCHANNELS * sizeof(float));
77 this->handle_x = pan_auto->handle_x;
78 this->handle_y = pan_auto->handle_y;
83 printf(" handle_x %d\n", handle_x);
84 printf(" handle_y %d\n", handle_y);
85 for(int i = 0; i < edl->session->audio_channels; i++)
86 printf(" value %d %f\n", i, values[i]);