r1006: configure: Use libx264_pic instead of libx264 if available.
[cinelerra_cv/mob.git] / cinelerra / intauto.C
blob11074682b50139da7bbcc493a27d1df80be61c53
1 #include "edl.h"
2 #include "edlsession.h"
3 #include "filexml.h"
4 #include "intauto.h"
5 #include "intautos.h"
7 IntAuto::IntAuto(EDL *edl, IntAutos *autos)
8  : Auto(edl, (Autos*)autos)
10         value = 0;
13 IntAuto::~IntAuto()
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");
41         if(default_auto)
42                 file->tag.set_property("POSITION", 0);
43         else
44                 file->tag.set_property("POSITION", position - start);
45         file->tag.set_property("VALUE", value);
46         file->append_tag();
47         file->tag.set_title("/AUTO");
48         file->append_tag();
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.
69         return (float)value;
72 int IntAuto::percentage_to_value(float percentage)
74         return percentage > .5;