r1009: Move the dependencies to newer package names
[cinelerra_cv/mob.git] / cinelerra / keyframe.C
bloba16ac1e96abf11bbac3acdc87e46390b0b88ddc7
1 #include "filexml.h"
2 #include "keyframe.h"
4 #include <stdio.h>
5 #include <string.h>
9 KeyFrame::KeyFrame()
10  : Auto()
12         data[0] = 0;
15 KeyFrame::KeyFrame(EDL *edl, KeyFrames *autos)
16  : Auto(edl, (Autos*)autos)
18         data[0] = 0;
20 KeyFrame::~KeyFrame()
24 void KeyFrame::load(FileXML *file)
26 //printf("KeyFrame::load 1\n");
27 // Shouldn't be necessary
28 //      position = file->tag.get_property("POSITION", position);
29 //printf("KeyFrame::load 1\n");
31         file->read_text_until("/KEYFRAME", data, MESSAGESIZE);
32 //printf("KeyFrame::load 2 data=\n%s\nend of data\n", data);
35 void KeyFrame::copy(int64_t start, int64_t end, FileXML *file, int default_auto)
37 //printf("KeyFrame::copy 1 %d\n%s\n", position - start, data);
38         file->tag.set_title("KEYFRAME");
39         if(default_auto)
40                 file->tag.set_property("POSITION", 0);
41         else
42                 file->tag.set_property("POSITION", position - start);
43 // default_auto converts a default auto to a normal auto
44         if(is_default && !default_auto)
45                 file->tag.set_property("DEFAULT", 1);
46         file->append_tag();
47 // Can't put newlines in because these would be reimported and resaved along
48 // with new newlines.
49 //      file->append_newline();
51         file->append_text(data);
52 //      file->append_newline();
54         file->tag.set_title("/KEYFRAME");
55         file->append_tag();
56         file->append_newline();
60 void KeyFrame::copy_from(Auto *that)
62         copy_from((KeyFrame*)that);
65 void KeyFrame::copy_from(KeyFrame *that)
67         Auto::copy_from(that);
68         KeyFrame *keyframe = (KeyFrame*)that;
69         strcpy(data, keyframe->data);
70         position = keyframe->position;
74 int KeyFrame::identical(KeyFrame *src)
76         return !strcasecmp(src->data, data);
80 int KeyFrame::operator==(Auto &that)
82         return identical((KeyFrame*)&that);
85 int KeyFrame::operator==(KeyFrame &that)
87         return identical(&that);
91 void KeyFrame::dump()
93         printf("     position: %lld\n", position);
94         printf("     data: %s\n", data);