X-Git-Url: http://git.cinelerra-gg.org/git/?p=goodguy%2Fhistory.git;a=blobdiff_plain;f=cinelerra-5.1%2Fcinelerra%2Fformatpopup.C;h=55ffcefa4b487414577f68f88f6c59acfa844385;hp=683c7117d076e0b87bde18ad98a76e39e3a24f59;hb=7e5a0760f40ff787cc3d93cb7768a901ebe52809;hpb=95683646dce10ad3f6a8c8c9c9225c69f4841ec5 diff --git a/cinelerra-5.1/cinelerra/formatpopup.C b/cinelerra-5.1/cinelerra/formatpopup.C index 683c7117..55ffcefa 100644 --- a/cinelerra-5.1/cinelerra/formatpopup.C +++ b/cinelerra-5.1/cinelerra/formatpopup.C @@ -20,70 +20,74 @@ */ #include "bcsignals.h" -#include "file.inc" +#include "file.h" #include "filesystem.h" #include "ffmpeg.h" #include "formatpopup.h" #include "language.h" -#include "pluginserver.h" - -FormatPopup::FormatPopup(ArrayList *plugindb, - int x, int y, int use_brender) +FormatPopup::FormatPopup(int x, int y, int do_audio, int do_video, int use_brender) : BC_ListBox(x, y, 200, 200, LISTBOX_TEXT, 0, 0, 0, 1, 0, 1) { - this->plugindb = plugindb; + this->do_audio = do_audio; + this->do_video = do_video; this->use_brender = use_brender; set_tooltip(_("Change file format")); } -void FormatPopup::create_objects() +void FormatPopup::post_item(int format) { - format_items.append(new BC_ListBoxItem(_(FFMPEG_NAME))); + if( (do_audio && File::renders_audio(format)) || + (do_video && File::renders_video(format)) ) + format_items.append(new BC_ListBoxItem(File::formattostr(format))); +} - if(!use_brender) - { - format_items.append(new BC_ListBoxItem(_(AC3_NAME))); - format_items.append(new BC_ListBoxItem(_(AIFF_NAME))); - format_items.append(new BC_ListBoxItem(_(AU_NAME))); - format_items.append(new BC_ListBoxItem(_(FLAC_NAME))); - format_items.append(new BC_ListBoxItem(_(JPEG_NAME))); +void FormatPopup::create_objects() +{ + if(!use_brender) { + post_item(FILE_FFMPEG); +#ifdef HAVE_LIBZMPEG + post_item(FILE_AC3); +#endif + post_item(FILE_AIFF); + post_item(FILE_AU); + post_item(FILE_FLAC); } - format_items.append(new BC_ListBoxItem(_(JPEG_LIST_NAME))); - if(!use_brender) - { + post_item(FILE_JPEG); + post_item(FILE_JPEG_LIST); + + if(!use_brender) { #ifdef HAVE_OPENEXR - format_items.append(new BC_ListBoxItem(_(EXR_NAME))); - format_items.append(new BC_ListBoxItem(_(EXR_LIST_NAME))); + post_item(FILE_EXR); + post_item(FILE_EXR_LIST); #endif - format_items.append(new BC_ListBoxItem(_(WAV_NAME))); - format_items.append(new BC_ListBoxItem(_(RAWDV_NAME))); - format_items.append(new BC_ListBoxItem(_(AMPEG_NAME))); - format_items.append(new BC_ListBoxItem(_(VMPEG_NAME))); - format_items.append(new BC_ListBoxItem(_(VORBIS_NAME))); - format_items.append(new BC_ListBoxItem(_(OGG_NAME))); - format_items.append(new BC_ListBoxItem(_(PCM_NAME))); - format_items.append(new BC_ListBoxItem(_(PNG_NAME))); + post_item(FILE_WAV); + post_item(FILE_RAWDV); +#ifdef HAVE_LIBZMPEG + post_item(FILE_AMPEG); + post_item(FILE_VMPEG); +#endif + post_item(FILE_VORBIS); + post_item(FILE_OGG); + post_item(FILE_PCM); } - format_items.append(new BC_ListBoxItem(_(PNG_LIST_NAME))); - if(!use_brender) - { - format_items.append(new BC_ListBoxItem(_(TGA_NAME))); - } - - format_items.append(new BC_ListBoxItem(_(TGA_LIST_NAME))); - + post_item(FILE_PNG); + post_item(FILE_PNG_LIST); if(!use_brender) - { - format_items.append(new BC_ListBoxItem(_(TIFF_NAME))); - } + post_item(FILE_PPM); + post_item(FILE_PPM_LIST); + if(!use_brender) + post_item(FILE_TGA); + post_item(FILE_TGA_LIST); + if(!use_brender) + post_item(FILE_TIFF); + post_item(FILE_TIFF_LIST); - format_items.append(new BC_ListBoxItem(_(TIFF_LIST_NAME))); update(&format_items, 0, 0, 1); } @@ -98,10 +102,9 @@ int FormatPopup::handle_event() } -FFMPEGPopup::FFMPEGPopup(ArrayList *plugindb, int x, int y) +FFMPEGPopup::FFMPEGPopup(int x, int y) : BC_ListBox(x, y, 100, 200, LISTBOX_TEXT, 0, 0, 0, 1, 0, 1) { - this->plugindb = plugindb; set_tooltip(_("Set ffmpeg file type")); } @@ -127,6 +130,7 @@ void FFMPEGPopup::create_objects() } } + BC_ListBoxItem::sort_items(ffmpeg_types); update(&ffmpeg_types, 0, 0, 1); }