4 #include "mwindowgui.h"
5 #include "plugindialog.h"
6 #include "resizetrackthread.h"
9 #include "trackcanvas.h"
12 #define _(String) gettext(String)
13 #define gettext_noop(String) String
14 #define N_(String) gettext_noop (String)
16 EditPopup::EditPopup(MWindow *mwindow, MWindowGUI *gui)
23 this->mwindow = mwindow;
27 EditPopup::~EditPopup()
31 void EditPopup::create_objects()
33 add_item(new EditAttachEffect(mwindow, this));
34 add_item(new EditMoveTrackUp(mwindow, this));
35 add_item(new EditMoveTrackDown(mwindow, this));
36 add_item(new EditPopupDeleteTrack(mwindow, this));
37 add_item(new EditPopupAddTrack(mwindow, this));
41 int EditPopup::update(Track *track, Edit *edit)
46 if(track->data_type == TRACK_VIDEO && !resize_option)
48 add_item(resize_option = new EditPopupResize(mwindow, this));
49 add_item(matchsize_option = new EditPopupMatchSize(mwindow, this));
52 if(track->data_type == TRACK_AUDIO && resize_option)
54 remove_item(resize_option);
55 remove_item(matchsize_option);
70 EditAttachEffect::EditAttachEffect(MWindow *mwindow, EditPopup *popup)
71 : BC_MenuItem(_("Attach effect..."))
73 this->mwindow = mwindow;
75 dialog_thread = new PluginDialogThread(mwindow);
78 EditAttachEffect::~EditAttachEffect()
83 int EditAttachEffect::handle_event()
85 dialog_thread->start_window(popup->track,
87 PROGRAM_NAME ": Attach Effect");
92 EditMoveTrackUp::EditMoveTrackUp(MWindow *mwindow, EditPopup *popup)
93 : BC_MenuItem(_("Move up"))
95 this->mwindow = mwindow;
98 EditMoveTrackUp::~EditMoveTrackUp()
101 int EditMoveTrackUp::handle_event()
103 mwindow->move_track_up(popup->track);
109 EditMoveTrackDown::EditMoveTrackDown(MWindow *mwindow, EditPopup *popup)
110 : BC_MenuItem(_("Move down"))
112 this->mwindow = mwindow;
115 EditMoveTrackDown::~EditMoveTrackDown()
118 int EditMoveTrackDown::handle_event()
120 mwindow->move_track_down(popup->track);
127 EditPopupResize::EditPopupResize(MWindow *mwindow, EditPopup *popup)
128 : BC_MenuItem(_("Resize track..."))
130 this->mwindow = mwindow;
132 dialog_thread = new ResizeTrackThread(mwindow,
133 popup->track->tracks->number_of(popup->track));
135 EditPopupResize::~EditPopupResize()
137 delete dialog_thread;
140 int EditPopupResize::handle_event()
142 dialog_thread->start_window(popup->track, popup->track->tracks->number_of(popup->track));
151 EditPopupMatchSize::EditPopupMatchSize(MWindow *mwindow, EditPopup *popup)
152 : BC_MenuItem(_("Match output size"))
154 this->mwindow = mwindow;
157 EditPopupMatchSize::~EditPopupMatchSize()
161 int EditPopupMatchSize::handle_event()
163 mwindow->match_output_size(popup->track);
173 EditPopupDeleteTrack::EditPopupDeleteTrack(MWindow *mwindow, EditPopup *popup)
174 : BC_MenuItem(_("Delete track"))
176 this->mwindow = mwindow;
179 int EditPopupDeleteTrack::handle_event()
181 mwindow->delete_track(popup->track);
190 EditPopupAddTrack::EditPopupAddTrack(MWindow *mwindow, EditPopup *popup)
191 : BC_MenuItem(_("Add track"))
193 this->mwindow = mwindow;
197 int EditPopupAddTrack::handle_event()
199 if(popup->track->data_type == TRACK_AUDIO)
200 mwindow->add_audio_track_entry(1, popup->track);
202 mwindow->add_video_track_entry(popup->track);