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

transition.C

Go to the documentation of this file.
00001 #include "edit.h"
00002 #include "edits.h"
00003 #include "errorbox.h"
00004 #include "filexml.h"
00005 #include "keyframes.h"
00006 #include "mainundo.h"
00007 #include "mwindow.h"
00008 #include "mwindowgui.h"
00009 #include "patch.h"
00010 #include "plugindialog.h"
00011 #include "pluginset.h"
00012 #include "mainsession.h"
00013 #include "track.h"
00014 #include "trackcanvas.h"
00015 #include "tracks.h"
00016 #include "transition.h"
00017 #include "transitionpopup.h"
00018 #include <string.h>
00019 
00020 
00021 TransitionMenuItem::TransitionMenuItem(MWindow *mwindow, int audio, int video)
00022  : BC_MenuItem("Paste Transition")
00023 {
00024         this->audio = audio;
00025         this->video = video;
00026 }
00027 
00028 TransitionMenuItem::~TransitionMenuItem()
00029 {
00030 }
00031 
00032 int TransitionMenuItem::handle_event()
00033 {
00034 }
00035 
00036 
00037 PasteTransition::PasteTransition(MWindow *mwindow, int audio, int video)
00038  : Thread()
00039 {
00040         this->mwindow = mwindow;
00041         this->audio = audio;
00042         this->video = video;
00043 }
00044 
00045 PasteTransition::~PasteTransition()
00046 {
00047 }
00048 
00049 void PasteTransition::run()
00050 {
00051 }
00052 
00053 
00054 
00055 
00056 
00057 
00058 
00059 
00060 
00061 
00062 
00063 
00064 
00065 Transition::Transition(EDL *edl, Edit *edit, char *title, long unit_length)
00066  : Plugin(edl, (PluginSet*)edit->edits, title)
00067 {
00068         this->edit = edit;
00069         this->length = unit_length;
00070 //printf("Transition::Transition %p %p %p %p\n", this, keyframes, keyframes->first, keyframes->last);
00071 }
00072 
00073 Transition::~Transition()
00074 {
00075 }
00076 
00077 KeyFrame* Transition::get_keyframe()
00078 {
00079         return (KeyFrame*)keyframes->default_auto;
00080 }
00081 
00082 Transition& Transition::operator=(Transition &that)
00083 {
00084 //printf("Transition::operator= 1\n");
00085         copy_from(&that);
00086         return *this;
00087 }
00088 
00089 Plugin& Transition::operator=(Plugin &that)
00090 {
00091         copy_from((Transition*)&that);
00092         return *this;
00093 }
00094 
00095 Edit& Transition::operator=(Edit &that)
00096 {
00097         copy_from((Transition*)&that);
00098         return *this;
00099 }
00100 
00101 
00102 int Transition::operator==(Transition &that)
00103 {
00104         return identical(&that);
00105 }
00106 
00107 int Transition::operator==(Plugin &that)
00108 {
00109         return identical((Transition*)&that);
00110 }
00111 
00112 int Transition::operator==(Edit &that)
00113 {
00114         return identical((Transition*)&that);
00115 }
00116 
00117 
00118 void Transition::copy_from(Transition *that)
00119 {
00120         Plugin::copy_from(that);
00121 }
00122 
00123 int Transition::identical(Transition *that)
00124 {
00125         return this->length == that->length && Plugin::identical(that);
00126 }
00127 
00128 
00129 int Transition::reset_parameters()
00130 {
00131         return 0;
00132 }
00133 
00134 void Transition::save_xml(FileXML *file)
00135 {
00136         file->append_newline();
00137         file->tag.set_title("TRANSITION");
00138         file->tag.set_property("TITLE", title);
00139         file->tag.set_property("LENGTH", length);
00140         file->append_tag();
00141         if(on)
00142         {
00143                 file->tag.set_title("ON");
00144                 file->append_tag();
00145                 file->tag.set_title("/ON");
00146                 file->append_tag();
00147         }
00148         keyframes->copy(0, 0, file, 1, 0);
00149         file->tag.set_title("/TRANSITION");
00150         file->append_tag();
00151         file->append_newline();
00152 }
00153 
00154 void Transition::load_xml(FileXML *file)
00155 {
00156         int result = 0;
00157         file->tag.get_property("TITLE", title);
00158         length = file->tag.get_property("LENGTH", length);
00159         on = 0;
00160         
00161         do{
00162                 result = file->read_tag();
00163                 if(!result)
00164                 {
00165                         if(file->tag.title_is("/TRANSITION"))
00166                         {
00167                                 result = 1;
00168                         }
00169                         else
00170                         if(file->tag.title_is("ON"))
00171                         {
00172                                 on = 1;
00173                         }
00174                         else
00175                         if(file->tag.title_is("KEYFRAME"))
00176                         {
00177                                 keyframes->default_auto->load(file);;
00178                         }
00179                 }
00180         }while(!result);
00181 }
00182 
00183 
00184 
00185 int Transition::popup_transition(int x, int y)
00186 {
00187 //      if(mwindow->session->tracks_vertical)
00188 //              mwindow->gui->transition_popup->activate_menu(this, PROGRAM_NAME ": Transition", y, x);
00189 //      else
00190 //              mwindow->gui->transition_popup->activate_menu(this, PROGRAM_NAME ": Transition", x, y);
00191 }
00192 
00193 int Transition::update_derived()
00194 {
00195 // Redraw transition titles
00196 }
00197 
00198 int Transition::update_display()
00199 {
00200 // Don't draw anything during loads.
00201         return 0;
00202 }
00203 
00204 char* Transition::default_title()
00205 {
00206         return "Transition";
00207 }
00208 
00209 void Transition::dump()
00210 {
00211         printf("       title: %s length: %d\n", title, length);
00212 }
00213 
00214 

Generated on Sun Jan 8 13:39:01 2006 for Cinelerra-svn by  doxygen 1.4.4