summaryrefslogtreecommitdiff
path: root/apps/gui/wps.c
diff options
context:
space:
mode:
authorMichael Hohmuth <sideral@rockbox.org>2011-05-09 12:59:46 +0000
committerMichael Hohmuth <sideral@rockbox.org>2011-05-09 12:59:46 +0000
commit84301c1e2de731099222dee991af8ef957cfecc5 (patch)
tree22950555d0d400e6a7d377495ae7ca55eb751ed9 /apps/gui/wps.c
parent9b7027232f2cab49e4854d56651388cf6c1461f0 (diff)
downloadrockbox-84301c1e2de731099222dee991af8ef957cfecc5.zip
rockbox-84301c1e2de731099222dee991af8ef957cfecc5.tar.gz
rockbox-84301c1e2de731099222dee991af8ef957cfecc5.tar.bz2
rockbox-84301c1e2de731099222dee991af8ef957cfecc5.tar.xz
FS#11931 part 1: Make fade in/out behavior more consistent across the
various causes of pause and unpause. Patch by John Morris. git-svn-id: svn://svn.rockbox.org/rockbox/trunk@29844 a1c6a512-1295-4272-9138-f99709370657
Diffstat (limited to 'apps/gui/wps.c')
-rw-r--r--apps/gui/wps.c27
1 files changed, 19 insertions, 8 deletions
diff --git a/apps/gui/wps.c b/apps/gui/wps.c
index 069df09..cf6ec2d 100644
--- a/apps/gui/wps.c
+++ b/apps/gui/wps.c
@@ -119,6 +119,23 @@ char* wps_default_skin(enum screen_type screen)
return skin_buf[screen];
}
+void pause_action(bool may_fade, bool updatewps)
+{
+ int32_t newpos;
+ if (may_fade && global_settings.fade_on_stop)
+ fade(false, updatewps);
+ else
+ audio_pause();
+}
+
+void unpause_action(bool may_fade, bool updatewps)
+{
+ if (may_fade && global_settings.fade_on_stop)
+ fade(true, updatewps);
+ else
+ audio_resume();
+}
+
void fade(bool fade_in, bool updatewps)
{
int fp_global_vol = global_settings.volume << 8;
@@ -667,18 +684,12 @@ void wps_do_playpause(bool updatewps)
if ( state->paused )
{
state->paused = false;
- if ( global_settings.fade_on_stop )
- fade(true, updatewps);
- else
- audio_resume();
+ unpause_action(true, updatewps);
}
else
{
state->paused = true;
- if ( global_settings.fade_on_stop )
- fade(false, updatewps);
- else
- audio_pause();
+ pause_action(true, updatewps);
settings_save();
#if !defined(HAVE_RTC_RAM) && !defined(HAVE_SW_POWEROFF)
call_storage_idle_notifys(true); /* make sure resume info is saved */