From 9dfb39c6726a255a104797407a26d2c577863e9c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jean-Andr=C3=A9=20Santoni?= Date: Mon, 14 Aug 2017 00:29:38 +0200 Subject: [PATCH] Start implementing the callback for add-to-favorites --- command.c | 3 +++ command.h | 2 ++ menu/cbs/menu_cbs_ok.c | 9 +++++++++ 3 files changed, 14 insertions(+) diff --git a/command.c b/command.c index 19b2de761e..03bf2ad911 100644 --- a/command.c +++ b/command.c @@ -2173,6 +2173,9 @@ bool command_event(enum event_command cmd, void *data) if (ui_companion_is_on_foreground()) ui_companion_driver_toggle(); break; + case CMD_EVENT_ADD_TO_FAVORITES: + printf("Add to favorites\n"); + break; case CMD_EVENT_RESTART_RETROARCH: if (!frontend_driver_set_fork(FRONTEND_FORK_RESTART)) return false; diff --git a/command.h b/command.h index ccac457ef8..4709d3f404 100644 --- a/command.h +++ b/command.h @@ -134,6 +134,8 @@ enum event_command CMD_EVENT_REBOOT, /* Resume RetroArch when in menu. */ CMD_EVENT_RESUME, + /* Add a playlist entry to favorites. */ + CMD_EVENT_ADD_TO_FAVORITES, /* Toggles pause. */ CMD_EVENT_PAUSE_TOGGLE, /* Pauses RetroArch. */ diff --git a/menu/cbs/menu_cbs_ok.c b/menu/cbs/menu_cbs_ok.c index a73475adb3..2518825b65 100644 --- a/menu/cbs/menu_cbs_ok.c +++ b/menu/cbs/menu_cbs_ok.c @@ -3103,6 +3103,12 @@ static int action_ok_resume_content(const char *path, return generic_action_ok_command(CMD_EVENT_RESUME); } +static int action_ok_add_to_favorites(const char *path, + const char *label, unsigned type, size_t idx, size_t entry_idx) +{ + return generic_action_ok_command(CMD_EVENT_ADD_TO_FAVORITES); +} + static int action_ok_restart_content(const char *path, const char *label, unsigned type, size_t idx, size_t entry_idx) { @@ -4590,6 +4596,9 @@ static int menu_cbs_init_bind_ok_compare_label(menu_file_list_cbs_t *cbs, case MENU_ENUM_LABEL_RESUME_CONTENT: BIND_ACTION_OK(cbs, action_ok_resume_content); break; + case MENU_ENUM_LABEL_ADD_TO_FAVORITES: + BIND_ACTION_OK(cbs, action_ok_add_to_favorites); + break; case MENU_ENUM_LABEL_RESTART_CONTENT: BIND_ACTION_OK(cbs, action_ok_restart_content); break;