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

menuaeffects.C

Go to the documentation of this file.
00001 #include "asset.h"
00002 #include "apluginarray.h"
00003 #include "defaults.h"
00004 #include "edl.h"
00005 #include "edlsession.h"
00006 #include "file.h"
00007 #include "mainmenu.h"
00008 #include "mainsession.h"
00009 #include "mwindow.h"
00010 #include "mwindowgui.h"
00011 #include "menuaeffects.h"
00012 #include "patchbay.h"
00013 #include "tracks.h"
00014 
00015 // ============================================= audio effects
00016 
00017 MenuAEffects::MenuAEffects(MWindow *mwindow)
00018  : MenuEffects(mwindow)
00019 {
00020         thread = new MenuAEffectThread(mwindow);
00021 }
00022 
00023 MenuAEffects::~MenuAEffects()
00024 {
00025         delete thread;
00026 }
00027 
00028 MenuAEffectThread::MenuAEffectThread(MWindow *mwindow)
00029  : MenuEffectThread(mwindow)
00030 {
00031 }
00032 
00033 MenuAEffectThread::~MenuAEffectThread()
00034 {
00035 }
00036 
00037 int MenuAEffectThread::get_recordable_tracks(Asset *asset)
00038 {
00039         asset->channels = mwindow->edl->tracks->recordable_audio_tracks();
00040         return asset->channels;
00041 }
00042 
00043 
00044 int MenuAEffectThread::get_derived_attributes(Asset *asset, Defaults *defaults)
00045 {
00046         asset->load_defaults(defaults, 
00047                 "AEFFECT_",
00048                 1, 
00049                 1,
00050                 1,
00051                 0,
00052                 1);
00053 
00054 
00055 // Fix asset for audio only
00056         if(!File::supports_audio(asset->format)) asset->format = FILE_WAV;
00057         asset->audio_data = 1;
00058         asset->video_data = 0;
00059 
00060         return 0;
00061 }
00062 
00063 int MenuAEffectThread::save_derived_attributes(Asset *asset, Defaults *defaults)
00064 {
00065         asset->save_defaults(defaults, 
00066                 "AEFFECT_",
00067                 1, 
00068                 1,
00069                 1,
00070                 0,
00071                 1);
00072 
00073         return 0;
00074 }
00075 
00076 
00077 PluginArray* MenuAEffectThread::create_plugin_array()
00078 {
00079         return new APluginArray();
00080 }
00081 
00082 int64_t MenuAEffectThread::to_units(double position, int round)
00083 {
00084         if(round)
00085                 return Units::round(position * mwindow->edl->session->sample_rate);
00086         else
00087                 return (int64_t)(position * mwindow->edl->session->sample_rate);
00088                 
00089         return 0;
00090 }
00091 
00092 int MenuAEffectThread::fix_menu(char *title)
00093 {
00094         mwindow->gui->mainmenu->add_aeffect(title); 
00095 }
00096 
00097 
00098 
00099 MenuAEffectItem::MenuAEffectItem(MenuAEffects *menueffect, char *string)
00100  : MenuEffectItem(menueffect, string)
00101 {
00102 }

Generated on Sun Jan 8 13:38:57 2006 for Cinelerra-svn by  doxygen 1.4.4