Scale VolumeSlider linearly if volume is limited.

Fixes #198
CQTexperiment
Dzmitry Neviadomski 2022-01-29 05:57:19 +03:00
parent 7be0ade7ce
commit 050a3d3112
1 changed files with 7 additions and 1 deletions

View File

@ -59,7 +59,13 @@
- (void)updateToolTip
{
double value = [self doubleValue];
double volume = linearToLogarithmic(value, MAX_VOLUME);
BOOL volumeLimit = [[[NSUserDefaultsController sharedUserDefaultsController] defaults] boolForKey:@"volumeLimit"];
double volume;
if (volumeLimit) {
volume = (value - self.minValue) * (MAX_VOLUME / (self.maxValue - self.minValue));
} else {
volume = linearToLogarithmic(value, MAX_VOLUME);
}
NSString *text = [NSString stringWithFormat:@"%0.lf%%", volume];