8 #include "mwindowgui.h"
10 #include "plugindialog.h"
11 #include "pluginset.h"
12 #include "mainsession.h"
14 #include "trackcanvas.h"
16 #include "transition.h"
17 #include "transitionpopup.h"
21 TransitionMenuItem::TransitionMenuItem(MWindow *mwindow, int audio, int video)
22 : BC_MenuItem("Paste Transition")
28 TransitionMenuItem::~TransitionMenuItem()
32 int TransitionMenuItem::handle_event()
37 PasteTransition::PasteTransition(MWindow *mwindow, int audio, int video)
40 this->mwindow = mwindow;
45 PasteTransition::~PasteTransition()
49 void PasteTransition::run()
65 Transition::Transition(EDL *edl, Edit *edit, char *title, long unit_length)
66 : Plugin(edl, (PluginSet*)edit->edits, title)
69 this->length = unit_length;
70 //printf("Transition::Transition %p %p %p %p\n", this, keyframes, keyframes->first, keyframes->last);
73 Transition::~Transition()
77 KeyFrame* Transition::get_keyframe()
79 return (KeyFrame*)keyframes->default_auto;
82 Transition& Transition::operator=(Transition &that)
84 //printf("Transition::operator= 1\n");
89 Plugin& Transition::operator=(Plugin &that)
91 copy_from((Transition*)&that);
95 Edit& Transition::operator=(Edit &that)
97 copy_from((Transition*)&that);
102 int Transition::operator==(Transition &that)
104 return identical(&that);
107 int Transition::operator==(Plugin &that)
109 return identical((Transition*)&that);
112 int Transition::operator==(Edit &that)
114 return identical((Transition*)&that);
118 void Transition::copy_from(Transition *that)
120 Plugin::copy_from(that);
123 int Transition::identical(Transition *that)
125 return this->length == that->length && Plugin::identical(that);
129 int Transition::reset_parameters()
134 void Transition::save_xml(FileXML *file)
136 file->append_newline();
137 file->tag.set_title("TRANSITION");
138 file->tag.set_property("TITLE", title);
139 file->tag.set_property("LENGTH", length);
143 file->tag.set_title("ON");
145 file->tag.set_title("/ON");
148 keyframes->copy(0, 0, file, 1, 0);
149 file->tag.set_title("/TRANSITION");
151 file->append_newline();
154 void Transition::load_xml(FileXML *file)
157 file->tag.get_property("TITLE", title);
158 length = file->tag.get_property("LENGTH", length);
162 result = file->read_tag();
165 if(file->tag.title_is("/TRANSITION"))
170 if(file->tag.title_is("ON"))
175 if(file->tag.title_is("KEYFRAME"))
177 keyframes->default_auto->load(file);;
185 int Transition::popup_transition(int x, int y)
187 // if(mwindow->session->tracks_vertical)
188 // mwindow->gui->transition_popup->activate_menu(this, PROGRAM_NAME ": Transition", y, x);
190 // mwindow->gui->transition_popup->activate_menu(this, PROGRAM_NAME ": Transition", x, y);
193 int Transition::update_derived()
195 // Redraw transition titles
198 int Transition::update_display()
200 // Don't draw anything during loads.
204 char* Transition::default_title()
209 void Transition::dump()
211 printf(" title: %s length: %d\n", title, length);