2 #include "edlsession.h"
7 IntAuto::IntAuto(EDL *edl, IntAutos *autos)
8 : Auto(edl, (Autos*)autos)
17 int IntAuto::operator==(Auto &that)
19 return identical((IntAuto*)&that);
22 int IntAuto::operator==(IntAuto &that)
24 return identical((IntAuto*)&that);
27 int IntAuto::identical(IntAuto *that)
29 return that->value == value;
32 void IntAuto::load(FileXML *file)
34 value = file->tag.get_property("VALUE", value);
35 //printf("IntAuto::load 1 %d\n", value);
38 void IntAuto::copy(int64_t start, int64_t end, FileXML *file, int default_auto)
40 file->tag.set_title("AUTO");
42 file->tag.set_property("POSITION", 0);
44 file->tag.set_property("POSITION", position - start);
45 file->tag.set_property("VALUE", value);
47 file->tag.set_title("/AUTO");
49 file->append_newline();
53 void IntAuto::copy_from(Auto *that)
55 copy_from((IntAuto*)that);
56 //printf("IntAuto::copy_from(Auto *that) %d\n", value);
59 void IntAuto::copy_from(IntAuto *that)
61 //printf("IntAuto::copy_from(IntAuto *that) %d %d\n", value, that->value);
62 Auto::copy_from(that);
63 this->value = that->value;
66 float IntAuto::value_to_percentage()
68 // Only used for toggles so this should work.
72 int IntAuto::percentage_to_value(float percentage)
74 return percentage > .5;