FS#13287 - Load a newly saved playlist and resume where it was

Works from any playlist saving operation accessed from the
While Playing Screen, all other playlist saving operations
are unchanged.

Now a user-selectable setting! Located in
General Settings -> Playlists -> Current Playlist ->
Reload After Saving (Yes/No)

Change-Id: I5085c3f4c56c518a812d5ee015d15cc4dca19a28
This commit is contained in:
Dana Conrad 2021-04-18 13:00:41 -05:00 committed by Solomon Peachy
parent 49edfc237b
commit 4f83e66cd4
9 changed files with 102 additions and 12 deletions

View file

@ -86,12 +86,12 @@ int ft_build_playlist(struct tree_context* c, int start_index)
* or started via bookmark autoload, true otherwise.
*
* Pointers to both the full pathname and the separated parts needed to
* avoid allocating yet another path buffer on the stack (and save some
* avoid allocating yet another path buffer on the stack (and save some
* code; the caller typically needs to create the full pathname anyway)...
*/
bool ft_play_playlist(char* pathname, char* dirname, char* filename)
bool ft_play_playlist(char* pathname, char* dirname, char* filename, bool skip_dyn_warning)
{
if (global_settings.party_mode && audio_status())
if (global_settings.party_mode && audio_status())
{
splash(HZ, ID2P(LANG_PARTY_MODE));
return false;
@ -105,9 +105,13 @@ bool ft_play_playlist(char* pathname, char* dirname, char* filename)
splash(0, ID2P(LANG_WAIT));
/* about to create a new current playlist...
allow user to cancel the operation */
if (!warn_on_pl_erase())
return false;
* allow user to cancel the operation.
* Do not show if skip_dyn_warning is true */
if (!skip_dyn_warning)
{
if (!warn_on_pl_erase())
return false;
}
if (playlist_create(dirname, filename) != -1)
{
@ -115,11 +119,11 @@ bool ft_play_playlist(char* pathname, char* dirname, char* filename)
{
playlist_shuffle(current_tick, -1);
}
playlist_start(0, 0, 0);
return true;
}
return false;
}
@ -465,7 +469,7 @@ int ft_enter(struct tree_context* c)
switch ( file_attr & FILE_ATTR_MASK ) {
case FILE_ATTR_M3U:
play = ft_play_playlist(buf, c->currdir, file->name);
play = ft_play_playlist(buf, c->currdir, file->name, false);
if (play)
{