Add environment command to get playlists path (#16103)

This commit is contained in:
Giovanni Cascione 2024-01-10 16:26:46 +01:00 committed by GitHub
parent caf2bcbc80
commit 5932a30824
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 22 additions and 0 deletions

View File

@ -1853,6 +1853,17 @@ enum retro_mod
* input devices does not need to take any action on its own.
*/
#define RETRO_ENVIRONMENT_GET_PLAYLIST_DIRECTORY 79
/* const char ** --
* Returns the "playlist" directory of the frontend.
* This directory can be used to store core generated playlists,
* in case this internal functionality is available (e.g. internal core
* game detection engine).
*
* The returned value can be NULL.
* If so, no such directory is defined,
* and it's up to the implementation to find a suitable directory.
*/
/* VFS functionality */
/* File paths:

View File

@ -2618,6 +2618,17 @@ bool runloop_environment_cb(unsigned cmd, void *data)
break;
}
case RETRO_ENVIRONMENT_GET_PLAYLIST_DIRECTORY:
{
const char **dir = (const char**)data;
const char *dir_playlist = settings->paths.directory_playlist;
*dir = *dir_playlist ? dir_playlist : NULL;
RARCH_LOG("[Environ]: PLAYLIST_DIRECTORY: \"%s\".\n",
dir_playlist);
break;
}
case RETRO_ENVIRONMENT_SET_SYSTEM_AV_INFO:
/**
* Update the system Audio/Video information.