diff -ruN vdr-1/config.c vdr-2/config.c --- vdr-1/config.c 2012-09-10 22:20:39.000000000 +0200 +++ vdr-2/config.c 2012-09-10 22:21:28.000000000 +0200 @@ -488,6 +488,8 @@ #endif /* JUMPPLAY */ CurrentChannel = -1; CurrentVolume = MAXVOLUME; + VolumeSteps = 51; + VolumeLinearize = 0; CurrentDolby = 0; InitialChannel = ""; DeviceBondings = ""; @@ -747,6 +749,8 @@ else if (!strcasecmp(Name, "CurrentDolby")) CurrentDolby = atoi(Value); else if (!strcasecmp(Name, "InitialChannel")) InitialChannel = Value; else if (!strcasecmp(Name, "InitialVolume")) InitialVolume = atoi(Value); + else if (!strcasecmp(Name, "VolumeSteps")) VolumeSteps = atoi(Value); + else if (!strcasecmp(Name, "VolumeLinearize")) VolumeLinearize = atoi(Value); #ifdef USE_LIVEBUFFER else if (!strcasecmp(Name, "LiveBufferSize")) LiveBufferSize = atoi(Value); else if (!strcasecmp(Name, "LiveBufferMaxFileSize")) LiveBufferMaxFileSize = atoi(Value); @@ -924,6 +928,8 @@ #endif /* HARDLINKCUTTER */ Store("InitialChannel", InitialChannel); Store("InitialVolume", InitialVolume); + Store("VolumeSteps", VolumeSteps); + Store("VolumeLinearize", VolumeLinearize); #ifdef USE_VOLCTRL Store("LRVolumeControl", LRVolumeControl); Store("LRChannelGroups", LRChannelGroups); diff -ruN vdr-1/config.h vdr-2/config.h --- vdr-1/config.h 2012-09-10 22:20:39.000000000 +0200 +++ vdr-2/config.h 2012-09-10 22:21:28.000000000 +0200 @@ -374,6 +374,8 @@ int PauseLastMark; #endif /* JUMPPLAY */ int CurrentVolume; + int VolumeSteps; + int VolumeLinearize; int CurrentDolby; int InitialVolume; #ifdef USE_VOLCTRL diff -ruN vdr-1/device.c vdr-2/device.c --- vdr-1/device.c 2012-09-10 22:20:39.000000000 +0200 +++ vdr-2/device.c 2012-09-10 22:21:28.000000000 +0200 @@ -11,6 +11,7 @@ #include #include #include +#include #include "audio.h" #include "channels.h" #include "i18n.h" @@ -943,8 +944,9 @@ void cDevice::SetVolume(int Volume, bool Absolute) { int OldVolume = volume; - volume = constrain(Absolute ? Volume : volume + Volume, 0, MAXVOLUME); - SetVolumeDevice(volume); + float VolumeDelta = (float)MAXVOLUME/Setup.VolumeSteps; + volume = min(max((int)(floor((Absolute ? Volume : volume + Volume)/VolumeDelta+0.5)*VolumeDelta), 0), MAXVOLUME); + SetVolumeDevice((int)(pow((float)volume/MAXVOLUME, log((Setup.VolumeLinearize+20)/40.0)/log(0.5))*MAXVOLUME)); Absolute |= mute; cStatus::MsgSetVolume(Absolute ? volume : volume - OldVolume, Absolute); if (volume > 0) { diff -ruN vdr-1/device.h vdr-2/device.h --- vdr-1/device.h 2012-09-10 22:20:39.000000000 +0200 +++ vdr-2/device.h 2012-09-10 22:21:28.000000000 +0200 @@ -33,7 +33,7 @@ #define MAXPIDHANDLES 64 // the maximum number of different PIDs per device #define MAXRECEIVERS 16 // the maximum number of receivers per device #define MAXVOLUME 255 -#define VOLUMEDELTA 5 // used to increase/decrease the volume +#define VOLUMEDELTA (MAXVOLUME/Setup.VolumeSteps) // used to increase/decrease the volume #define MAXOCCUPIEDTIMEOUT 99 // max. time (in seconds) a device may be occupied #ifdef USE_LIVEBUFFER diff -ruN vdr-1/menu.c vdr-2/menu.c --- vdr-1/menu.c 2012-09-10 22:20:39.000000000 +0200 +++ vdr-2/menu.c 2012-09-10 22:21:28.000000000 +0200 @@ -3811,6 +3811,8 @@ Add(new cMenuEditIntItem( tr("Setup.Miscellaneous$Channel entry timeout (ms)"), &data.ChannelEntryTimeout, 0)); Add(new cMenuEditChanItem(tr("Setup.Miscellaneous$Initial channel"), &data.InitialChannel, tr("Setup.Miscellaneous$as before"))); Add(new cMenuEditIntItem( tr("Setup.Miscellaneous$Initial volume"), &data.InitialVolume, -1, 255, tr("Setup.Miscellaneous$as before"))); + Add(new cMenuEditIntItem( tr("Setup.Miscellaneous$Volume steps"), &data.VolumeSteps, 5, 255)); + Add(new cMenuEditIntItem( tr("Setup.Miscellaneous$Volume linearize"), &data.VolumeLinearize, -20, 20)); #ifdef USE_VOLCTRL Add(new cMenuEditBoolItem(tr("Setup.Miscellaneous$Volume ctrl with left/right"), &data.LRVolumeControl)); if (data.LRVolumeControl) { diff -ruN vdr-1/po/de_DE.po vdr-2/po/de_DE.po --- vdr-1/po/de_DE.po 2012-09-10 22:20:39.000000000 +0200 +++ vdr-2/po/de_DE.po 2012-09-10 22:21:28.000000000 +0200 @@ -1226,6 +1226,12 @@ msgid "Setup.Miscellaneous$SVDRP timeout (s)" msgstr "SVDRP trennen bei Inaktivität (s)" +msgid "Setup.Miscellaneous$Volume steps" +msgstr "Anzahl Lautstärke Schritte" + +msgid "Setup.Miscellaneous$Volume linearize" +msgstr "Lautstärke Kurve korrigieren" + msgid "Setup.Miscellaneous$Zap timeout (s)" msgstr "Mindestzeit für Kanalhistorie (s)"