X-Git-Url: http://git.cinelerra-gg.org/git/?p=goodguy%2Fhistory.git;a=blobdiff_plain;f=cinelerra-5.0%2Fcinelerra%2Fformatpopup.C;h=559385189e31e4364b8774daf258fab8e2dd1c9c;hp=94f1ec22a2a755719d65f80eb86b5c9ff2903945;hb=3564c71f425f390745eb7c75d5121689d53e14c2;hpb=a2adb92f17159c0399504ab4b18acb1d94122077 diff --git a/cinelerra-5.0/cinelerra/formatpopup.C b/cinelerra-5.0/cinelerra/formatpopup.C index 94f1ec22..55938518 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" @@ -84,10 +86,54 @@ 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 ) ext = name; + else 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; +} + +