diff options
Diffstat (limited to '')
-rw-r--r-- | src/volume.c | 15 |
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); |