From 3d44a20db7c9537deeaa964bd532ba342ddb4727 Mon Sep 17 00:00:00 2001 From: Jonathan Gordon Date: Thu, 26 Apr 2007 08:21:29 +0000 Subject: 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 --- apps/playlist_viewer.c | 22 +++++++++++++--------- 1 file changed, 13 insertions(+), 9 deletions(-) diff --git a/apps/playlist_viewer.c b/apps/playlist_viewer.c index 8a6fe73cba..b5cfe2a580 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; } -- cgit v1.2.3