From 40595bd57ac138e1f6240a619a29a76c51b11b35 Mon Sep 17 00:00:00 2001 From: Robert Kukla Date: Mon, 26 Mar 2007 23:10:40 +0000 Subject: [PATCH] #ifdef HAVE_TAGCACHE the set_rating code and remove some old, unused code git-svn-id: svn://svn.rockbox.org/rockbox/trunk@12936 a1c6a512-1295-4272-9138-f99709370657 --- apps/onplay.c | 28 +++++++++++++++------------- apps/screens.c | 49 ------------------------------------------------- apps/screens.h | 1 - 3 files changed, 15 insertions(+), 63 deletions(-) diff --git a/apps/onplay.c b/apps/onplay.c index 60fc418d40..fe70873c56 100644 --- a/apps/onplay.c +++ b/apps/onplay.c @@ -869,7 +869,7 @@ static int onplay_callback(int key, int menu) return key; } - +#ifdef HAVE_TAGCACHE char rating_menu_string[32]; static void create_rating_menu(void) @@ -895,7 +895,7 @@ static bool set_rating_inline(void) create_rating_menu(); return false; } - +#endif int onplay(char* file, int attr, int from) { @@ -936,6 +936,7 @@ int onplay(char* file, int attr, int from) if (context == CONTEXT_WPS) { +#ifdef HAVE_TAGCACHE if(file && global_settings.runtimedb) { create_rating_menu(); @@ -943,6 +944,7 @@ int onplay(char* file, int attr, int from) items[i].function = set_rating_inline; i++; } +#endif items[i].desc = ID2P(LANG_BOOKMARK_MENU); items[i].function = bookmark_menu; i++; @@ -955,12 +957,6 @@ int onplay(char* file, int attr, int from) items[i].desc = ID2P(LANG_MENU_SHOW_ID3_INFO); items[i].function = browse_id3; i++; -/* if(rundb_initialized) - { - items[i].desc = ID2P(LANG_MENU_SET_RATING); - items[i].function = set_rating; - i++; - }*/ } #ifdef HAVE_MULTIVOLUME @@ -1072,11 +1068,17 @@ int onplay(char* file, int attr, int from) if (i) { m = menu_init( items, i, onplay_callback, NULL, NULL, NULL ); - do { - result = menu_show(m); - if (result >= 0) - items[result].function(); - } while (items[result].function == set_rating_inline); +#ifdef HAVE_TAGCACHE + do + { +#endif + result = menu_show(m); + if (result >= 0) + items[result].function(); +#ifdef HAVE_TAGCACHE + } + while (items[result].function == set_rating_inline); +#endif menu_exit(m); if (exit_to_main) diff --git a/apps/screens.c b/apps/screens.c index f6def2fd89..f06c02a4f1 100644 --- a/apps/screens.c +++ b/apps/screens.c @@ -1254,55 +1254,6 @@ bool browse_id3(void) } } -#if 0 /* Currently unused */ -bool set_rating(void) -{ - struct mp3entry* id3 = audio_current_track(); - int button; - bool exit = false; - char rating_text[20]; - - if (!(audio_status() & AUDIO_STATUS_PLAY)||id3==NULL) - return false; - while (!exit) - { - lcd_clear_display(); - lcd_puts(0, 0, str(LANG_RATING)); - snprintf(rating_text, sizeof(rating_text), "%d", id3->rating); - lcd_puts(0, 1, (unsigned char *)rating_text); - lcd_update(); - button = get_action(CONTEXT_SETTINGS,TIMEOUT_BLOCK); - - switch(button) - { - case ACTION_SETTINGS_DEC: - if (id3->rating > 0) - id3->rating--; - else - id3->rating = 10; - break; - - case ACTION_SETTINGS_INC: - if (id3->rating < 10) - id3->rating++; - else - id3->rating = 0; - break; - case ACTION_STD_CANCEL: - exit = true; - break; - - default: - if(default_event_handler(button) == SYS_USB_CONNECTED) - return true; - break; - } - } - action_signalscreenchange(); - return false; -} -#endif - bool view_runtime(void) { char s[32]; diff --git a/apps/screens.h b/apps/screens.h index ce174e1e58..04cf0e9ee8 100644 --- a/apps/screens.h +++ b/apps/screens.h @@ -48,7 +48,6 @@ bool set_time_screen(const char* string, struct tm *tm); bool shutdown_screen(void); bool browse_id3(void); -/* bool set_rating(void); Currently unused */ bool view_runtime(void); #endif