Adapt pictureflow and random_folder_advance_config to make use of the new goto-wps exit feature.
For pictureflow a menu item is added, but the key press that works in the filetree works also (unless it's already remapped), rfa will go to the wps after selecting "Play Shuffled", as it needs to exit then anyway. git-svn-id: svn://svn.rockbox.org/rockbox/trunk@21681 a1c6a512-1295-4272-9138-f99709370657
This commit is contained in:
parent
df6f955a82
commit
f4c31ae309
2 changed files with 56 additions and 52 deletions
|
@ -54,6 +54,8 @@ PLUGIN_HEADER
|
|||
#define PF_CONTEXT ACTION_STD_CONTEXT
|
||||
#define PF_BACK ACTION_STD_CANCEL
|
||||
#define PF_MENU ACTION_STD_MENU
|
||||
#define PF_WPS ACTION_TREE_WPS
|
||||
|
||||
#define PF_QUIT (LAST_ACTION_PLACEHOLDER + 1)
|
||||
|
||||
#if defined(HAVE_SCROLLWHEEL) || CONFIG_KEYPAD == IRIVER_H10_PAD || \
|
||||
|
@ -2013,6 +2015,10 @@ void update_scroll_animation(void)
|
|||
void cleanup(void *parameter)
|
||||
{
|
||||
(void) parameter;
|
||||
#ifdef HAVE_ADJUSTABLE_CPU_FREQ
|
||||
rb->cpu_boost(false);
|
||||
#endif
|
||||
end_pf_thread();
|
||||
/* Turn on backlight timeout (revert to settings) */
|
||||
backlight_use_settings(); /* backlight control in lib/helper.c */
|
||||
|
||||
|
@ -2141,6 +2147,7 @@ int settings_menu(void)
|
|||
Show the main menu
|
||||
*/
|
||||
enum {
|
||||
PF_GOTO_WPS,
|
||||
#if PF_PLAYBACK_CAPABLE
|
||||
PF_MENU_PLAYBACK_CONTROL,
|
||||
#endif
|
||||
|
@ -2159,12 +2166,15 @@ int main_menu(void)
|
|||
#endif
|
||||
|
||||
MENUITEM_STRINGLIST(main_menu,"PictureFlow Main Menu",NULL,
|
||||
"Go to WPS",
|
||||
#if PF_PLAYBACK_CAPABLE
|
||||
"Playback Control",
|
||||
#endif
|
||||
"Settings", "Return", "Quit");
|
||||
while (1) {
|
||||
switch (rb->do_menu(&main_menu,&selection, NULL, false)) {
|
||||
case PF_GOTO_WPS: /* WPS */
|
||||
return -2;
|
||||
#if PF_PLAYBACK_CAPABLE
|
||||
case PF_MENU_PLAYBACK_CONTROL: /* Playback Control */
|
||||
playback_control(NULL);
|
||||
|
@ -2174,10 +2184,8 @@ int main_menu(void)
|
|||
result = settings_menu();
|
||||
if ( result != 0 ) return result;
|
||||
break;
|
||||
|
||||
case PF_MENU_RETURN:
|
||||
return 0;
|
||||
|
||||
case PF_MENU_QUIT:
|
||||
return -1;
|
||||
|
||||
|
@ -2405,6 +2413,7 @@ play:
|
|||
old_shuffle = shuffle;
|
||||
}
|
||||
#endif
|
||||
|
||||
/**
|
||||
Draw the current album name
|
||||
*/
|
||||
|
@ -2661,7 +2670,8 @@ int main(void)
|
|||
switch (button) {
|
||||
case PF_QUIT:
|
||||
return PLUGIN_OK;
|
||||
|
||||
case PF_WPS:
|
||||
return PLUGIN_GOTO_WPS;
|
||||
case PF_BACK:
|
||||
if ( pf_state == pf_show_tracks )
|
||||
{
|
||||
|
@ -2673,12 +2683,12 @@ int main(void)
|
|||
if (pf_state == pf_idle || pf_state == pf_scrolling)
|
||||
return PLUGIN_OK;
|
||||
break;
|
||||
|
||||
case PF_MENU:
|
||||
#ifdef USEGSLIB
|
||||
grey_show(false);
|
||||
#endif
|
||||
ret = main_menu();
|
||||
if ( ret == -2 ) return PLUGIN_GOTO_WPS;
|
||||
if ( ret == -1 ) return PLUGIN_OK;
|
||||
if ( ret != 0 ) return ret;
|
||||
#ifdef USEGSLIB
|
||||
|
@ -2713,7 +2723,6 @@ int main(void)
|
|||
#endif
|
||||
}
|
||||
break;
|
||||
|
||||
default:
|
||||
if (rb->default_event_handler_ex(button, cleanup, NULL)
|
||||
== SYS_USB_CONNECTED)
|
||||
|
@ -2752,9 +2761,6 @@ enum plugin_status plugin_start(const void *parameter)
|
|||
#endif
|
||||
#endif
|
||||
ret = main();
|
||||
#ifdef HAVE_ADJUSTABLE_CPU_FREQ
|
||||
rb->cpu_boost(false);
|
||||
#endif
|
||||
if ( ret == PLUGIN_OK ) {
|
||||
if (configfile_save(CONFIG_FILE, config, CONFIG_NUM_ITEMS,
|
||||
CONFIG_VERSION))
|
||||
|
@ -2764,7 +2770,6 @@ enum plugin_status plugin_start(const void *parameter)
|
|||
}
|
||||
}
|
||||
|
||||
end_pf_thread();
|
||||
cleanup(NULL);
|
||||
return ret;
|
||||
}
|
||||
|
|
|
@ -535,10 +535,8 @@ int start_shuffled_play(void)
|
|||
return 1;
|
||||
}
|
||||
|
||||
int main_menu(void)
|
||||
enum plugin_status main_menu(void)
|
||||
{
|
||||
bool exit = false;
|
||||
|
||||
MENUITEM_STRINGLIST(menu, "Main Menu", NULL,
|
||||
"Generate Folder List",
|
||||
"Edit Folder List",
|
||||
|
@ -547,6 +545,8 @@ int main_menu(void)
|
|||
"Play Shuffled",
|
||||
"Quit");
|
||||
|
||||
while (true)
|
||||
{
|
||||
switch (rb->do_menu(&menu, NULL, NULL, false))
|
||||
{
|
||||
case 0: /* generate */
|
||||
|
@ -567,7 +567,7 @@ int main_menu(void)
|
|||
rb->cpu_boost(true);
|
||||
#endif
|
||||
if (edit_list() < 0)
|
||||
exit = true;
|
||||
return PLUGIN_OK;
|
||||
#ifdef HAVE_ADJUSTABLE_CPU_FREQ
|
||||
rb->cpu_boost(false);
|
||||
#endif
|
||||
|
@ -603,13 +603,14 @@ int main_menu(void)
|
|||
rb->backlight_on();
|
||||
break;
|
||||
case 4:
|
||||
start_shuffled_play();
|
||||
exit=true;
|
||||
break;
|
||||
if (!start_shuffled_play())
|
||||
return PLUGIN_ERROR;
|
||||
else
|
||||
return PLUGIN_GOTO_WPS;
|
||||
case 5:
|
||||
return 1;
|
||||
return PLUGIN_OK;
|
||||
}
|
||||
}
|
||||
return exit?1:0;
|
||||
}
|
||||
|
||||
enum plugin_status plugin_start(const void* parameter)
|
||||
|
@ -618,7 +619,5 @@ enum plugin_status plugin_start(const void* parameter)
|
|||
|
||||
abort = false;
|
||||
|
||||
while (!main_menu())
|
||||
;
|
||||
return PLUGIN_OK;
|
||||
return main_menu();
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue