summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJonathan Gordon <rockbox@jdgordon.info>2009-11-01 02:36:51 +0000
committerJonathan Gordon <rockbox@jdgordon.info>2009-11-01 02:36:51 +0000
commit235d1ae79574476b2ed5167b33dc8e06489b35a0 (patch)
treedc3416696b60f4abdb8a387193bc8ad37500a75f
parentbf751924dc4ed49ad0f0fb704531d1e4290b58cb (diff)
downloadrockbox-235d1ae79574476b2ed5167b33dc8e06489b35a0.zip
rockbox-235d1ae79574476b2ed5167b33dc8e06489b35a0.tar.gz
rockbox-235d1ae79574476b2ed5167b33dc8e06489b35a0.tar.bz2
rockbox-235d1ae79574476b2ed5167b33dc8e06489b35a0.tar.xz
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. git-svn-id: svn://svn.rockbox.org/rockbox/trunk@23455 a1c6a512-1295-4272-9138-f99709370657
-rw-r--r--apps/gui/option_select.c3
-rw-r--r--apps/gui/skin_engine/skin_parser.c1
-rw-r--r--apps/gui/skin_engine/skin_tokens.c4
-rw-r--r--apps/gui/skin_engine/wps_internals.h2
-rw-r--r--apps/gui/wps.c2
-rw-r--r--apps/main.c1
-rw-r--r--apps/misc.c1
-rw-r--r--apps/settings.h1
8 files changed, 8 insertions, 7 deletions
diff --git a/apps/gui/option_select.c b/apps/gui/option_select.c
index 7d142b0..1f5e870 100644
--- a/apps/gui/option_select.c
+++ b/apps/gui/option_select.c
@@ -564,6 +564,9 @@ bool option_screen(const struct settings_list *setting,
/* 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;
}
diff --git a/apps/gui/skin_engine/skin_parser.c b/apps/gui/skin_engine/skin_parser.c
index 434e7c9..7f6e80d 100644
--- a/apps/gui/skin_engine/skin_parser.c
+++ b/apps/gui/skin_engine/skin_parser.c
@@ -1632,7 +1632,6 @@ void skin_data_reset(struct wps_data *wps_data)
#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;
diff --git a/apps/gui/skin_engine/skin_tokens.c b/apps/gui/skin_engine/skin_tokens.c
index aeb7bdb..5156dd7 100644
--- a/apps/gui/skin_engine/skin_tokens.c
+++ b/apps/gui/skin_engine/skin_tokens.c
@@ -818,8 +818,8 @@ const char *get_token_value(struct gui_wps *gwps,
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;
diff --git a/apps/gui/skin_engine/wps_internals.h b/apps/gui/skin_engine/wps_internals.h
index 1fd6864..d54b54f 100644
--- a/apps/gui/skin_engine/wps_internals.h
+++ b/apps/gui/skin_engine/wps_internals.h
@@ -264,8 +264,6 @@ struct wps_data
/* 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;
diff --git a/apps/gui/wps.c b/apps/gui/wps.c
index e449644..441ac3f 100644
--- a/apps/gui/wps.c
+++ b/apps/gui/wps.c
@@ -1130,8 +1130,6 @@ long gui_wps_show(void)
if (vol_changed)
{
- FOR_NB_SCREENS(i)
- gui_wps[i].data->button_time_volume = current_tick;
bool res = false;
setvol();
FOR_NB_SCREENS(i)
diff --git a/apps/main.c b/apps/main.c
index 4c7d48e..677eeb5 100644
--- a/apps/main.c
+++ b/apps/main.c
@@ -158,6 +158,7 @@ static void app_main(void)
}
#endif /* #ifdef AUTOROCK */
+ global_status.last_volume_change = 0;
root_menu();
}
diff --git a/apps/misc.c b/apps/misc.c
index 6be9f8f..f1c38f3 100644
--- a/apps/misc.c
+++ b/apps/misc.c
@@ -739,6 +739,7 @@ void setvol(void)
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();
}
diff --git a/apps/settings.h b/apps/settings.h
index 07f6f22..6de8208 100644
--- a/apps/settings.h
+++ b/apps/settings.h
@@ -308,6 +308,7 @@ struct system_status
#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