From af9f4056510f248c4c9c1335167853bb455e8cc0 Mon Sep 17 00:00:00 2001 From: Jonathan Gordon Date: Tue, 16 Jun 2009 04:25:21 +0000 Subject: Accept FS#10094 by Teruaki Kawashima: Replace the old menu API with the "new" one (a very long time overdue so huge thanks for the work.) git-svn-id: svn://svn.rockbox.org/rockbox/trunk@21306 a1c6a512-1295-4272-9138-f99709370657 --- apps/plugins/test_sampr.c | 22 +++++----------------- 1 file changed, 5 insertions(+), 17 deletions(-) (limited to 'apps/plugins/test_sampr.c') diff --git a/apps/plugins/test_sampr.c b/apps/plugins/test_sampr.c index edfe261..45e1e78 100644 --- a/apps/plugins/test_sampr.c +++ b/apps/plugins/test_sampr.c @@ -19,7 +19,6 @@ * ****************************************************************************/ #include "plugin.h" -#include "lib/oldmenuapi.h" /* This plugin generates a 1kHz tone + noise in order to quickly verify * hardware samplerate setup is operating correctly. @@ -285,32 +284,23 @@ enum plugin_status plugin_start(const void *parameter) MENU_QUIT, }; - static const struct menu_item items[] = - { + MENUITEM_STRINGLIST(menu, "Test Sampr Menu", NULL, #ifndef HAVE_VOLUME_IN_LIST - [MENU_VOL_SET] = - { "Set Volume", NULL }, + "Set Volume", #endif /* HAVE_VOLUME_IN_LIST */ - [MENU_SAMPR_SET] = - { "Set Samplerate", NULL }, - [MENU_QUIT] = - { "Quit", NULL }, - }; + "Set Samplerate", "Quit"); bool exit = false; - int m; + int selected = 0; /* Disable all talking before initializing IRAM */ rb->talk_disable(true); PLUGIN_IRAM_INIT(rb); - m = menu_init(items, ARRAYLEN(items), - NULL, NULL, NULL, NULL); - while (!exit) { - int result = menu_show(m); + int result = rb->do_menu(&menu, &selected, NULL, false); switch (result) { @@ -329,8 +319,6 @@ enum plugin_status plugin_start(const void *parameter) } } - menu_exit(m); - rb->talk_disable(false); return PLUGIN_OK; -- cgit v1.1