Main Page | Class Hierarchy | Alphabetical List | Class List | Directories | File List | Class Members | File Members

keyframe.C

Go to the documentation of this file.
00001 #include "filexml.h"
00002 #include "keyframe.h"
00003 
00004 #include <stdio.h>
00005 #include <string.h>
00006 
00007 
00008 
00009 KeyFrame::KeyFrame()
00010  : Auto()
00011 {
00012         data[0] = 0;
00013 }
00014 
00015 KeyFrame::KeyFrame(EDL *edl, KeyFrames *autos)
00016  : Auto(edl, (Autos*)autos)
00017 {
00018         data[0] = 0;
00019 }
00020 KeyFrame::~KeyFrame()
00021 {
00022 }
00023 
00024 void KeyFrame::load(FileXML *file)
00025 {
00026 //printf("KeyFrame::load 1\n");
00027 // Shouldn't be necessary
00028 //      position = file->tag.get_property("POSITION", position);
00029 //printf("KeyFrame::load 1\n");
00030 
00031         file->read_text_until("/KEYFRAME", data, MESSAGESIZE);
00032 //printf("KeyFrame::load 2 data=\n%s\nend of data\n", data);
00033 }
00034 
00035 void KeyFrame::copy(int64_t start, int64_t end, FileXML *file, int default_auto)
00036 {
00037 //printf("KeyFrame::copy 1 %d\n%s\n", position - start, data);
00038         file->tag.set_title("KEYFRAME");
00039         if(default_auto)
00040                 file->tag.set_property("POSITION", 0);
00041         else
00042                 file->tag.set_property("POSITION", position - start);
00043 // default_auto converts a default auto to a normal auto
00044         if(is_default && !default_auto)
00045                 file->tag.set_property("DEFAULT", 1);
00046         file->append_tag();
00047 // Can't put newlines in because these would be reimported and resaved along
00048 // with new newlines.
00049 //      file->append_newline();
00050 
00051         file->append_text(data);
00052 //      file->append_newline();
00053 
00054         file->tag.set_title("/KEYFRAME");
00055         file->append_tag();
00056         file->append_newline();
00057 }
00058 
00059 
00060 void KeyFrame::copy_from(Auto *that)
00061 {
00062         copy_from((KeyFrame*)that);
00063 }
00064 
00065 void KeyFrame::copy_from(KeyFrame *that)
00066 {
00067         Auto::copy_from(that);
00068         KeyFrame *keyframe = (KeyFrame*)that;
00069         strcpy(data, keyframe->data);
00070         position = keyframe->position;
00071 }
00072 
00073 
00074 int KeyFrame::identical(KeyFrame *src)
00075 {
00076         return !strcasecmp(src->data, data);
00077 }
00078 
00079 
00080 int KeyFrame::operator==(Auto &that)
00081 {
00082         return identical((KeyFrame*)&that);
00083 }
00084 
00085 int KeyFrame::operator==(KeyFrame &that)
00086 {
00087         return identical(&that);
00088 }
00089 
00090 
00091 void KeyFrame::dump()
00092 {
00093         printf("     position: %lld\n", position);
00094         printf("     data: %s\n", data);
00095 }

Generated on Sun Jan 8 13:38:56 2006 for Cinelerra-svn by  doxygen 1.4.4