From 3dcc52fd5be66b4c5c3f71d42aa48ca6607c975a Mon Sep 17 00:00:00 2001 From: twinaphex Date: Sat, 30 Jul 2016 23:12:17 +0200 Subject: [PATCH] Start showing history video playlist --- menu/menu_displaylist.c | 62 +++++++++++++++-------------------------- menu/menu_displaylist.h | 1 + 2 files changed, 23 insertions(+), 40 deletions(-) diff --git a/menu/menu_displaylist.c b/menu/menu_displaylist.c index 7e553cecc8..3dc166cf8b 100644 --- a/menu/menu_displaylist.c +++ b/menu/menu_displaylist.c @@ -3840,10 +3840,6 @@ static bool menu_displaylist_push_internal( } else if (string_is_equal(label, msg_hash_to_str(MENU_ENUM_LABEL_VIDEO_TAB))) { -#if 0 - settings_t *settings = config_get_ptr(); -#endif - menu_displaylist_reset_filebrowser(); info->type = 42; strlcpy(info->exts, "lpl", sizeof(info->exts)); @@ -3851,44 +3847,17 @@ static bool menu_displaylist_push_internal( msg_hash_to_str(MENU_ENUM_LABEL_CONTENT_COLLECTION_LIST), sizeof(info->label)); -#if 0 - if (string_is_empty(settings->directory.playlist)) -#endif - { - menu_entries_ctl(MENU_ENTRIES_CTL_CLEAR, info->list); + menu_entries_ctl(MENU_ENTRIES_CTL_CLEAR, info->list); #if defined(HAVE_VIDEO_PROCESSOR) - menu_entries_append_enum(info->list, - msg_hash_to_str( - MENU_ENUM_LABEL_VALUE_START_VIDEO_PROCESSOR), - msg_hash_to_str( - MENU_ENUM_LABEL_START_VIDEO_PROCESSOR), - MENU_ENUM_LABEL_START_VIDEO_PROCESSOR, - 0, 0, 0); -#else - menu_entries_append_enum(info->list, - msg_hash_to_str( - MENU_ENUM_LABEL_VALUE_NO_PLAYLIST_ENTRIES_AVAILABLE), - msg_hash_to_str( - MENU_ENUM_LABEL_NO_PLAYLIST_ENTRIES_AVAILABLE), - MENU_ENUM_LABEL_NO_PLAYLIST_ENTRIES_AVAILABLE, - MENU_INFO_MESSAGE, 0, 0); -#endif - info->need_refresh = true; - info->need_push = true; - } -#if 0 - else - { - strlcpy( - info->path, - settings->directory.playlist, - sizeof(info->path)); - - if (!menu_displaylist_ctl( - DISPLAYLIST_DATABASE_PLAYLISTS, info)) - return false; - } + menu_entries_append_enum(info->list, + msg_hash_to_str( + MENU_ENUM_LABEL_VALUE_START_VIDEO_PROCESSOR), + msg_hash_to_str( + MENU_ENUM_LABEL_START_VIDEO_PROCESSOR), + MENU_ENUM_LABEL_START_VIDEO_PROCESSOR, + 0, 0, 0); #endif + menu_displaylist_ctl(DISPLAYLIST_VIDEO_HISTORY, info); return true; } else if (string_is_equal(label, msg_hash_to_str(MENU_ENUM_LABEL_IMAGES_TAB))) @@ -5518,6 +5487,19 @@ bool menu_displaylist_ctl(enum menu_displaylist_ctl_state type, void *data) settings->path.content_history, &ret); + if (ret == 0) + { + info->need_refresh = true; + info->need_push = true; + } + break; + case DISPLAYLIST_VIDEO_HISTORY: + menu_displaylist_parse_playlist_history(menu, info, + g_defaults.video_history, + "video_history", + settings->path.content_video_history, + &ret); + if (ret == 0) { info->need_refresh = true; diff --git a/menu/menu_displaylist.h b/menu/menu_displaylist.h index ff5737fd77..f539b62f06 100644 --- a/menu/menu_displaylist.h +++ b/menu/menu_displaylist.h @@ -62,6 +62,7 @@ enum menu_displaylist_ctl_state DISPLAYLIST_HORIZONTAL, DISPLAYLIST_HORIZONTAL_CONTENT_ACTIONS, DISPLAYLIST_HISTORY, + DISPLAYLIST_VIDEO_HISTORY, DISPLAYLIST_PLAYLIST_COLLECTION, DISPLAYLIST_DEFAULT, DISPLAYLIST_FILE_BROWSER_SELECT_DIR,