4 * Copyright (C) 2008 Adam Williams <broadcast at earthling dot net>
6 * This program is free software; you can redistribute it and/or modify
7 * it under the terms of the GNU General Public License as published by
8 * the Free Software Foundation; either version 2 of the License, or
9 * (at your option) any later version.
11 * This program is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 * GNU General Public License for more details.
16 * You should have received a copy of the GNU General Public License
17 * along with this program; if not, write to the Free Software
18 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
25 #include "edlsession.h"
28 #include "mainsession.h"
30 #include "mwindowgui.h"
31 #include "menuveffects.h"
33 #include "quicktime.h"
36 #include "vpluginarray.h"
39 MenuVEffects::MenuVEffects(MWindow *mwindow)
40 : MenuEffects(mwindow)
42 thread = new MenuVEffectThread(mwindow, this);
45 MenuVEffects::~MenuVEffects()
50 MenuVEffectThread::MenuVEffectThread(MWindow *mwindow, MenuVEffects *menu_item)
51 : MenuEffectThread(mwindow, menu_item)
55 MenuVEffectThread::~MenuVEffectThread()
59 int MenuVEffectThread::get_recordable_tracks(Asset *asset)
61 asset->layers = mwindow->edl->tracks->recordable_video_tracks();
65 int MenuVEffectThread::get_derived_attributes(Asset *asset, BC_Hash *defaults)
68 asset->load_defaults(defaults,
79 // Fix asset for video only
80 if(!File::supports_video(asset->format)) asset->format = FILE_MOV;
81 asset->audio_data = 0;
82 asset->video_data = 1;
89 int MenuVEffectThread::save_derived_attributes(Asset *asset, BC_Hash *defaults)
91 asset->save_defaults(defaults,
103 PluginArray* MenuVEffectThread::create_plugin_array()
105 return new VPluginArray();
108 int64_t MenuVEffectThread::to_units(double position, int round)
111 return Units::round(position * mwindow->edl->session->frame_rate);
113 return (int64_t)(position * mwindow->edl->session->frame_rate);
118 int MenuVEffectThread::fix_menu(char *title)
120 mwindow->gui->mainmenu->add_veffect(title);
124 MenuVEffectItem::MenuVEffectItem(MenuVEffects *menueffect, char *string)
125 : MenuEffectItem(menueffect, string)