diff options
| author | Nils Wallménius <nils@rockbox.org> | 2007-05-30 17:57:32 +0000 |
|---|---|---|
| committer | Nils Wallménius <nils@rockbox.org> | 2007-05-30 17:57:32 +0000 |
| commit | f46657ec5a23e9ff440b603fbf8ffd55e6aa4e84 (patch) | |
| tree | d6bb995283343f4a8e9830827c475e16f3bdc646 /apps/gui | |
| parent | dfb071d92ece27951dd2b3e17629ec61cd619460 (diff) | |
| download | rockbox-f46657ec5a23e9ff440b603fbf8ffd55e6aa4e84.zip rockbox-f46657ec5a23e9ff440b603fbf8ffd55e6aa4e84.tar.gz rockbox-f46657ec5a23e9ff440b603fbf8ffd55e6aa4e84.tar.bz2 rockbox-f46657ec5a23e9ff440b603fbf8ffd55e6aa4e84.tar.xz | |
Move the setvol wrapper function to misc.c and use it in more places instead of doing the same checks everywhere
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@13524 a1c6a512-1295-4272-9138-f99709370657
Diffstat (limited to 'apps/gui')
| -rw-r--r-- | apps/gui/gwps-common.c | 10 | ||||
| -rw-r--r-- | apps/gui/gwps-common.h | 1 | ||||
| -rw-r--r-- | apps/gui/list.c | 8 |
3 files changed, 1 insertions, 18 deletions
diff --git a/apps/gui/gwps-common.c b/apps/gui/gwps-common.c index 2cdb92d..2e8f784 100644 --- a/apps/gui/gwps-common.c +++ b/apps/gui/gwps-common.c @@ -126,16 +126,6 @@ void fade(bool fade_in) } } -/* set volume */ -void setvol(void) -{ - if (global_settings.volume < sound_min(SOUND_VOLUME)) - global_settings.volume = sound_min(SOUND_VOLUME); - if (global_settings.volume > sound_max(SOUND_VOLUME)) - global_settings.volume = sound_max(SOUND_VOLUME); - sound_set_volume(global_settings.volume); - settings_save(); -} /* return true if screen restore is needed return false otherwise */ diff --git a/apps/gui/gwps-common.h b/apps/gui/gwps-common.h index 1203113..76555c1 100644 --- a/apps/gui/gwps-common.h +++ b/apps/gui/gwps-common.h @@ -25,7 +25,6 @@ void fade(bool fade_in); bool gui_wps_display(void); -void setvol(void); bool update_onvol_change(struct gui_wps * gwps); bool update(struct gui_wps *gwps); bool ffwd_rew(int button); diff --git a/apps/gui/list.c b/apps/gui/list.c index 4a72c3e..f4cb607 100644 --- a/apps/gui/list.c +++ b/apps/gui/list.c @@ -876,13 +876,7 @@ unsigned gui_synclist_do_button(struct gui_synclist * lists, /* up two because the falthrough brings it down one */ case ACTION_LIST_VOLDOWN: global_settings.volume--; - - if (global_settings.volume < sound_min(SOUND_VOLUME)) - global_settings.volume = sound_min(SOUND_VOLUME); - if (global_settings.volume > sound_max(SOUND_VOLUME)) - global_settings.volume = sound_max(SOUND_VOLUME); - sound_set_volume(global_settings.volume); - settings_save(); + setvol(); return button; #endif case ACTION_STD_PREV: |