This commit is contained in:
twinaphex 2016-06-18 02:20:13 +02:00
parent 9456f05991
commit 8c75bc7618
3 changed files with 77 additions and 31 deletions

View File

@ -999,6 +999,54 @@ enum menu_file_type menu_hash_to_file_type(uint32_t hash)
return MENU_FILE_SHA1; return MENU_FILE_SHA1;
case MENU_VALUE_MD5: case MENU_VALUE_MD5:
return MENU_FILE_MD5; return MENU_FILE_MD5;
#ifdef HAVE_FFMPEG
case MENU_VALUE_FILE_OGM:
return MENU_FILE_OGM;
case MENU_VALUE_FILE_MKV:
return MENU_FILE_MKV;
case MENU_VALUE_FILE_AVI:
return MENU_FILE_AVI;
case MENU_VALUE_FILE_MP4:
return MENU_FILE_MP4;
case MENU_VALUE_FILE_FLV:
return MENU_FILE_FLV;
case MENU_VALUE_FILE_WEBM:
return MENU_FILE_WEBM;
case MENU_VALUE_FILE_3GP:
return MENU_FILE_3GP;
case MENU_VALUE_FILE_F4F:
return MENU_FILE_F4F;
case MENU_VALUE_FILE_F4V:
return MENU_FILE_F4V;
case MENU_VALUE_FILE_MOV:
return MENU_FILE_MOV;
case MENU_VALUE_FILE_WMV:
return MENU_FILE_WMV;
case MENU_VALUE_FILE_MP3:
return MENU_FILE_MP3;
case MENU_VALUE_FILE_M4A:
return MENU_FILE_M4A;
case MENU_VALUE_FILE_OGG:
return MENU_FILE_OGG;
case MENU_VALUE_FILE_FLAC:
return MENU_FILE_FLAC;
case MENU_VALUE_FILE_WAV:
return MENU_FILE_WAV;
#endif
#ifdef HAVE_IMAGEVIEWER
case MENU_VALUE_FILE_JPG:
case MENU_VALUE_FILE_JPG_CAPS:
case MENU_VALUE_FILE_JPEG:
case MENU_VALUE_FILE_JPEG_CAPS:
return MENU_FILE_JPEG;
case MENU_VALUE_FILE_PNG:
case MENU_VALUE_FILE_PNG_CAPS:
return MENU_FILE_PNG;
case MENU_VALUE_FILE_TGA:
return MENU_FILE_TGA;
case MENU_VALUE_FILE_BMP:
return MENU_FILE_BMP;
#endif
default: default:
break; break;
} }

View File

@ -544,51 +544,46 @@ const char *retroarch_get_current_savefile_dir(void)
return ret; return ret;
} }
#ifdef HAVE_MENU
enum rarch_content_type retroarch_path_is_media_type(const char *path) enum rarch_content_type retroarch_path_is_media_type(const char *path)
{ {
uint32_t hash_ext = msg_hash_calculate(path_get_extension(path)); switch (menu_hash_to_file_type(msg_hash_calculate(path_get_extension(path))))
switch (hash_ext)
{ {
#ifdef HAVE_FFMPEG #ifdef HAVE_FFMPEG
case MENU_VALUE_FILE_OGM: case MENU_FILE_OGM:
case MENU_VALUE_FILE_MKV: case MENU_FILE_MKV:
case MENU_VALUE_FILE_AVI: case MENU_FILE_AVI:
case MENU_VALUE_FILE_MP4: case MENU_FILE_MP4:
case MENU_VALUE_FILE_FLV: case MENU_FILE_FLV:
case MENU_VALUE_FILE_WEBM: case MENU_FILE_WEBM:
case MENU_VALUE_FILE_3GP: case MENU_FILE_3GP:
case MENU_VALUE_FILE_F4F: case MENU_FILE_F4F:
case MENU_VALUE_FILE_F4V: case MENU_FILE_F4V:
case MENU_VALUE_FILE_MOV: case MENU_FILE_MOV:
case MENU_VALUE_FILE_WMV: case MENU_FILE_WMV:
return RARCH_CONTENT_MOVIE; return RARCH_CONTENT_MOVIE;
case MENU_VALUE_FILE_MP3: case MENU_FILE_MP3:
case MENU_VALUE_FILE_M4A: case MENU_FILE_M4A:
case MENU_VALUE_FILE_OGG: case MENU_FILE_OGG:
case MENU_VALUE_FILE_FLAC: case MENU_FILE_FLAC:
case MENU_VALUE_FILE_WAV: case MENU_FILE_WAV:
return RARCH_CONTENT_MUSIC; return RARCH_CONTENT_MUSIC;
#endif #endif
#ifdef HAVE_IMAGEVIEWER #ifdef HAVE_IMAGEVIEWER
case MENU_VALUE_FILE_JPG: case MENU_FILE_JPEG:
case MENU_VALUE_FILE_JPG_CAPS: case MENU_FILE_PNG:
case MENU_VALUE_FILE_JPEG: case MENU_FILE_TGA:
case MENU_VALUE_FILE_JPEG_CAPS: case MENU_FILE_BMP:
case MENU_VALUE_FILE_PNG:
case MENU_VALUE_FILE_PNG_CAPS:
case MENU_VALUE_FILE_TGA:
case MENU_VALUE_FILE_BMP:
return RARCH_CONTENT_IMAGE; return RARCH_CONTENT_IMAGE;
#endif #endif
case 0: case MENU_FILE_NONE:
default: default:
break; break;
} }
return RARCH_CONTENT_NONE; return RARCH_CONTENT_NONE;
} }
#endif
#define FFMPEG_RECORD_ARG "r:" #define FFMPEG_RECORD_ARG "r:"
@ -1285,13 +1280,13 @@ bool retroarch_main_init(int argc, char *argv[])
runloop_ctl(RUNLOOP_CTL_TASK_INIT, NULL); runloop_ctl(RUNLOOP_CTL_TASK_INIT, NULL);
{ {
#ifdef HAVE_MENU
settings_t *settings = config_get_ptr(); settings_t *settings = config_get_ptr();
if (settings && (settings->multimedia.builtin_mediaplayer_enable || if (settings && (settings->multimedia.builtin_mediaplayer_enable ||
settings->multimedia.builtin_imageviewer_enable)) settings->multimedia.builtin_imageviewer_enable))
{ {
char *fullpath = NULL; char *fullpath = NULL;
if (runloop_ctl(RUNLOOP_CTL_GET_CONTENT_PATH, &fullpath)) if (runloop_ctl(RUNLOOP_CTL_GET_CONTENT_PATH, &fullpath))
{ {
#if defined(HAVE_FFMPEG) || defined(HAVE_IMAGEVIEWER) #if defined(HAVE_FFMPEG) || defined(HAVE_IMAGEVIEWER)
@ -1323,6 +1318,7 @@ bool retroarch_main_init(int argc, char *argv[])
} }
} }
} }
#endif
} }
driver_ctl(RARCH_DRIVER_CTL_INIT_PRE, NULL); driver_ctl(RARCH_DRIVER_CTL_INIT_PRE, NULL);

View File

@ -118,7 +118,9 @@ bool rarch_ctl(enum rarch_ctl_state state, void *data);
int retroarch_get_capabilities(enum rarch_capabilities type, int retroarch_get_capabilities(enum rarch_capabilities type,
char *s, size_t len); char *s, size_t len);
#ifdef HAVE_MENU
enum rarch_content_type retroarch_path_is_media_type(const char *path); enum rarch_content_type retroarch_path_is_media_type(const char *path);
#endif
const char *retroarch_get_current_savefile_dir(void); const char *retroarch_get_current_savefile_dir(void);