Start implementing the callback for add-to-favorites

This commit is contained in:
Jean-André Santoni 2017-08-14 00:29:38 +02:00
parent 42012389cd
commit 9dfb39c672
3 changed files with 14 additions and 0 deletions

View File

@ -2173,6 +2173,9 @@ bool command_event(enum event_command cmd, void *data)
if (ui_companion_is_on_foreground()) if (ui_companion_is_on_foreground())
ui_companion_driver_toggle(); ui_companion_driver_toggle();
break; break;
case CMD_EVENT_ADD_TO_FAVORITES:
printf("Add to favorites\n");
break;
case CMD_EVENT_RESTART_RETROARCH: case CMD_EVENT_RESTART_RETROARCH:
if (!frontend_driver_set_fork(FRONTEND_FORK_RESTART)) if (!frontend_driver_set_fork(FRONTEND_FORK_RESTART))
return false; return false;

View File

@ -134,6 +134,8 @@ enum event_command
CMD_EVENT_REBOOT, CMD_EVENT_REBOOT,
/* Resume RetroArch when in menu. */ /* Resume RetroArch when in menu. */
CMD_EVENT_RESUME, CMD_EVENT_RESUME,
/* Add a playlist entry to favorites. */
CMD_EVENT_ADD_TO_FAVORITES,
/* Toggles pause. */ /* Toggles pause. */
CMD_EVENT_PAUSE_TOGGLE, CMD_EVENT_PAUSE_TOGGLE,
/* Pauses RetroArch. */ /* Pauses RetroArch. */

View File

@ -3103,6 +3103,12 @@ static int action_ok_resume_content(const char *path,
return generic_action_ok_command(CMD_EVENT_RESUME); 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, static int action_ok_restart_content(const char *path,
const char *label, unsigned type, size_t idx, size_t entry_idx) 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: case MENU_ENUM_LABEL_RESUME_CONTENT:
BIND_ACTION_OK(cbs, action_ok_resume_content); BIND_ACTION_OK(cbs, action_ok_resume_content);
break; break;
case MENU_ENUM_LABEL_ADD_TO_FAVORITES:
BIND_ACTION_OK(cbs, action_ok_add_to_favorites);
break;
case MENU_ENUM_LABEL_RESTART_CONTENT: case MENU_ENUM_LABEL_RESTART_CONTENT:
BIND_ACTION_OK(cbs, action_ok_restart_content); BIND_ACTION_OK(cbs, action_ok_restart_content);
break; break;