Start creating new history files for music/video/image
This commit is contained in:
parent
f391c1b65d
commit
8b706ad805
61
command.c
61
command.c
|
@ -2102,23 +2102,74 @@ bool command_event(enum event_command cmd, void *data)
|
||||||
return false;
|
return false;
|
||||||
break;
|
break;
|
||||||
case CMD_EVENT_HISTORY_DEINIT:
|
case CMD_EVENT_HISTORY_DEINIT:
|
||||||
if (g_defaults.history)
|
if (g_defaults.content_history)
|
||||||
{
|
{
|
||||||
playlist_write_file(g_defaults.history);
|
playlist_write_file(g_defaults.content_history);
|
||||||
playlist_free(g_defaults.history);
|
playlist_free(g_defaults.content_history);
|
||||||
}
|
}
|
||||||
g_defaults.history = NULL;
|
g_defaults.content_history = NULL;
|
||||||
|
|
||||||
|
#ifdef HAVE_FFMPEG
|
||||||
|
if (g_defaults.video_history)
|
||||||
|
{
|
||||||
|
playlist_write_file(g_defaults.video_history);
|
||||||
|
playlist_free(g_defaults.video_history);
|
||||||
|
}
|
||||||
|
g_defaults.video_history = NULL;
|
||||||
|
|
||||||
|
if (g_defaults.music_history)
|
||||||
|
{
|
||||||
|
playlist_write_file(g_defaults.music_history);
|
||||||
|
playlist_free(g_defaults.music_history);
|
||||||
|
}
|
||||||
|
g_defaults.music_history = NULL;
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#ifdef HAVE_IMAGEVIEWER
|
||||||
|
if (g_defaults.image_history)
|
||||||
|
{
|
||||||
|
playlist_write_file(g_defaults.image_history);
|
||||||
|
playlist_free(g_defaults.image_history);
|
||||||
|
}
|
||||||
|
g_defaults.image_history = NULL;
|
||||||
|
#endif
|
||||||
break;
|
break;
|
||||||
case CMD_EVENT_HISTORY_INIT:
|
case CMD_EVENT_HISTORY_INIT:
|
||||||
command_event(CMD_EVENT_HISTORY_DEINIT, NULL);
|
command_event(CMD_EVENT_HISTORY_DEINIT, NULL);
|
||||||
if (!settings->history_list_enable)
|
if (!settings->history_list_enable)
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
RARCH_LOG("%s: [%s].\n",
|
RARCH_LOG("%s: [%s].\n",
|
||||||
msg_hash_to_str(MSG_LOADING_HISTORY_FILE),
|
msg_hash_to_str(MSG_LOADING_HISTORY_FILE),
|
||||||
settings->path.content_history);
|
settings->path.content_history);
|
||||||
g_defaults.history = playlist_init(
|
g_defaults.content_history = playlist_init(
|
||||||
settings->path.content_history,
|
settings->path.content_history,
|
||||||
settings->content_history_size);
|
settings->content_history_size);
|
||||||
|
|
||||||
|
#ifdef HAVE_FFMPEG
|
||||||
|
RARCH_LOG("%s: [%s].\n",
|
||||||
|
msg_hash_to_str(MSG_LOADING_HISTORY_FILE),
|
||||||
|
settings->path.content_music_history);
|
||||||
|
g_defaults.music_history = playlist_init(
|
||||||
|
settings->path.content_music_history,
|
||||||
|
settings->content_history_size);
|
||||||
|
|
||||||
|
RARCH_LOG("%s: [%s].\n",
|
||||||
|
msg_hash_to_str(MSG_LOADING_HISTORY_FILE),
|
||||||
|
settings->path.content_video_history);
|
||||||
|
g_defaults.video_history = playlist_init(
|
||||||
|
settings->path.content_video_history,
|
||||||
|
settings->content_history_size);
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#ifdef HAVE_IMAGEVIEWER
|
||||||
|
RARCH_LOG("%s: [%s].\n",
|
||||||
|
msg_hash_to_str(MSG_LOADING_HISTORY_FILE),
|
||||||
|
settings->path.content_image_history);
|
||||||
|
g_defaults.image_history = playlist_init(
|
||||||
|
settings->path.content_image_history,
|
||||||
|
settings->content_history_size);
|
||||||
|
#endif
|
||||||
break;
|
break;
|
||||||
case CMD_EVENT_CORE_INFO_DEINIT:
|
case CMD_EVENT_CORE_INFO_DEINIT:
|
||||||
core_info_deinit_list();
|
core_info_deinit_list();
|
||||||
|
|
|
@ -84,7 +84,14 @@ struct defaults
|
||||||
} settings;
|
} settings;
|
||||||
|
|
||||||
#ifndef IS_SALAMANDER
|
#ifndef IS_SALAMANDER
|
||||||
playlist_t *history;
|
playlist_t *content_history;
|
||||||
|
#ifdef HAVE_IMAGEVIEWER
|
||||||
|
playlist_t *image_history;
|
||||||
|
#endif
|
||||||
|
#ifdef HAVE_FFMPEG
|
||||||
|
playlist_t *video_history;
|
||||||
|
playlist_t *music_history;
|
||||||
|
#endif
|
||||||
#endif
|
#endif
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
|
@ -2844,6 +2844,8 @@ const char *msg_hash_to_str_us(enum msg_hash_enums msg)
|
||||||
|
|
||||||
switch (msg)
|
switch (msg)
|
||||||
{
|
{
|
||||||
|
case MSG_LOADING_HISTORY_FILE:
|
||||||
|
return "Loading history file";
|
||||||
case MENU_ENUM_LABEL_VALUE_SHADER_PIPELINE_RIBBON_SIMPLIFIED:
|
case MENU_ENUM_LABEL_VALUE_SHADER_PIPELINE_RIBBON_SIMPLIFIED:
|
||||||
return "Ribbon (simplified)";
|
return "Ribbon (simplified)";
|
||||||
case MENU_ENUM_LABEL_VALUE_SHADER_PIPELINE_RIBBON:
|
case MENU_ENUM_LABEL_VALUE_SHADER_PIPELINE_RIBBON:
|
||||||
|
|
|
@ -1011,7 +1011,7 @@ static int action_ok_playlist_entry(const char *path,
|
||||||
size_t selection;
|
size_t selection;
|
||||||
menu_content_ctx_playlist_info_t playlist_info;
|
menu_content_ctx_playlist_info_t playlist_info;
|
||||||
size_t selection_ptr = 0;
|
size_t selection_ptr = 0;
|
||||||
playlist_t *playlist = g_defaults.history;
|
playlist_t *playlist = g_defaults.content_history;
|
||||||
const char *entry_path = NULL;
|
const char *entry_path = NULL;
|
||||||
const char *entry_label = NULL;
|
const char *entry_label = NULL;
|
||||||
const char *core_path = NULL;
|
const char *core_path = NULL;
|
||||||
|
|
|
@ -5476,7 +5476,7 @@ bool menu_displaylist_ctl(enum menu_displaylist_ctl_state type, void *data)
|
||||||
if (settings->history_list_enable)
|
if (settings->history_list_enable)
|
||||||
{
|
{
|
||||||
char path_playlist[PATH_MAX_LENGTH] = {0};
|
char path_playlist[PATH_MAX_LENGTH] = {0};
|
||||||
playlist_t *playlist = g_defaults.history;
|
playlist_t *playlist = g_defaults.content_history;
|
||||||
|
|
||||||
if (!playlist)
|
if (!playlist)
|
||||||
command_event(CMD_EVENT_HISTORY_INIT, NULL);
|
command_event(CMD_EVENT_HISTORY_INIT, NULL);
|
||||||
|
|
|
@ -1667,7 +1667,7 @@ static bool task_load_content(content_ctx_info_t *content_info,
|
||||||
|
|
||||||
if (info && *tmp)
|
if (info && *tmp)
|
||||||
{
|
{
|
||||||
playlist_t *playlist_tmp = g_defaults.history;
|
playlist_t *playlist_tmp = g_defaults.content_history;
|
||||||
|
|
||||||
if (content_push_to_history_playlist(playlist_tmp, tmp, info, mode))
|
if (content_push_to_history_playlist(playlist_tmp, tmp, info, mode))
|
||||||
playlist_write_file(playlist_tmp);
|
playlist_write_file(playlist_tmp);
|
||||||
|
|
Loading…
Reference in New Issue