diff options
author | ritsuka <[email protected]> | 2014-08-10 15:15:10 +0000 |
---|---|---|
committer | ritsuka <[email protected]> | 2014-08-10 15:15:10 +0000 |
commit | c50899dd7361801c04463fe1630392500608ebab (patch) | |
tree | 557dc901bd1f50294ff7953cf5726216c918dbe9 /macosx/HBAudio.m | |
parent | c7c2aa9ee6c73dcb6b693471945aeadb6ed09983 (diff) |
MacGui: fixed gain validation in the audio panel. Remove the drc validation because it’s not possible to insert the value manually.
git-svn-id: svn://svn.handbrake.fr/HandBrake/trunk@6284 b64f7644-9d1e-0410-96f1-a4d463321fa5
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; } } |