Merge pull request #220 from losnoco/nevack/linear-scale-for-volume-slider

Scale VolumeSlider linearly if volume is limited.
CQTexperiment
Christopher Snowhill 2022-01-29 15:40:34 -08:00 committed by GitHub
commit c5f9ffe87c
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
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];