diff options
Diffstat (limited to 'macosx/HBAudio.m')
-rw-r--r-- | macosx/HBAudio.m | 29 |
1 files changed, 7 insertions, 22 deletions
diff --git a/macosx/HBAudio.m b/macosx/HBAudio.m index 4de313324..bdafebf0d 100644 --- a/macosx/HBAudio.m +++ b/macosx/HBAudio.m @@ -448,36 +448,21 @@ static NSMutableArray *masterBitRateArray = nil; #pragma mark - #pragma mark Validation -// Because we have indicated that the binding for the drc validates immediately we can implement the -// key value binding method to ensure the drc stays in our accepted range. -- (BOOL) validateDrc: (id *) ioValue error: (NSError *) outError - +// Because we have indicated that the binding for the gain validates immediately we can implement the +// key value binding method to ensure the gain stays in our accepted range. +- (BOOL)validateGain:(id *)ioValue error:(NSError *)outError { BOOL retval = YES; if (nil != *ioValue) { - if (0.0 < [*ioValue floatValue] && 1.0 > [*ioValue floatValue]) + if ([*ioValue intValue] < -20) { - *ioValue = @1.0f; + *ioValue = @(-20); } - } - - return retval; -} - -// Because we have indicated that the binding for the gain validates immediately we can implement the -// key value binding method to ensure the gain stays in our accepted range. - -- (BOOL) validateGain: (id *) ioValue error: (NSError *) outError -{ - BOOL retval = YES; - - if (nil != *ioValue) - { - if (0.0 < [*ioValue floatValue] && 1.0 > [*ioValue floatValue]) + else if ([*ioValue intValue] > 20) { - *ioValue = @0.0f; + *ioValue = @20; } } |