diff options
Diffstat (limited to 'apps/gui/wps.c')
-rw-r--r-- | apps/gui/wps.c | 27 |
1 files changed, 19 insertions, 8 deletions
diff --git a/apps/gui/wps.c b/apps/gui/wps.c index 069df09c36..cf6ec2deb4 100644 --- a/apps/gui/wps.c +++ b/apps/gui/wps.c | |||
@@ -119,6 +119,23 @@ char* wps_default_skin(enum screen_type screen) | |||
119 | return skin_buf[screen]; | 119 | return skin_buf[screen]; |
120 | } | 120 | } |
121 | 121 | ||
122 | void pause_action(bool may_fade, bool updatewps) | ||
123 | { | ||
124 | int32_t newpos; | ||
125 | if (may_fade && global_settings.fade_on_stop) | ||
126 | fade(false, updatewps); | ||
127 | else | ||
128 | audio_pause(); | ||
129 | } | ||
130 | |||
131 | void unpause_action(bool may_fade, bool updatewps) | ||
132 | { | ||
133 | if (may_fade && global_settings.fade_on_stop) | ||
134 | fade(true, updatewps); | ||
135 | else | ||
136 | audio_resume(); | ||
137 | } | ||
138 | |||
122 | void fade(bool fade_in, bool updatewps) | 139 | void fade(bool fade_in, bool updatewps) |
123 | { | 140 | { |
124 | int fp_global_vol = global_settings.volume << 8; | 141 | int fp_global_vol = global_settings.volume << 8; |
@@ -667,18 +684,12 @@ void wps_do_playpause(bool updatewps) | |||
667 | if ( state->paused ) | 684 | if ( state->paused ) |
668 | { | 685 | { |
669 | state->paused = false; | 686 | state->paused = false; |
670 | if ( global_settings.fade_on_stop ) | 687 | unpause_action(true, updatewps); |
671 | fade(true, updatewps); | ||
672 | else | ||
673 | audio_resume(); | ||
674 | } | 688 | } |
675 | else | 689 | else |
676 | { | 690 | { |
677 | state->paused = true; | 691 | state->paused = true; |
678 | if ( global_settings.fade_on_stop ) | 692 | pause_action(true, updatewps); |
679 | fade(false, updatewps); | ||
680 | else | ||
681 | audio_pause(); | ||
682 | settings_save(); | 693 | settings_save(); |
683 | #if !defined(HAVE_RTC_RAM) && !defined(HAVE_SW_POWEROFF) | 694 | #if !defined(HAVE_RTC_RAM) && !defined(HAVE_SW_POWEROFF) |
684 | call_storage_idle_notifys(true); /* make sure resume info is saved */ | 695 | call_storage_idle_notifys(true); /* make sure resume info is saved */ |