mailer | 1 Nov 2009 03:36
Favicon

jdgordon: r23455 - in trunk/apps: . gui gui/skin_engine

Date: 2009-11-01 03:36:51 +0100 (Sun, 01 Nov 2009)
New Revision: 23455

Log Message:
Fix FS#10745 - %mv not working in sbs...
This fix is as good as we can do, but not perfect. Because the sbs is only updated when a button is pressed it
will stay in the "volume changing" state probalby longer than expected.. which isnt terrible, but useful
to remember.

Modified:
   trunk/apps/gui/option_select.c
   trunk/apps/gui/skin_engine/skin_parser.c
   trunk/apps/gui/skin_engine/skin_tokens.c
   trunk/apps/gui/skin_engine/wps_internals.h
   trunk/apps/gui/wps.c
   trunk/apps/main.c
   trunk/apps/misc.c
   trunk/apps/settings.h

Modified: trunk/apps/gui/option_select.c
===================================================================
--- trunk/apps/gui/option_select.c	2009-10-31 23:51:30 UTC (rev 23454)
+++ trunk/apps/gui/option_select.c	2009-11-01 02:36:51 UTC (rev 23455)
 <at>  <at>  -564,6 +564,9  <at>  <at> 
         /* callback */
         if ( function )
             function(*variable);
+        /* if the volume is changing we need to let the skins know */
+        if (function == sound_get_fn(SOUND_VOLUME))
+            global_status.last_volume_change = current_tick;
     }
     return false;
 }

Modified: trunk/apps/gui/skin_engine/skin_parser.c
===================================================================
--- trunk/apps/gui/skin_engine/skin_parser.c	2009-10-31 23:51:30 UTC (rev 23454)
+++ trunk/apps/gui/skin_engine/skin_parser.c	2009-11-01 02:36:51 UTC (rev 23455)
 <at>  <at>  -1632,7 +1632,6  <at>  <at> 
 #endif
     wps_data->tokens = NULL;
     wps_data->num_tokens = 0;
-    wps_data->button_time_volume = 0;

 #ifdef HAVE_LCD_BITMAP
     wps_data->peak_meter_enabled = false;

Modified: trunk/apps/gui/skin_engine/skin_tokens.c
===================================================================
--- trunk/apps/gui/skin_engine/skin_tokens.c	2009-10-31 23:51:30 UTC (rev 23454)
+++ trunk/apps/gui/skin_engine/skin_tokens.c	2009-11-01 02:36:51 UTC (rev 23455)
 <at>  <at>  -818,8 +818,8  <at>  <at> 
                 return NULL;
 #endif
         case WPS_TOKEN_BUTTON_VOLUME:
-            if (data->button_time_volume &&
-                TIME_BEFORE(current_tick, data->button_time_volume +
+            if (global_status.last_volume_change &&
+                TIME_BEFORE(current_tick, global_status.last_volume_change +
                                           token->value.i * TIMEOUT_UNIT))
                 return "v";
             return NULL;

Modified: trunk/apps/gui/skin_engine/wps_internals.h
===================================================================
--- trunk/apps/gui/skin_engine/wps_internals.h	2009-10-31 23:51:30 UTC (rev 23454)
+++ trunk/apps/gui/skin_engine/wps_internals.h	2009-11-01 02:36:51 UTC (rev 23455)
 <at>  <at>  -264,8 +264,6  <at>  <at> 
     /* Total number of tokens in the WPS. During WPS parsing, this is
        the index of the token being parsed. */
     int num_tokens;
-    /* tick the volume button was last pressed */
-    unsigned int button_time_volume;

 #ifdef HAVE_LCD_BITMAP
     bool peak_meter_enabled;

Modified: trunk/apps/gui/wps.c
===================================================================
--- trunk/apps/gui/wps.c	2009-10-31 23:51:30 UTC (rev 23454)
+++ trunk/apps/gui/wps.c	2009-11-01 02:36:51 UTC (rev 23455)
 <at>  <at>  -1130,8 +1130,6  <at>  <at> 

         if (vol_changed)
         {
-            FOR_NB_SCREENS(i)
-                gui_wps[i].data->button_time_volume = current_tick;
             bool res = false;
             setvol();
             FOR_NB_SCREENS(i)

Modified: trunk/apps/main.c
===================================================================
--- trunk/apps/main.c	2009-10-31 23:51:30 UTC (rev 23454)
+++ trunk/apps/main.c	2009-11-01 02:36:51 UTC (rev 23455)
 <at>  <at>  -158,6 +158,7  <at>  <at> 
     }
 #endif /* #ifdef AUTOROCK */

+    global_status.last_volume_change = 0;
     root_menu();
 }

Modified: trunk/apps/misc.c
===================================================================
--- trunk/apps/misc.c	2009-10-31 23:51:30 UTC (rev 23454)
+++ trunk/apps/misc.c	2009-11-01 02:36:51 UTC (rev 23455)
 <at>  <at>  -739,6 +739,7  <at>  <at> 
     if (global_settings.volume > max_vol)
         global_settings.volume = max_vol;
     sound_set_volume(global_settings.volume);
+    global_status.last_volume_change = current_tick;
     settings_save();
 }

Modified: trunk/apps/settings.h
===================================================================
--- trunk/apps/settings.h	2009-10-31 23:51:30 UTC (rev 23454)
+++ trunk/apps/settings.h	2009-11-01 02:36:51 UTC (rev 23455)
 <at>  <at>  -308,6 +308,7  <at>  <at> 
 #endif
     signed char last_screen;
     int  viewer_icon_count;
+    int last_volume_change; /* tick the last volume change happened. skins use this */
 };

 struct user_settings

_______________________________________________
rockbox-cvs mailing list
rockbox-cvs <at> cool.haxx.se
http://cool.haxx.se/cgi-bin/mailman/listinfo/rockbox-cvs


Gmane