diff options
author | Campbell Barton <ideasman42@gmail.com> | 2010-08-03 16:34:42 +0400 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2010-08-03 16:34:42 +0400 |
commit | 50c3da699db13a1b51311919063bb3ad92dd8b3d (patch) | |
tree | 570123d075671acb045e9ebd161d12802ed5f9e9 /source/blender/editors/space_file | |
parent | 957976882d084d9951760b154f414724d6ddb8be (diff) |
minor cleanup, minimal functional change.
replace some long duplicated, ifdef'd if statements for image extension.
- new function: BLI_testextensie_array(), can take an array of extensions.
- define extension arrays: imb_ext_image, imb_ext_movie, imb_ext_sound - we could have more of these.
- removed amiga extensions iff and lbm
Diffstat (limited to 'source/blender/editors/space_file')
-rw-r--r-- | source/blender/editors/space_file/filelist.c | 152 |
1 files changed, 6 insertions, 146 deletions
diff --git a/source/blender/editors/space_file/filelist.c b/source/blender/editors/space_file/filelist.c index a6668d9a5fe..310e3d49bd9 100644 --- a/source/blender/editors/space_file/filelist.c +++ b/source/blender/editors/space_file/filelist.c @@ -828,153 +828,13 @@ void filelist_setfiletypes(struct FileList* filelist, short has_quicktime) file->flags |= BTXFILE; } else if(BLI_testextensie(file->relname, ".dae")) { file->flags |= COLLADAFILE; - } else if (has_quicktime){ - if( BLI_testextensie(file->relname, ".int") - || BLI_testextensie(file->relname, ".inta") - || BLI_testextensie(file->relname, ".jpg") -#ifdef WITH_OPENJPEG - || BLI_testextensie(file->relname, ".jp2") -#endif - || BLI_testextensie(file->relname, ".jpeg") - || BLI_testextensie(file->relname, ".tga") - || BLI_testextensie(file->relname, ".rgb") - || BLI_testextensie(file->relname, ".rgba") - || BLI_testextensie(file->relname, ".bmp") - || BLI_testextensie(file->relname, ".png") - || BLI_testextensie(file->relname, ".iff") - || BLI_testextensie(file->relname, ".lbm") - || BLI_testextensie(file->relname, ".gif") - || BLI_testextensie(file->relname, ".psd") - || BLI_testextensie(file->relname, ".tif") - || BLI_testextensie(file->relname, ".tiff") - || BLI_testextensie(file->relname, ".tx") - || BLI_testextensie(file->relname, ".pct") - || BLI_testextensie(file->relname, ".pict") - || BLI_testextensie(file->relname, ".pntg") //macpaint - || BLI_testextensie(file->relname, ".qtif") - || BLI_testextensie(file->relname, ".sgi") -#ifdef WITH_HDR - || BLI_testextensie(file->relname, ".hdr") -#endif -#ifdef WITH_CINEON - || BLI_testextensie(file->relname, ".cin") - || BLI_testextensie(file->relname, ".dpx") -#endif -#ifdef WITH_DDS - || BLI_testextensie(file->relname, ".dds") -#endif -#ifdef WITH_OPENEXR - || BLI_testextensie(file->relname, ".exr") -#endif - ) { + } else if(BLI_testextensie_array(file->relname, imb_ext_image) + || (has_quicktime && BLI_testextensie_array(file->relname, imb_ext_image_qt))) { file->flags |= IMAGEFILE; - } - else if(BLI_testextensie(file->relname, ".avi") - || BLI_testextensie(file->relname, ".flc") - || BLI_testextensie(file->relname, ".mov") - || BLI_testextensie(file->relname, ".movie") - || BLI_testextensie(file->relname, ".mp4") - || BLI_testextensie(file->relname, ".m4v") - || BLI_testextensie(file->relname, ".m2v") - || BLI_testextensie(file->relname, ".m2t") - || BLI_testextensie(file->relname, ".mts") - || BLI_testextensie(file->relname, ".mv") - || BLI_testextensie(file->relname, ".avs") - || BLI_testextensie(file->relname, ".wmv") - || BLI_testextensie(file->relname, ".ogv") - || BLI_testextensie(file->relname, ".dv") - || BLI_testextensie(file->relname, ".mpeg") - || BLI_testextensie(file->relname, ".mpg") - || BLI_testextensie(file->relname, ".mpg2") - || BLI_testextensie(file->relname, ".vob") - || BLI_testextensie(file->relname, ".mkv") - || BLI_testextensie(file->relname, ".flv") - || BLI_testextensie(file->relname, ".divx") - || BLI_testextensie(file->relname, ".xvid")) { - file->flags |= MOVIEFILE; - } - else if(BLI_testextensie(file->relname, ".wav") - || BLI_testextensie(file->relname, ".ogg") - || BLI_testextensie(file->relname, ".oga") - || BLI_testextensie(file->relname, ".mp3") - || BLI_testextensie(file->relname, ".mp2") - || BLI_testextensie(file->relname, ".ac3") - || BLI_testextensie(file->relname, ".aac") - || BLI_testextensie(file->relname, ".flac") - || BLI_testextensie(file->relname, ".wma") - || BLI_testextensie(file->relname, ".eac3")) { - file->flags |= SOUNDFILE; - } - } else { // no quicktime - if(BLI_testextensie(file->relname, ".int") - || BLI_testextensie(file->relname, ".inta") - || BLI_testextensie(file->relname, ".jpg") - || BLI_testextensie(file->relname, ".jpeg") -#ifdef WITH_OPENJPEG - || BLI_testextensie(file->relname, ".jp2") -#endif - || BLI_testextensie(file->relname, ".tga") - || BLI_testextensie(file->relname, ".rgb") - || BLI_testextensie(file->relname, ".rgba") - || BLI_testextensie(file->relname, ".bmp") - || BLI_testextensie(file->relname, ".png") - || BLI_testextensie(file->relname, ".iff") - || BLI_testextensie(file->relname, ".tif") - || BLI_testextensie(file->relname, ".tiff") - || BLI_testextensie(file->relname, ".tx") -#ifdef WITH_HDR - || BLI_testextensie(file->relname, ".hdr") -#endif -#ifdef WITH_CINEON - || BLI_testextensie(file->relname, ".cin") - || BLI_testextensie(file->relname, ".dpx") -#endif -#ifdef WITH_DDS - || BLI_testextensie(file->relname, ".dds") -#endif -#ifdef WITH_OPENEXR - || BLI_testextensie(file->relname, ".exr") -#endif - || BLI_testextensie(file->relname, ".lbm") - || BLI_testextensie(file->relname, ".sgi")) { - file->flags |= IMAGEFILE; - } - else if(BLI_testextensie(file->relname, ".avi") - || BLI_testextensie(file->relname, ".flc") - || BLI_testextensie(file->relname, ".mov") - || BLI_testextensie(file->relname, ".movie") - || BLI_testextensie(file->relname, ".mp4") - || BLI_testextensie(file->relname, ".m4v") - || BLI_testextensie(file->relname, ".m2v") - || BLI_testextensie(file->relname, ".m2t") - || BLI_testextensie(file->relname, ".mts") - || BLI_testextensie(file->relname, ".mv") - || BLI_testextensie(file->relname, ".avs") - || BLI_testextensie(file->relname, ".wmv") - || BLI_testextensie(file->relname, ".ogv") - || BLI_testextensie(file->relname, ".dv") - || BLI_testextensie(file->relname, ".mpeg") - || BLI_testextensie(file->relname, ".mpg") - || BLI_testextensie(file->relname, ".mpg2") - || BLI_testextensie(file->relname, ".vob") - || BLI_testextensie(file->relname, ".mkv") - || BLI_testextensie(file->relname, ".flv") - || BLI_testextensie(file->relname, ".divx") - || BLI_testextensie(file->relname, ".xvid")) { - file->flags |= MOVIEFILE; - } - else if(BLI_testextensie(file->relname, ".wav") - || BLI_testextensie(file->relname, ".ogg") - || BLI_testextensie(file->relname, ".oga") - || BLI_testextensie(file->relname, ".mp3") - || BLI_testextensie(file->relname, ".mp2") - || BLI_testextensie(file->relname, ".ac3") - || BLI_testextensie(file->relname, ".aac") - || BLI_testextensie(file->relname, ".flac") - || BLI_testextensie(file->relname, ".wma") - || BLI_testextensie(file->relname, ".eac3")) { - file->flags |= SOUNDFILE; - } + } else if(BLI_testextensie_array(file->relname, imb_ext_movie)) { + file->flags |= MOVIEFILE; + } else if(BLI_testextensie_array(file->relname, imb_ext_audio)) { + file->flags |= SOUNDFILE; } } } |