From c80e0c19e1b192a384dd8670424bc7dea2831553 Mon Sep 17 00:00:00 2001 From: Jens Arnold Date: Sat, 17 Dec 2005 21:13:30 +0000 Subject: Fixed several plugins for dB volume. git-svn-id: svn://svn.rockbox.org/rockbox/trunk@8258 a1c6a512-1295-4272-9138-f99709370657 --- apps/plugins/video.c | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) (limited to 'apps/plugins/video.c') diff --git a/apps/plugins/video.c b/apps/plugins/video.c index 1a288ee..91d47a5 100644 --- a/apps/plugins/video.c +++ b/apps/plugins/video.c @@ -272,15 +272,17 @@ void DrawPosition(int pos, int total) // helper function to change the volume by a certain amount, +/- void ChangeVolume(int delta) { + int minvol = rb->sound_min(SOUND_VOLUME); + int maxvol = rb->sound_max(SOUND_VOLUME); int vol = rb->global_settings->volume + delta; - if (vol > 100) vol = 100; - else if (vol < 0) vol = 0; + if (vol > maxvol) vol = maxvol; + else if (vol < minvol) vol = minvol; if (vol != rb->global_settings->volume) { rb->sound_set(SOUND_VOLUME, vol); rb->global_settings->volume = vol; - rb->snprintf(gPrint, sizeof(gPrint), "Vol: %d", vol); + rb->snprintf(gPrint, sizeof(gPrint), "Vol: %d dB", vol); rb->lcd_puts(0, 7, gPrint); if (gPlay.state == paused) // we have to draw ourselves rb->lcd_update_rect(0, LCD_HEIGHT-8, LCD_WIDTH, 8); -- cgit v1.1