aboutsummaryrefslogtreecommitdiffstats
path: root/src/volume.c
diff options
context:
space:
mode:
authorWarren Dukes <warren.dukes@gmail.com>2004-04-11 11:48:04 +0000
committerWarren Dukes <warren.dukes@gmail.com>2004-04-11 11:48:04 +0000
commit44756f5f10717c77b14cd7e3bdade349f0969be7 (patch)
tree2b55d790d8fc934d2b2a6951bbabe744da1537d9 /src/volume.c
parent823a7900bd5c6a14857928102fbad8ec83f97568 (diff)
downloadmpd-44756f5f10717c77b14cd7e3bdade349f0969be7.tar.gz
mpd-44756f5f10717c77b14cd7e3bdade349f0969be7.tar.xz
mpd-44756f5f10717c77b14cd7e3bdade349f0969be7.zip
adjust scaling of software volume
git-svn-id: https://svn.musicpd.org/mpd/trunk@681 09075e82-0dd4-0310-85a5-a0d7c8717e4f
Diffstat (limited to 'src/volume.c')
-rw-r--r--src/volume.c15
1 files changed, 7 insertions, 8 deletions
diff --git a/src/volume.c b/src/volume.c
index b55cd1e17..db27c0a13 100644
--- a/src/volume.c
+++ b/src/volume.c
@@ -48,7 +48,7 @@
int volume_mixerType = VOLUME_MIXER_TYPE_SOFTWARE;
char * volume_mixerDevice;
-int volume_softwareSet = -1;
+int volume_softwareSet = 100;
#ifndef NO_OSS_MIXER
int volume_ossFd;
@@ -373,11 +373,7 @@ void openVolumeDevice() {
}
int getSoftwareVolume() {
- if(volume_softwareSet >= 0) {
- return volume_softwareSet;
- }
-
- return 50*log((getPlayerSoftwareVolume()*(M_E*M_E-1)/100.0)+1)+0.5;
+ return volume_softwareSet;
}
int getVolumeLevel() {
@@ -400,14 +396,17 @@ int getVolumeLevel() {
int changeSoftwareVolume(FILE * fp, int change, int rel) {
int new = change;
- if(rel) new+=getSoftwareVolume();
+ if(rel) new+=getSoftwareVolume()/10.0+0.5;
if(new>100) new = 100;
else if(new<0) new = 0;
volume_softwareSet = new;
- new = 100.0*(exp(new/50.0)-1)/(M_E*M_E-1)+0.5;
+ /*new = 100.0*(exp(new/50.0)-1)/(M_E*M_E-1)+0.5;*/
+ if(new>=100) new = 1000;
+ else if(new<=0) new = 0;
+ else new = 1000.0*(exp(new/20.0)-1)/(148.413159103F-1)+0.5;
setPlayerSoftwareVolume(new);