Merge branch 'ct' of git.pipapo.org:cinelerra-ct into ct
[cinelerra_cv/ct.git] / cinelerra / menuveffects.C
blobba777f61ed19b5790131e437335783326bbe6aa8
1 #include "asset.h"
2 #include "bchash.h"
3 #include "edl.h"
4 #include "edlsession.h"
5 #include "file.h"
6 #include "mainmenu.h"
7 #include "mainsession.h"
8 #include "mwindow.h"
9 #include "mwindowgui.h"
10 #include "menuveffects.h"
11 #include "patchbay.h"
12 #include "quicktime.h"
13 #include "tracks.h"
14 #include "units.h"
15 #include "vpluginarray.h"
18 MenuVEffects::MenuVEffects(MWindow *mwindow)
19  : MenuEffects(mwindow)
21         thread = new MenuVEffectThread(mwindow);
24 MenuVEffects::~MenuVEffects()
26         delete thread;
29 MenuVEffectThread::MenuVEffectThread(MWindow *mwindow)
30  : MenuEffectThread(mwindow)
34 MenuVEffectThread::~MenuVEffectThread()
38 int MenuVEffectThread::get_recordable_tracks(Asset_GC asset)
40         asset->layers = mwindow->edl->tracks->recordable_video_tracks();
41         return asset->layers;
44 int MenuVEffectThread::get_derived_attributes(Asset_GC asset, BC_Hash *defaults)
47         asset->load_defaults(defaults, 
48                 "VEFFECT_",
49                 1, 
50                 1,
51                 1,
52                 0,
53                 0);
58 // Fix asset for video only
59         if(!File::supports_video(asset->format)) asset->format = FILE_MOV;
60         asset->audio_data = 0;
61         asset->video_data = 1;
65         return 0;
68 int MenuVEffectThread::save_derived_attributes(Asset_GC asset, BC_Hash *defaults)
70         asset->save_defaults(defaults,
71                 "VEFFECT_",
72                 1,
73                 1,
74                 1,
75                 0,
76                 0);
79         return 0;
82 PluginArray* MenuVEffectThread::create_plugin_array()
84         return new VPluginArray();
87 int64_t MenuVEffectThread::to_units(double position, int round)
89         if(round)
90                 return Units::round(position * mwindow->edl->session->frame_rate);
91         else
92                 return (int64_t)(position * mwindow->edl->session->frame_rate);
93                 
94         return 0;
97 int MenuVEffectThread::fix_menu(char *title)
99         mwindow->gui->mainmenu->add_veffect(title); 
102 MenuVEffectItem::MenuVEffectItem(MenuVEffects *menueffect, char *string)
103  : MenuEffectItem(menueffect, string)
107 //      Local Variables:
108 //      mode: C++
109 //      c-file-style: "linux"
110 //      End: