summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChristi Scarborough <christi@coraline.org>2005-06-26 15:21:29 +0000
committerChristi Scarborough <christi@coraline.org>2005-06-26 15:21:29 +0000
commit314c2dec1eee9f91076f263aa038d6ef1eca672d (patch)
treef0501c3d0aca1145e0f5b9b86c8c0d7c2055cbd4
parentf69e6eaeb58afb3246be2c3bc77eb0f2c0b1a1ca (diff)
downloadrockbox-314c2dec1eee9f91076f263aa038d6ef1eca672d.tar.gz
rockbox-314c2dec1eee9f91076f263aa038d6ef1eca672d.zip
Resume behaviour. Resume setting renamed to 'Resume on Startup'. Pressing the resume button from the WPS now resumes without prompting, regardless of the resume on startup setting. Error message displayed if no playlist in memory. (Bug in iriver playlist handling means that playlists don't get unloaded at the end of the playlist, so this feature does not currently work on iRiver.)
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@6872 a1c6a512-1295-4272-9138-f99709370657
-rw-r--r--apps/lang/english.lang10
-rw-r--r--apps/tree.c22
2 files changed, 19 insertions, 13 deletions
diff --git a/apps/lang/english.lang b/apps/lang/english.lang
index 02bb3dca07..3b068bf50d 100644
--- a/apps/lang/english.lang
+++ b/apps/lang/english.lang
@@ -159,8 +159,8 @@ new:
159 159
160id: LANG_RESUME 160id: LANG_RESUME
161desc: in settings_menu 161desc: in settings_menu
162eng: "Resume" 162eng: "Resume on startup"
163voice: "Resume" 163voice: "Resume on startup"
164new: 164new:
165 165
166id: LANG_OFF 166id: LANG_OFF
@@ -3125,6 +3125,12 @@ eng: "Reshuffle"
3125voice: "Reshuffle" 3125voice: "Reshuffle"
3126new: 3126new:
3127 3127
3128id: LANG_NOTHING_TO_RESUME
3129desc: Error message displayed when resume button pressed but no playlist
3130eng: "Nothing to resume"
3131voice: ""
3132new:
3133
3128id: LANG_INSERT_SHUFFLED 3134id: LANG_INSERT_SHUFFLED
3129desc: in onplay menu. insert a track/playlist randomly into dynamic playlist 3135desc: in onplay menu. insert a track/playlist randomly into dynamic playlist
3130eng: "Insert shuffled" 3136eng: "Insert shuffled"
diff --git a/apps/tree.c b/apps/tree.c
index 344088d12a..46413fe31b 100644
--- a/apps/tree.c
+++ b/apps/tree.c
@@ -431,7 +431,7 @@ static int showdir(void)
431 return tc.filesindir; 431 return tc.filesindir;
432} 432}
433 433
434static bool ask_resume(bool ask_once) 434static bool ask_resume(bool just_powered_on)
435{ 435{
436 int button; 436 int button;
437 bool stop = false; 437 bool stop = false;
@@ -449,7 +449,7 @@ static bool ask_resume(bool ask_once)
449#endif 449#endif
450 450
451 /* always resume? */ 451 /* always resume? */
452 if ( global_settings.resume == RESUME_ON) 452 if ( global_settings.resume == RESUME_ON || ! just_powered_on)
453 return true; 453 return true;
454 454
455 lcd_clear_display(); 455 lcd_clear_display();
@@ -475,17 +475,15 @@ static bool ask_resume(bool ask_once)
475#ifdef TREE_RC_RUN_PRE 475#ifdef TREE_RC_RUN_PRE
476 case TREE_RC_RUN_PRE: /* catch the press, not the release */ 476 case TREE_RC_RUN_PRE: /* catch the press, not the release */
477#else 477#else
478#ifdef TREE_RC_RUN
479 case TREE_RC_RUN: 478 case TREE_RC_RUN:
480#endif 479#endif
481#endif
482 ignore_power = false; 480 ignore_power = false;
483 /* Don't ignore the power button for subsequent calls */ 481 /* Don't ignore the power button for subsequent calls */
484 return true; 482 return true;
485 483
486#ifdef TREE_POWER_BTN 484#ifdef TREE_POWER_BTN
487 /* Initially ignore the button which powers on the box. It 485 /* Initially ignore the button which powers on the box. It
488 might still be pressed since booting. */ 486 * might still be pressed since booting. */
489 case TREE_POWER_BTN: 487 case TREE_POWER_BTN:
490 case TREE_POWER_BTN | BUTTON_REPEAT: 488 case TREE_POWER_BTN | BUTTON_REPEAT:
491 if(!ignore_power) 489 if(!ignore_power)
@@ -497,6 +495,7 @@ static bool ask_resume(bool ask_once)
497 ignore_power = false; 495 ignore_power = false;
498 break; 496 break;
499#endif 497#endif
498
500 /* Handle sys events, ignore button releases */ 499 /* Handle sys events, ignore button releases */
501 default: 500 default:
502 if(default_event_handler(button) == SYS_USB_CONNECTED || 501 if(default_event_handler(button) == SYS_USB_CONNECTED ||
@@ -506,7 +505,7 @@ static bool ask_resume(bool ask_once)
506 } 505 }
507 } 506 }
508 507
509 if ( global_settings.resume == RESUME_ASK_ONCE && ask_once) { 508 if ( global_settings.resume == RESUME_ASK_ONCE && just_powered_on) {
510 global_settings.resume_index = -1; 509 global_settings.resume_index = -1;
511 settings_save(); 510 settings_save();
512 } 511 }
@@ -547,15 +546,15 @@ void reload_directory(void)
547 reload_dir = true; 546 reload_dir = true;
548} 547}
549 548
550static void start_resume(bool ask_once) 549static void start_resume(bool just_powered_on)
551{ 550{
552 if ( global_settings.resume && 551 if ( ( global_settings.resume || ! just_powered_on ) &&
553 global_settings.resume_index != -1 ) { 552 global_settings.resume_index != -1 ) {
554 DEBUGF("Resume index %X offset %X\n", 553 DEBUGF("Resume index %X offset %X\n",
555 global_settings.resume_index, 554 global_settings.resume_index,
556 global_settings.resume_offset); 555 global_settings.resume_offset);
557 556
558 if (!ask_resume(ask_once)) 557 if (!ask_resume(just_powered_on) && just_powered_on )
559 return; 558 return;
560 559
561 if (playlist_resume() != -1) 560 if (playlist_resume() != -1)
@@ -565,8 +564,9 @@ static void start_resume(bool ask_once)
565 564
566 start_wps = true; 565 start_wps = true;
567 } 566 }
568 else 567 else return;
569 return; 568 } else if (! just_powered_on) {
569 splash(HZ*2, true, str(LANG_NOTHING_TO_RESUME));
570 } 570 }
571} 571}
572 572