summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJonathan Gordon <rockbox@jdgordon.info>2008-04-23 10:28:34 +0000
committerJonathan Gordon <rockbox@jdgordon.info>2008-04-23 10:28:34 +0000
commit33b785e40bc2e302cd670a5896429e59cf201be3 (patch)
treebb048ae91a0d30b342fb0ac4bfdda63852df38eb
parent45f6469ad1e44d56b5bd14a5eb9cc605bfd92eb0 (diff)
downloadrockbox-33b785e40bc2e302cd670a5896429e59cf201be3.tar.gz
rockbox-33b785e40bc2e302cd670a5896429e59cf201be3.tar.bz2
rockbox-33b785e40bc2e302cd670a5896429e59cf201be3.zip
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
-rw-r--r--apps/plugins/jewels.c2
-rw-r--r--apps/plugins/jpeg.c2
-rw-r--r--apps/plugins/lib/playback_control.c5
-rw-r--r--apps/plugins/lib/playback_control.h3
-rw-r--r--apps/plugins/mazezam.c2
-rw-r--r--apps/plugins/sokoban.c2
-rw-r--r--apps/plugins/solitaire.c2
-rw-r--r--apps/plugins/sudoku/sudoku.c2
-rw-r--r--apps/plugins/text_editor.c9
-rw-r--r--apps/plugins/viewer.c2
10 files changed, 19 insertions, 12 deletions
diff --git a/apps/plugins/jewels.c b/apps/plugins/jewels.c
index eb8e70072e..7d81476390 100644
--- a/apps/plugins/jewels.c
+++ b/apps/plugins/jewels.c
@@ -1698,7 +1698,7 @@ static int jewels_main(struct game_context* bj) {
continue;
case MRES_PLAYBACK:
- playback_control(rb);
+ playback_control(rb, NULL);
rb->lcd_setfont(FONT_SYSFIXED);
inmenu = false;
selected = false;
diff --git a/apps/plugins/jpeg.c b/apps/plugins/jpeg.c
index 710772f270..596d4d73e7 100644
--- a/apps/plugins/jpeg.c
+++ b/apps/plugins/jpeg.c
@@ -2580,7 +2580,7 @@ int show_menu(void) /* return 1 to quit */
#if PLUGIN_BUFFER_SIZE >= MIN_MEM
case MIID_SHOW_PLAYBACK_MENU:
- playback_control(rb);
+ playback_control(rb, NULL);
break;
#endif
#ifdef HAVE_LCD_COLOR
diff --git a/apps/plugins/lib/playback_control.c b/apps/plugins/lib/playback_control.c
index 2bed02e7b0..cba4f5a0ee 100644
--- a/apps/plugins/lib/playback_control.c
+++ b/apps/plugins/lib/playback_control.c
@@ -108,8 +108,9 @@ void playback_control_init(struct plugin_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;
- 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;
}
diff --git a/apps/plugins/lib/playback_control.h b/apps/plugins/lib/playback_control.h
index 83f07644a9..6029152dcf 100644
--- a/apps/plugins/lib/playback_control.h
+++ b/apps/plugins/lib/playback_control.h
@@ -25,6 +25,7 @@ extern const struct menu_item_ex playback_control_menu;
void playback_control_init(struct plugin_api* newapi);
/* 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__ */
diff --git a/apps/plugins/mazezam.c b/apps/plugins/mazezam.c
index f898fc6031..2ee6e20059 100644
--- a/apps/plugins/mazezam.c
+++ b/apps/plugins/mazezam.c
@@ -641,7 +641,7 @@ static void in_game_menu(void)
break;
case 2: /* Audio playback */
- playback_control(rb);
+ playback_control(rb, NULL);
state = STATE_IN_LEVEL;
break;
diff --git a/apps/plugins/sokoban.c b/apps/plugins/sokoban.c
index 8b1fe508ce..c8a6ba7c92 100644
--- a/apps/plugins/sokoban.c
+++ b/apps/plugins/sokoban.c
@@ -1193,7 +1193,7 @@ static int sokoban_menu(void)
break;
case 2: /* Audio playback control */
- playback_control(rb);
+ playback_control(rb, NULL);
menu_quit = false;
break;
diff --git a/apps/plugins/solitaire.c b/apps/plugins/solitaire.c
index 6cb995ffba..40f9a241ea 100644
--- a/apps/plugins/solitaire.c
+++ b/apps/plugins/solitaire.c
@@ -747,7 +747,7 @@ int solitaire_menu(bool in_game)
break;
case 4:
- playback_control(rb);
+ playback_control(rb, NULL);
break;
case 5:
diff --git a/apps/plugins/sudoku/sudoku.c b/apps/plugins/sudoku/sudoku.c
index 553357fc5c..d76b68ef27 100644
--- a/apps/plugins/sudoku/sudoku.c
+++ b/apps/plugins/sudoku/sudoku.c
@@ -1078,7 +1078,7 @@ bool sudoku_menu(struct sudoku_state_t* state)
switch (result) {
case SM_AUDIO_PLAYBACK:
- playback_control(rb);
+ playback_control(rb, NULL);
break;
#ifdef HAVE_LCD_COLOR
diff --git a/apps/plugins/text_editor.c b/apps/plugins/text_editor.c
index 5397260c0d..617155fb2b 100644
--- a/apps/plugins/text_editor.c
+++ b/apps/plugins/text_editor.c
@@ -221,7 +221,8 @@ int do_item_menu(int cur_sel, char* copy_buffer)
MENUITEM_STRINGLIST(menu, "Line Options", NULL,
"Cut/Delete", "Copy",
"Insert Above", "Insert Below",
- "Concat To Above", "Save");
+ "Concat To Above", "Save",
+ "Show Playback Menu",);
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 */
ret = MENU_RET_SAVE;
break;
+ case 6: /* playback menu */
+ playback_control(rb, NULL);
+ ret = MENU_RET_UPDATE;
+ break;
default:
ret = MENU_RET_NO_UPDATE;
break;
@@ -474,7 +479,7 @@ enum plugin_status plugin_start(struct plugin_api* api, void* parameter)
case 0:
break;
case 1:
- playback_control(rb);
+ playback_control(rb, NULL);
break;
case 2: //save to disk
save_changes(1);
diff --git a/apps/plugins/viewer.c b/apps/plugins/viewer.c
index a4619269e5..a2afbc0641 100644
--- a/apps/plugins/viewer.c
+++ b/apps/plugins/viewer.c
@@ -1426,7 +1426,7 @@ static void viewer_menu(void)
done = viewer_options_menu();
break;
case 2: /* playback control */
- playback_control(rb);
+ playback_control(rb, NULL);
break;
case 3: /* return */
break;