Index: apps/onplay.c
===================================================================
RCS file: /cvsroot/rockbox/apps/onplay.c,v
retrieving revision 1.90
diff -u -r1.90 onplay.c
--- apps/onplay.c	25 Oct 2006 10:17:53 -0000	1.90
+++ apps/onplay.c	5 Nov 2006 20:35:49 -0000
@@ -829,6 +829,34 @@
     return key;
 }
 
+
+char rating_menu_string[32];
+
+static void create_rating_menu(void)
+{
+    struct mp3entry* id3 = audio_current_track();
+    if(id3)
+        snprintf(rating_menu_string, sizeof rating_menu_string,
+             "%s: %d", str(LANG_MENU_SET_RATING), id3->rating);
+    else         
+        snprintf(rating_menu_string, sizeof rating_menu_string,
+             "%s: -", str(LANG_MENU_SET_RATING));
+}
+
+static bool set_rating_inline(void)
+{
+    struct mp3entry* id3 = audio_current_track();
+    if(id3) {
+        if(id3->rating<5) 
+            id3->rating++;
+        else
+            id3->rating=0;
+    }    
+    create_rating_menu();
+    return false;
+}
+
+
 int onplay(char* file, int attr, int from)
 {
 #if CONFIG_CODEC == SWCODEC
@@ -868,6 +896,13 @@
 
     if (context == CONTEXT_WPS)
     {
+        if(file && global_settings.runtimedb)
+        {
+            create_rating_menu();
+            items[i].desc = rating_menu_string;
+            items[i].function = set_rating_inline;
+            i++;
+        }
         items[i].desc = ID2P(LANG_BOOKMARK_MENU);
         items[i].function = bookmark_menu;
         i++;
@@ -990,9 +1025,11 @@
     if (i)
     {
         m = menu_init( items, i, onplay_callback, NULL, NULL, NULL );
-        result = menu_show(m);
-        if (result >= 0)
-            items[result].function();
+        do {
+          result = menu_show(m);
+          if (result >= 0)
+              items[result].function();
+        } while (items[result].function == set_rating_inline);    
         menu_exit(m);
 
         if (exit_to_main)
