summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJonathan Gordon <rockbox@jdgordon.info>2007-04-26 08:21:29 +0000
committerJonathan Gordon <rockbox@jdgordon.info>2007-04-26 08:21:29 +0000
commit3d44a20db7c9537deeaa964bd532ba342ddb4727 (patch)
tree61dd31e9b1a1d37b9171474ef3c7807a21ec0884
parent5b5d1018d065e6fd44dca73d2a5e6f2eaf7850a8 (diff)
downloadrockbox-3d44a20db7c9537deeaa964bd532ba342ddb4727.zip
rockbox-3d44a20db7c9537deeaa964bd532ba342ddb4727.tar.gz
rockbox-3d44a20db7c9537deeaa964bd532ba342ddb4727.tar.bz2
rockbox-3d44a20db7c9537deeaa964bd532ba342ddb4727.tar.xz
Accept FS7078, try to show the last playlist if no audio is being played
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@13268 a1c6a512-1295-4272-9138-f99709370657
-rw-r--r--apps/playlist_viewer.c22
1 files changed, 13 insertions, 9 deletions
diff --git a/apps/playlist_viewer.c b/apps/playlist_viewer.c
index 8a6fe73..b5cfe2a 100644
--- a/apps/playlist_viewer.c
+++ b/apps/playlist_viewer.c
@@ -274,11 +274,19 @@ static bool playlist_viewer_init(struct playlist_viewer * viewer,
{
char* buffer;
size_t buffer_size;
- bool is_playing = audio_status() & AUDIO_STATUS_PLAY;
-
- if (!filename && !is_playing)
- /* Nothing is playing, exit */
+ bool is_playing = audio_status() & (AUDIO_STATUS_PLAY | AUDIO_STATUS_PAUSE);
+ bool have_list = filename || is_playing;
+ if (!have_list && (global_status.resume_index != -1))
+ {
+ /* Try to restore the list from control file */
+ have_list = (playlist_resume() != -1);
+ }
+ if (!have_list)
+ {
+ /* Nothing to view, exit */
+ gui_syncsplash(HZ, str(LANG_CATALOG_NO_PLAYLISTS));
return false;
+ }
buffer = plugin_get_buffer(&buffer_size);
if (!buffer)
@@ -567,14 +575,10 @@ bool playlist_viewer_ex(char* filename)
while (!exit)
{
int track;
- if (!viewer.playlist && !(audio_status() & AUDIO_STATUS_PLAY))
+ if (global_status.resume_index == -1)
{
/* Play has stopped */
-#ifdef HAVE_LCD_CHARCELLS
- gui_syncsplash(HZ, str(LANG_END_PLAYLIST_PLAYER));
-#else
gui_syncsplash(HZ, str(LANG_END_PLAYLIST_RECORDER));
-#endif
goto exit;
}