add usb_direct for shuttle, revised shuttle again, titler tweak, transportque design...
[goodguy/cinelerra.git] / cinelerra-5.1 / cinelerra / intauto.C
1
2 /*
3  * CINELERRA
4  * Copyright (C) 2008 Adam Williams <broadcast at earthling dot net>
5  *
6  * This program is free software; you can redistribute it and/or modify
7  * it under the terms of the GNU General Public License as published by
8  * the Free Software Foundation; either version 2 of the License, or
9  * (at your option) any later version.
10  *
11  * This program is distributed in the hope that it will be useful,
12  * but WITHOUT ANY WARRANTY; without even the implied warranty of
13  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
14  * GNU General Public License for more details.
15  *
16  * You should have received a copy of the GNU General Public License
17  * along with this program; if not, write to the Free Software
18  * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
19  *
20  */
21
22 #include "edl.h"
23 #include "edlsession.h"
24 #include "filexml.h"
25 #include "intauto.h"
26 #include "intautos.h"
27
28 IntAuto::IntAuto(EDL *edl, IntAutos *autos)
29  : Auto(edl, (Autos*)autos)
30 {
31         value = 0;
32 }
33
34 IntAuto::~IntAuto()
35 {
36 }
37
38 int IntAuto::operator==(Auto &that)
39 {
40         return identical((IntAuto*)&that);
41 }
42
43 int IntAuto::operator==(IntAuto &that)
44 {
45         return identical((IntAuto*)&that);
46 }
47
48 int IntAuto::identical(IntAuto *that)
49 {
50         return that->value == value;
51 }
52
53 void IntAuto::load(FileXML *file)
54 {
55         value = file->tag.get_property("VALUE", value);
56 //printf("IntAuto::load 1 %d\n", value);
57 }
58
59 void IntAuto::copy(int64_t start, int64_t end, FileXML *file, int default_auto)
60 {
61         file->tag.set_title("AUTO");
62         if(default_auto)
63                 file->tag.set_property("POSITION", 0);
64         else
65                 file->tag.set_property("POSITION", position - start);
66         file->tag.set_property("VALUE", value);
67         file->append_tag();
68         file->tag.set_title("/AUTO");
69         file->append_tag();
70         file->append_newline();
71 }
72
73
74 void IntAuto::copy_from(Auto *that)
75 {
76         copy_from((IntAuto*)that);
77 //printf("IntAuto::copy_from(Auto *that) %d\n", value);
78 }
79
80 void IntAuto::copy_from(IntAuto *that)
81 {
82 //printf("IntAuto::copy_from(IntAuto *that) %d %d\n", value, that->value);
83         Auto::copy_from(that);
84         this->value = that->value;
85 }
86
87 int IntAuto::percentage_to_value(float percentage)
88 {
89         return percentage > .5;
90 }
91
92