diff options
author | Damiano Galassi <[email protected]> | 2015-10-28 08:11:53 +0100 |
---|---|---|
committer | Damiano Galassi <[email protected]> | 2015-10-28 08:11:53 +0100 |
commit | 445938b7d30f2c7c695e8250c1e44d765c63531c (patch) | |
tree | 09de32d661901bfd29ac55b2f48517fe92bfdbeb /macosx/HBAudioTrackPreset.m | |
parent | 79df3e5408dbe6908767ee8525bba4c2b13e6a77 (diff) |
MacGui: switched the audio defaults track tableview to view based, and fixed a number of typo.
Diffstat (limited to 'macosx/HBAudioTrackPreset.m')
-rw-r--r-- | macosx/HBAudioTrackPreset.m | 40 |
1 files changed, 24 insertions, 16 deletions
diff --git a/macosx/HBAudioTrackPreset.m b/macosx/HBAudioTrackPreset.m index 56c6f65e0..1cd900969 100644 --- a/macosx/HBAudioTrackPreset.m +++ b/macosx/HBAudioTrackPreset.m @@ -227,9 +227,9 @@ static void *HBAudioEncoderContex = &HBAudioEncoderContex; #pragma mark - Options -- (NSArray *)encoders +- (NSArray<NSString *> *)encoders { - NSMutableArray *encoders = [[NSMutableArray alloc] init]; + NSMutableArray<NSString *> *encoders = [[NSMutableArray alloc] init]; for (const hb_encoder_t *audio_encoder = hb_audio_encoder_get_next(NULL); audio_encoder != NULL; audio_encoder = hb_audio_encoder_get_next(audio_encoder)) @@ -239,9 +239,9 @@ static void *HBAudioEncoderContex = &HBAudioEncoderContex; return encoders; } -- (NSArray *)mixdowns +- (NSArray<NSString *> *)mixdowns { - NSMutableArray *mixdowns = [[NSMutableArray alloc] init]; + NSMutableArray<NSString *> *mixdowns = [[NSMutableArray alloc] init]; for (const hb_mixdown_t *mixdown = hb_mixdown_get_next(NULL); mixdown != NULL; mixdown = hb_mixdown_get_next(mixdown)) @@ -254,9 +254,9 @@ static void *HBAudioEncoderContex = &HBAudioEncoderContex; return mixdowns; } -- (NSArray *)samplerates +- (NSArray<NSString *> *)sampleRates { - NSMutableArray *samplerates = [[NSMutableArray alloc] init]; + NSMutableArray<NSString *> *sampleRates = [[NSMutableArray alloc] init]; for (const hb_rate_t *audio_samplerate = hb_audio_samplerate_get_next(NULL); audio_samplerate != NULL; audio_samplerate = hb_audio_samplerate_get_next(audio_samplerate)) @@ -264,30 +264,30 @@ static void *HBAudioEncoderContex = &HBAudioEncoderContex; int rate = audio_samplerate->rate; if (rate == hb_audio_samplerate_get_best(self.encoder, rate, NULL)) { - [samplerates addObject:@(audio_samplerate->name)]; + [sampleRates addObject:@(audio_samplerate->name)]; } } - return samplerates; + return sampleRates; } -- (NSArray *)bitrates +- (NSArray<NSString *> *)bitRates { int minBitRate = 0; int maxBitRate = 0; hb_audio_bitrate_get_limits(self.encoder, self.sampleRate, self.mixdown, &minBitRate, &maxBitRate); - NSMutableArray *bitrates = [[NSMutableArray alloc] init]; + NSMutableArray<NSString *> *bitRates = [[NSMutableArray alloc] init]; for (const hb_rate_t *audio_bitrate = hb_audio_bitrate_get_next(NULL); audio_bitrate != NULL; audio_bitrate = hb_audio_bitrate_get_next(audio_bitrate)) { if (audio_bitrate->rate >= minBitRate && audio_bitrate->rate <= maxBitRate) { - [bitrates addObject:@(audio_bitrate->name)]; + [bitRates addObject:@(audio_bitrate->name)]; } } - return bitrates; + return bitRates; } + (NSSet *)keyPathsForValuesAffectingValueForKey:(NSString *)key @@ -306,6 +306,14 @@ static void *HBAudioEncoderContex = &HBAudioEncoderContex; return retval; } +- (void)setNilValueForKey:(NSString *)key +{ + if ([key isEqualToString:@"drc"] || [key isEqualToString:@"gain"]) + { + [self setValue:@0 forKey:key]; + } +} + #pragma mark - NSCopying - (instancetype)copyWithZone:(NSZone *)zone @@ -371,7 +379,7 @@ static void *HBAudioEncoderContex = &HBAudioEncoderContex; #pragma mark - Value Trasformers -@implementation HBEncoderTrasformer +@implementation HBEncoderTransformer + (Class)transformedValueClass { @@ -403,7 +411,7 @@ static void *HBAudioEncoderContex = &HBAudioEncoderContex; @end -@implementation HBMixdownTrasformer +@implementation HBMixdownTransformer + (Class)transformedValueClass { @@ -435,7 +443,7 @@ static void *HBAudioEncoderContex = &HBAudioEncoderContex; @end -@implementation HBSampleRateTrasformer +@implementation HBSampleRateTransformer + (Class)transformedValueClass { @@ -472,7 +480,7 @@ static void *HBAudioEncoderContex = &HBAudioEncoderContex; @end -@implementation HBIntegerTrasformer +@implementation HBIntegerTransformer + (Class)transformedValueClass { |