diff options
-rw-r--r-- | apps/gui/gwps-common.c | 12 | ||||
-rw-r--r-- | apps/gui/gwps-common.h | 2 | ||||
-rw-r--r-- | apps/gui/gwps.c | 6 | ||||
-rw-r--r-- | apps/misc.c | 6 |
4 files changed, 14 insertions, 12 deletions
diff --git a/apps/gui/gwps-common.c b/apps/gui/gwps-common.c index b90c216f58..f5ef604498 100644 --- a/apps/gui/gwps-common.c +++ b/apps/gui/gwps-common.c | |||
@@ -83,7 +83,7 @@ static void gui_wps_statusbar_draw(struct gui_wps *wps, bool force) | |||
83 | 83 | ||
84 | /* fades the volume */ | 84 | /* fades the volume */ |
85 | bool wps_fading_out = false; | 85 | bool wps_fading_out = false; |
86 | void fade(bool fade_in) | 86 | void fade(bool fade_in, bool updatewps) |
87 | { | 87 | { |
88 | int fp_global_vol = global_settings.volume << 8; | 88 | int fp_global_vol = global_settings.volume << 8; |
89 | int fp_min_vol = sound_min(SOUND_VOLUME) << 8; | 89 | int fp_min_vol = sound_min(SOUND_VOLUME) << 8; |
@@ -103,8 +103,9 @@ void fade(bool fade_in) | |||
103 | while (fp_volume < fp_global_vol - fp_step) { | 103 | while (fp_volume < fp_global_vol - fp_step) { |
104 | fp_volume += fp_step; | 104 | fp_volume += fp_step; |
105 | sound_set_volume(fp_volume >> 8); | 105 | sound_set_volume(fp_volume >> 8); |
106 | FOR_NB_SCREENS(i) | 106 | if (updatewps) |
107 | gui_wps_refresh(&gui_wps[i], 0, WPS_REFRESH_NON_STATIC); | 107 | FOR_NB_SCREENS(i) |
108 | gui_wps_refresh(&gui_wps[i], 0, WPS_REFRESH_NON_STATIC); | ||
108 | sleep(1); | 109 | sleep(1); |
109 | } | 110 | } |
110 | sound_set_volume(global_settings.volume); | 111 | sound_set_volume(global_settings.volume); |
@@ -116,8 +117,9 @@ void fade(bool fade_in) | |||
116 | while (fp_volume > fp_min_vol + fp_step) { | 117 | while (fp_volume > fp_min_vol + fp_step) { |
117 | fp_volume -= fp_step; | 118 | fp_volume -= fp_step; |
118 | sound_set_volume(fp_volume >> 8); | 119 | sound_set_volume(fp_volume >> 8); |
119 | FOR_NB_SCREENS(i) | 120 | if (updatewps) |
120 | gui_wps_refresh(&gui_wps[i], 0, WPS_REFRESH_NON_STATIC); | 121 | FOR_NB_SCREENS(i) |
122 | gui_wps_refresh(&gui_wps[i], 0, WPS_REFRESH_NON_STATIC); | ||
121 | sleep(1); | 123 | sleep(1); |
122 | } | 124 | } |
123 | audio_pause(); | 125 | audio_pause(); |
diff --git a/apps/gui/gwps-common.h b/apps/gui/gwps-common.h index 3119755502..ccdc31b5a9 100644 --- a/apps/gui/gwps-common.h +++ b/apps/gui/gwps-common.h | |||
@@ -23,7 +23,7 @@ | |||
23 | 23 | ||
24 | #include "gwps.h" | 24 | #include "gwps.h" |
25 | 25 | ||
26 | void fade(bool fade_in); | 26 | void fade(bool fade_in, bool updatewps); |
27 | bool gui_wps_display(void); | 27 | bool gui_wps_display(void); |
28 | bool update_onvol_change(struct gui_wps * gwps); | 28 | bool update_onvol_change(struct gui_wps * gwps); |
29 | bool update(struct gui_wps *gwps); | 29 | bool update(struct gui_wps *gwps); |
diff --git a/apps/gui/gwps.c b/apps/gui/gwps.c index 26d31c65bd..5426c937c0 100644 --- a/apps/gui/gwps.c +++ b/apps/gui/gwps.c | |||
@@ -326,7 +326,7 @@ long gui_wps_show(void) | |||
326 | { | 326 | { |
327 | wps_state.paused = false; | 327 | wps_state.paused = false; |
328 | if ( global_settings.fade_on_stop ) | 328 | if ( global_settings.fade_on_stop ) |
329 | fade(1); | 329 | fade(true, true); |
330 | else | 330 | else |
331 | audio_resume(); | 331 | audio_resume(); |
332 | } | 332 | } |
@@ -334,7 +334,7 @@ long gui_wps_show(void) | |||
334 | { | 334 | { |
335 | wps_state.paused = true; | 335 | wps_state.paused = true; |
336 | if ( global_settings.fade_on_stop ) | 336 | if ( global_settings.fade_on_stop ) |
337 | fade(0); | 337 | fade(false, true); |
338 | else | 338 | else |
339 | audio_pause(); | 339 | audio_pause(); |
340 | settings_save(); | 340 | settings_save(); |
@@ -712,7 +712,7 @@ long gui_wps_show(void) | |||
712 | status_set_audio(false); | 712 | status_set_audio(false); |
713 | #endif | 713 | #endif |
714 | if (global_settings.fade_on_stop) | 714 | if (global_settings.fade_on_stop) |
715 | fade(0); | 715 | fade(false, true); |
716 | 716 | ||
717 | FOR_NB_SCREENS(i) | 717 | FOR_NB_SCREENS(i) |
718 | gui_wps[i].display->stop_scroll(); | 718 | gui_wps[i].display->stop_scroll(); |
diff --git a/apps/misc.c b/apps/misc.c index 9df6637656..167f7efbd9 100644 --- a/apps/misc.c +++ b/apps/misc.c | |||
@@ -697,7 +697,7 @@ static bool clean_shutdown(void (*callback)(void *), void *parameter) | |||
697 | if (global_settings.fade_on_stop | 697 | if (global_settings.fade_on_stop |
698 | && (audio_stat & AUDIO_STATUS_PLAY)) | 698 | && (audio_stat & AUDIO_STATUS_PLAY)) |
699 | { | 699 | { |
700 | fade(0); | 700 | fade(false, false); |
701 | } | 701 | } |
702 | 702 | ||
703 | if (batt_safe) /* do not save on critical battery */ | 703 | if (batt_safe) /* do not save on critical battery */ |
@@ -774,7 +774,7 @@ bool list_stop_handler(void) | |||
774 | if (!global_settings.party_mode) | 774 | if (!global_settings.party_mode) |
775 | { | 775 | { |
776 | if (global_settings.fade_on_stop) | 776 | if (global_settings.fade_on_stop) |
777 | fade(0); | 777 | fade(false, false); |
778 | bookmark_autobookmark(); | 778 | bookmark_autobookmark(); |
779 | audio_stop(); | 779 | audio_stop(); |
780 | ret = true; /* bookmarking can make a refresh necessary */ | 780 | ret = true; /* bookmarking can make a refresh necessary */ |
@@ -840,7 +840,7 @@ static void car_adapter_mode_processing(bool inserted) | |||
840 | !(audio_status() & AUDIO_STATUS_PAUSE)) | 840 | !(audio_status() & AUDIO_STATUS_PAUSE)) |
841 | { | 841 | { |
842 | if (global_settings.fade_on_stop) | 842 | if (global_settings.fade_on_stop) |
843 | fade(0); | 843 | fade(false, false); |
844 | else | 844 | else |
845 | audio_pause(); | 845 | audio_pause(); |
846 | } | 846 | } |