Made volume control more linear

This commit is contained in:
Klaus Schmidinger 2004-10-16 14:39:45 +02:00
parent 7ba6dae69f
commit fe86d58ed8
3 changed files with 8 additions and 2 deletions

View File

@ -630,6 +630,7 @@ Emil Naepflein <Emil.Naepflein@philosys.de>
for fixing selecting the device, because sometimes an FTA recording terminated a for fixing selecting the device, because sometimes an FTA recording terminated a
CA recording CA recording
for suggesting to never delete edited recordings automatically if the disk runs full for suggesting to never delete edited recordings automatically if the disk runs full
for making volume control more linear
Gerald Berwolf <genka@genka.de> Gerald Berwolf <genka@genka.de>
for suggesting to deactivate some templates in tools.h in case some plugin needs to for suggesting to deactivate some templates in tools.h in case some plugin needs to

View File

@ -3022,3 +3022,4 @@ Video Disk Recorder Revision History
- Avoiding unnecessary section filter start/stops (thanks to Marco Schlüßler). - Avoiding unnecessary section filter start/stops (thanks to Marco Schlüßler).
- Made the "Channel not available!" message and mtInfo instead of mtError (suggested - Made the "Channel not available!" message and mtInfo instead of mtError (suggested
by Wayne Keer). by Wayne Keer).
- Made volume control more linear (thanks to Emil Naepflein).

View File

@ -4,7 +4,7 @@
* See the main source file 'vdr.c' for copyright information and * See the main source file 'vdr.c' for copyright information and
* how to reach the author. * how to reach the author.
* *
* $Id: dvbdevice.c 1.95 2004/10/16 12:51:56 kls Exp $ * $Id: dvbdevice.c 1.96 2004/10/16 14:38:24 kls Exp $
*/ */
#include "dvbdevice.h" #include "dvbdevice.h"
@ -785,7 +785,11 @@ void cDvbDevice::SetVolumeDevice(int Volume)
{ {
if (HasDecoder()) { if (HasDecoder()) {
audio_mixer_t am; audio_mixer_t am;
am.volume_left = am.volume_right = Volume; // conversion for linear volume response:
int i, Vol;
for (i = 1, Vol = 0; i < Volume; i++)
Vol += (256 - i) * (256 - i);
am.volume_left = am.volume_right = Vol / 21718;
CHECK(ioctl(fd_audio, AUDIO_SET_MIXER, &am)); CHECK(ioctl(fd_audio, AUDIO_SET_MIXER, &am));
} }
} }