allow the plugin playback control menu to be put in a viewport.

fix text editor so it is actually possible to get to the control menu if the file hasnt been changed (its in the regular menu now)


git-svn-id: svn://svn.rockbox.org/rockbox/trunk@17221 a1c6a512-1295-4272-9138-f99709370657
This commit is contained in:
Jonathan Gordon 2008-04-23 10:28:34 +00:00
parent 45f6469ad1
commit 33b785e40b
10 changed files with 19 additions and 12 deletions

View file

@ -1698,7 +1698,7 @@ static int jewels_main(struct game_context* bj) {
continue; continue;
case MRES_PLAYBACK: case MRES_PLAYBACK:
playback_control(rb); playback_control(rb, NULL);
rb->lcd_setfont(FONT_SYSFIXED); rb->lcd_setfont(FONT_SYSFIXED);
inmenu = false; inmenu = false;
selected = false; selected = false;

View file

@ -2580,7 +2580,7 @@ int show_menu(void) /* return 1 to quit */
#if PLUGIN_BUFFER_SIZE >= MIN_MEM #if PLUGIN_BUFFER_SIZE >= MIN_MEM
case MIID_SHOW_PLAYBACK_MENU: case MIID_SHOW_PLAYBACK_MENU:
playback_control(rb); playback_control(rb, NULL);
break; break;
#endif #endif
#ifdef HAVE_LCD_COLOR #ifdef HAVE_LCD_COLOR

View file

@ -108,8 +108,9 @@ void playback_control_init(struct plugin_api* newapi)
api = newapi; api = newapi;
} }
bool playback_control(struct plugin_api* newapi) bool playback_control(struct plugin_api* newapi,
struct viewport parent[NB_SCREENS])
{ {
api = newapi; api = newapi;
return api->do_menu(&playback_control_menu, NULL, NULL, false) == MENU_ATTACHED_USB; return api->do_menu(&playback_control_menu, NULL, parent, false) == MENU_ATTACHED_USB;
} }

View file

@ -25,6 +25,7 @@ extern const struct menu_item_ex playback_control_menu;
void playback_control_init(struct plugin_api* newapi); void playback_control_init(struct plugin_api* newapi);
/* Use this if your menu still uses the old menu api */ /* Use this if your menu still uses the old menu api */
bool playback_control(struct plugin_api* api); bool playback_control(struct plugin_api* api,
struct viewport parent[NB_SCREENS]);
#endif /* __PLAYBACK_CONTROL_H__ */ #endif /* __PLAYBACK_CONTROL_H__ */

View file

@ -641,7 +641,7 @@ static void in_game_menu(void)
break; break;
case 2: /* Audio playback */ case 2: /* Audio playback */
playback_control(rb); playback_control(rb, NULL);
state = STATE_IN_LEVEL; state = STATE_IN_LEVEL;
break; break;

View file

@ -1193,7 +1193,7 @@ static int sokoban_menu(void)
break; break;
case 2: /* Audio playback control */ case 2: /* Audio playback control */
playback_control(rb); playback_control(rb, NULL);
menu_quit = false; menu_quit = false;
break; break;

View file

@ -747,7 +747,7 @@ int solitaire_menu(bool in_game)
break; break;
case 4: case 4:
playback_control(rb); playback_control(rb, NULL);
break; break;
case 5: case 5:

View file

@ -1078,7 +1078,7 @@ bool sudoku_menu(struct sudoku_state_t* state)
switch (result) { switch (result) {
case SM_AUDIO_PLAYBACK: case SM_AUDIO_PLAYBACK:
playback_control(rb); playback_control(rb, NULL);
break; break;
#ifdef HAVE_LCD_COLOR #ifdef HAVE_LCD_COLOR

View file

@ -221,7 +221,8 @@ int do_item_menu(int cur_sel, char* copy_buffer)
MENUITEM_STRINGLIST(menu, "Line Options", NULL, MENUITEM_STRINGLIST(menu, "Line Options", NULL,
"Cut/Delete", "Copy", "Cut/Delete", "Copy",
"Insert Above", "Insert Below", "Insert Above", "Insert Below",
"Concat To Above", "Save"); "Concat To Above", "Save",
"Show Playback Menu",);
switch (rb->do_menu(&menu, NULL, NULL, false)) switch (rb->do_menu(&menu, NULL, NULL, false))
{ {
@ -260,6 +261,10 @@ int do_item_menu(int cur_sel, char* copy_buffer)
case 5: /* save */ case 5: /* save */
ret = MENU_RET_SAVE; ret = MENU_RET_SAVE;
break; break;
case 6: /* playback menu */
playback_control(rb, NULL);
ret = MENU_RET_UPDATE;
break;
default: default:
ret = MENU_RET_NO_UPDATE; ret = MENU_RET_NO_UPDATE;
break; break;
@ -474,7 +479,7 @@ enum plugin_status plugin_start(struct plugin_api* api, void* parameter)
case 0: case 0:
break; break;
case 1: case 1:
playback_control(rb); playback_control(rb, NULL);
break; break;
case 2: //save to disk case 2: //save to disk
save_changes(1); save_changes(1);

View file

@ -1426,7 +1426,7 @@ static void viewer_menu(void)
done = viewer_options_menu(); done = viewer_options_menu();
break; break;
case 2: /* playback control */ case 2: /* playback control */
playback_control(rb); playback_control(rb, NULL);
break; break;
case 3: /* return */ case 3: /* return */
break; break;