diff options
| author | Jens Arnold <amiconn@rockbox.org> | 2005-12-17 21:13:30 +0000 |
|---|---|---|
| committer | Jens Arnold <amiconn@rockbox.org> | 2005-12-17 21:13:30 +0000 |
| commit | c80e0c19e1b192a384dd8670424bc7dea2831553 (patch) | |
| tree | 20a8106a06c9c926a1125774ba30ec7c2452d80f /apps/plugins/video.c | |
| parent | 5cc73474633f0f33e0b9f6a55cd8831df9bec906 (diff) | |
| download | rockbox-c80e0c19e1b192a384dd8670424bc7dea2831553.zip rockbox-c80e0c19e1b192a384dd8670424bc7dea2831553.tar.gz rockbox-c80e0c19e1b192a384dd8670424bc7dea2831553.tar.bz2 rockbox-c80e0c19e1b192a384dd8670424bc7dea2831553.tar.xz | |
Fixed several plugins for dB volume.
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@8258 a1c6a512-1295-4272-9138-f99709370657
Diffstat (limited to 'apps/plugins/video.c')
| -rw-r--r-- | apps/plugins/video.c | 8 |
1 files changed, 5 insertions, 3 deletions
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); |