4 * Copyright (C) 2008 Adam Williams <broadcast at earthling dot net>
5 * Copyright (C) 2003-2016 Cinelerra CV contributors
7 * This program is free software; you can redistribute it and/or modify
8 * it under the terms of the GNU General Public License as published by
9 * the Free Software Foundation; either version 2 of the License, or
10 * (at your option) any later version.
12 * This program is distributed in the hope that it will be useful,
13 * but WITHOUT ANY WARRANTY; without even the implied warranty of
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 * GNU General Public License for more details.
17 * You should have received a copy of the GNU General Public License
18 * along with this program; if not, write to the Free Software
19 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
24 #include "edlsession.h"
29 IntAuto::IntAuto(EDL *edl, IntAutos *autos)
30 : Auto(edl, (Autos*)autos)
39 int IntAuto::operator==(Auto &that)
41 return identical((IntAuto*)&that);
44 int IntAuto::operator==(IntAuto &that)
46 return identical((IntAuto*)&that);
49 int IntAuto::identical(IntAuto *that)
51 return that->value == value;
54 void IntAuto::load(FileXML *file)
56 value = file->tag.get_property("VALUE", value);
57 //printf("IntAuto::load 1 %d\n", value);
60 void IntAuto::copy(int64_t start, int64_t end, FileXML *file, int default_auto)
62 file->tag.set_title("AUTO");
64 file->tag.set_property("POSITION", 0);
66 file->tag.set_property("POSITION", position - start);
67 file->tag.set_property("VALUE", value);
69 file->tag.set_title("/AUTO");
71 file->append_newline();
75 void IntAuto::copy_from(Auto *that)
77 copy_from((IntAuto*)that);
78 //printf("IntAuto::copy_from(Auto *that) %d\n", value);
81 void IntAuto::copy_from(IntAuto *that)
83 //printf("IntAuto::copy_from(IntAuto *that) %d %d\n", value, that->value);
84 Auto::copy_from(that);
85 this->value = that->value;
88 int IntAuto::percentage_to_value(float percentage)
90 return percentage > .5;