X-Git-Url: http://git.cinelerra-gg.org/git/?a=blobdiff_plain;f=cinelerra-5.0%2Fcinelerra%2Fformatpopup.C;h=dacb76cced5620bae73bf30027e85168669a1ee3;hb=f9d0d999e813ae19965e07ae2f7da690b4e6fe45;hp=94f1ec22a2a755719d65f80eb86b5c9ff2903945;hpb=2d99bb8ce591f05a31464b517d85dc2bc35b2abe;p=goodguy%2Fhistory.git diff --git a/cinelerra-5.0/cinelerra/formatpopup.C b/cinelerra-5.0/cinelerra/formatpopup.C index 94f1ec22..dacb76cc 100644 --- a/cinelerra-5.0/cinelerra/formatpopup.C +++ b/cinelerra-5.0/cinelerra/formatpopup.C @@ -21,6 +21,8 @@ #include "bcsignals.h" #include "file.inc" +#include "filesystem.h" +#include "ffmpeg.h" #include "formatpopup.h" #include "language.h" #include "pluginserver.h" @@ -38,6 +40,8 @@ FormatPopup::FormatPopup(ArrayList *plugindb, void FormatPopup::create_objects() { + format_items.append(new BC_ListBoxItem(_(FFMPEG_NAME))); + if(!use_brender) { format_items.append(new BC_ListBoxItem(_(AC3_NAME))); @@ -51,12 +55,9 @@ void FormatPopup::create_objects() if(!use_brender) { - format_items.append(new BC_ListBoxItem(_(AVI_NAME))); format_items.append(new BC_ListBoxItem(_(EXR_NAME))); format_items.append(new BC_ListBoxItem(_(EXR_LIST_NAME))); format_items.append(new BC_ListBoxItem(_(WAV_NAME))); - format_items.append(new BC_ListBoxItem(_(MOV_NAME))); - format_items.append(new BC_ListBoxItem(_(FFMPEG_NAME))); format_items.append(new BC_ListBoxItem(_(AMPEG_NAME))); format_items.append(new BC_ListBoxItem(_(VMPEG_NAME))); format_items.append(new BC_ListBoxItem(_(OGG_NAME))); @@ -84,10 +85,55 @@ void FormatPopup::create_objects() FormatPopup::~FormatPopup() { - for(int i = 0; i < format_items.total; i++) delete format_items.values[i]; + format_items.remove_all_objects(); } int FormatPopup::handle_event() { return 0; } + + +FFMPEGPopup::FFMPEGPopup(ArrayList *plugindb, int x, int y) + : BC_ListBox(x, y, 50, 200, LISTBOX_TEXT, 0, 0, 0, 1, 0, 1) +{ + this->plugindb = plugindb; + set_tooltip(_("Set ffmpeg file type")); +} + +void FFMPEGPopup::create_objects() +{ + static const char *dirs[] = { "audio", "video", }; + for( int i=0; i<(int)(sizeof(dirs)/sizeof(dirs[0])); ++i ) { + FileSystem fs; + char option_path[BCTEXTLEN]; + FFMPEG::set_option_path(option_path, dirs[i]); + fs.update(option_path); + int total_files = fs.total_files(); + for( int j=0; jget_name(); + const char *ext = strrchr(name,'.'); + if( !ext ) continue; + if( !strcmp("dfl", ++ext) ) continue; + if( !strcmp("opts", ext) ) continue; + int k = ffmpeg_types.size(); + while( --k >= 0 && strcmp(ffmpeg_types[k]->get_text(), ext) ); + if( k >= 0 ) continue; + ffmpeg_types.append(new BC_ListBoxItem(ext)); + } + } + + update(&ffmpeg_types, 0, 0, 1); +} + +FFMPEGPopup::~FFMPEGPopup() +{ + ffmpeg_types.remove_all_objects(); +} + +int FFMPEGPopup::handle_event() +{ + return 0; +} + +