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 handle_x = file->tag.get_property("HANDLE_X", (int64_t)handle_x);
42 handle_y = file->tag.get_property("HANDLE_Y", (int64_t)handle_y);
43 for(int i = 0; i < edl->session->audio_channels; i++)
45 char string[BCTEXTLEN];
46 sprintf(string, "VALUE%d", i);
47 values[i] = file->tag.get_property(string, values[i]);
51 void PanAuto::copy(int64_t start, int64_t end, FileXML *file, int default_auto)
53 file->tag.set_title("AUTO");
55 file->tag.set_property("POSITION", 0);
57 file->tag.set_property("POSITION", position - start);
58 file->tag.set_property("HANDLE_X", (int64_t)handle_x);
59 file->tag.set_property("HANDLE_Y", (int64_t)handle_y);
60 for(int i = 0; i < edl->session->audio_channels; i++)
62 char string[BCTEXTLEN];
63 sprintf(string, "VALUE%d", i);
64 file->tag.set_property(string, values[i]);
67 file->tag.set_title("/AUTO");
72 void PanAuto::copy_from(Auto *that)
74 Auto::copy_from(that);
76 PanAuto *pan_auto = (PanAuto*)that;
77 memcpy(this->values, pan_auto->values, MAXCHANNELS * sizeof(float));
78 this->handle_x = pan_auto->handle_x;
79 this->handle_y = pan_auto->handle_y;
84 printf(" handle_x %d\n", handle_x);
85 printf(" handle_y %d\n", handle_y);
86 for(int i = 0; i < edl->session->audio_channels; i++)
87 printf(" value %d %f\n", i, values[i]);
94 // c-file-style: "linux"