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
23 #include "apluginarray.h"
26 #include "edlsession.h"
29 #include "mainsession.h"
31 #include "mwindowgui.h"
32 #include "menuaeffects.h"
36 // ============================================= audio effects
38 MenuAEffects::MenuAEffects(MWindow *mwindow)
39 : MenuEffects(mwindow)
41 thread = new MenuAEffectThread(mwindow, this);
44 MenuAEffects::~MenuAEffects()
49 MenuAEffectThread::MenuAEffectThread(MWindow *mwindow, MenuAEffects *menu_item)
50 : MenuEffectThread(mwindow, menu_item)
54 MenuAEffectThread::~MenuAEffectThread()
58 int MenuAEffectThread::get_recordable_tracks(Asset *asset)
60 asset->channels = mwindow->edl->tracks->recordable_audio_tracks();
61 return asset->channels;
65 int MenuAEffectThread::get_derived_attributes(Asset *asset, BC_Hash *defaults)
67 asset->load_defaults(defaults,
76 // Fix asset for audio only
77 if(!File::renders_audio(asset)) asset->format = FILE_WAV;
78 asset->audio_data = 1;
79 asset->video_data = 0;
84 int MenuAEffectThread::save_derived_attributes(Asset *asset, BC_Hash *defaults)
86 asset->save_defaults(defaults,
98 PluginArray* MenuAEffectThread::create_plugin_array()
100 return new APluginArray();
103 int64_t MenuAEffectThread::to_units(double position, int round)
106 return Units::round(position * mwindow->edl->session->sample_rate);
108 return (int64_t)(position * mwindow->edl->session->sample_rate);
113 int MenuAEffectThread::fix_menu(char *title)
115 mwindow->gui->mainmenu->add_aeffect(title);
121 MenuAEffectItem::MenuAEffectItem(MenuAEffects *menueffect, const char *string)
122 : MenuEffectItem(menueffect, string)