mirror of
https://github.com/libretro/RetroArch
synced 2025-04-09 21:45:45 +00:00
Create command_playlist_update_write_file and move it to command.c
This commit is contained in:
parent
ca616f3e32
commit
b604a1871a
32
command.c
32
command.c
@ -1702,6 +1702,38 @@ static bool command_event_resize_windowed_scale(void)
|
|||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void command_playlist_update_write(
|
||||||
|
void *data,
|
||||||
|
size_t idx,
|
||||||
|
const char *core_display_name,
|
||||||
|
const char *label,
|
||||||
|
const char *path)
|
||||||
|
{
|
||||||
|
playlist_t *plist = (playlist_t*)data;
|
||||||
|
playlist_t *playlist = NULL;
|
||||||
|
|
||||||
|
if (plist)
|
||||||
|
playlist = plist;
|
||||||
|
#ifdef HAVE_MENU
|
||||||
|
else
|
||||||
|
menu_driver_ctl(RARCH_MENU_CTL_PLAYLIST_GET, &playlist);
|
||||||
|
#endif
|
||||||
|
if (!playlist)
|
||||||
|
return;
|
||||||
|
|
||||||
|
playlist_update(
|
||||||
|
playlist,
|
||||||
|
idx,
|
||||||
|
label,
|
||||||
|
NULL,
|
||||||
|
path,
|
||||||
|
core_display_name,
|
||||||
|
NULL,
|
||||||
|
NULL);
|
||||||
|
|
||||||
|
playlist_write_file(playlist);
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* command_event:
|
* command_event:
|
||||||
* @cmd : Event command index.
|
* @cmd : Event command index.
|
||||||
|
@ -259,6 +259,13 @@ bool command_free(command_t *handle);
|
|||||||
**/
|
**/
|
||||||
bool command_event(enum event_command action, void *data);
|
bool command_event(enum event_command action, void *data);
|
||||||
|
|
||||||
|
void command_playlist_update_write(
|
||||||
|
void *data,
|
||||||
|
size_t idx,
|
||||||
|
const char *core_display_name,
|
||||||
|
const char *label,
|
||||||
|
const char *path);
|
||||||
|
|
||||||
RETRO_END_DECLS
|
RETRO_END_DECLS
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
@ -1443,36 +1443,6 @@ static int action_ok_file_load(const char *path,
|
|||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
static void generic_playlist_update_write(
|
|
||||||
playlist_t *plist,
|
|
||||||
size_t idx,
|
|
||||||
const char *core_display_name,
|
|
||||||
const char *label,
|
|
||||||
const char *path)
|
|
||||||
{
|
|
||||||
playlist_t *playlist = NULL;
|
|
||||||
|
|
||||||
if (plist)
|
|
||||||
playlist = plist;
|
|
||||||
#ifdef HAVE_MENU
|
|
||||||
else
|
|
||||||
menu_driver_ctl(RARCH_MENU_CTL_PLAYLIST_GET, &playlist);
|
|
||||||
#endif
|
|
||||||
|
|
||||||
retro_assert(playlist != NULL);
|
|
||||||
|
|
||||||
playlist_update(
|
|
||||||
playlist,
|
|
||||||
idx,
|
|
||||||
label,
|
|
||||||
NULL,
|
|
||||||
path,
|
|
||||||
core_display_name,
|
|
||||||
NULL,
|
|
||||||
NULL);
|
|
||||||
|
|
||||||
playlist_write_file(playlist);
|
|
||||||
}
|
|
||||||
|
|
||||||
static int action_ok_playlist_entry_collection(const char *path,
|
static int action_ok_playlist_entry_collection(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)
|
||||||
@ -1563,7 +1533,7 @@ static int action_ok_playlist_entry_collection(const char *path,
|
|||||||
|
|
||||||
menu_driver_ctl(RARCH_MENU_CTL_PLAYLIST_GET, &tmp_playlist);
|
menu_driver_ctl(RARCH_MENU_CTL_PLAYLIST_GET, &tmp_playlist);
|
||||||
|
|
||||||
generic_playlist_update_write(tmp_playlist,
|
command_playlist_update_write(tmp_playlist,
|
||||||
selection_ptr,
|
selection_ptr,
|
||||||
core_info.inf->display_name,
|
core_info.inf->display_name,
|
||||||
NULL,
|
NULL,
|
||||||
@ -1650,7 +1620,7 @@ static int action_ok_playlist_entry(const char *path,
|
|||||||
return action_ok_file_load_with_detect_core(entry_path,
|
return action_ok_file_load_with_detect_core(entry_path,
|
||||||
label, type, selection_ptr, entry_idx);
|
label, type, selection_ptr, entry_idx);
|
||||||
|
|
||||||
generic_playlist_update_write(NULL,
|
command_playlist_update_write(NULL,
|
||||||
selection_ptr,
|
selection_ptr,
|
||||||
core_info.inf->display_name,
|
core_info.inf->display_name,
|
||||||
NULL,
|
NULL,
|
||||||
@ -1757,7 +1727,7 @@ static int action_ok_playlist_entry_start_content(const char *path,
|
|||||||
|
|
||||||
menu_driver_ctl(RARCH_MENU_CTL_PLAYLIST_GET, &tmp_playlist);
|
menu_driver_ctl(RARCH_MENU_CTL_PLAYLIST_GET, &tmp_playlist);
|
||||||
|
|
||||||
generic_playlist_update_write(
|
command_playlist_update_write(
|
||||||
tmp_playlist,
|
tmp_playlist,
|
||||||
selection_ptr,
|
selection_ptr,
|
||||||
core_info.inf->display_name,
|
core_info.inf->display_name,
|
||||||
@ -1936,7 +1906,7 @@ static void menu_input_st_string_cb_rename_entry(void *userdata,
|
|||||||
const char *label = menu_input_dialog_get_buffer();
|
const char *label = menu_input_dialog_get_buffer();
|
||||||
|
|
||||||
if (!string_is_empty(label))
|
if (!string_is_empty(label))
|
||||||
generic_playlist_update_write(NULL,
|
command_playlist_update_write(NULL,
|
||||||
menu_input_dialog_get_kb_idx(),
|
menu_input_dialog_get_kb_idx(),
|
||||||
NULL,
|
NULL,
|
||||||
label,
|
label,
|
||||||
@ -2314,7 +2284,7 @@ static int action_ok_core_deferred_set(const char *path,
|
|||||||
core_display_name[0] = '\0';
|
core_display_name[0] = '\0';
|
||||||
|
|
||||||
core_info_get_name(path, core_display_name, sizeof(core_display_name));
|
core_info_get_name(path, core_display_name, sizeof(core_display_name));
|
||||||
generic_playlist_update_write(NULL,
|
command_playlist_update_write(NULL,
|
||||||
rdb_entry_start_game_selection_ptr,
|
rdb_entry_start_game_selection_ptr,
|
||||||
core_display_name, NULL, path);
|
core_display_name, NULL, path);
|
||||||
|
|
||||||
@ -2333,7 +2303,7 @@ static int action_ok_core_deferred_set_current_core(const char *path,
|
|||||||
core_display_name[0] = '\0';
|
core_display_name[0] = '\0';
|
||||||
|
|
||||||
core_info_get_name(path, core_display_name, sizeof(core_display_name));
|
core_info_get_name(path, core_display_name, sizeof(core_display_name));
|
||||||
generic_playlist_update_write(NULL,
|
command_playlist_update_write(NULL,
|
||||||
rdb_entry_start_game_selection_ptr,
|
rdb_entry_start_game_selection_ptr,
|
||||||
core_display_name, NULL, path);
|
core_display_name, NULL, path);
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user