From 445938b7d30f2c7c695e8250c1e44d765c63531c Mon Sep 17 00:00:00 2001 From: Damiano Galassi Date: Wed, 28 Oct 2015 08:11:53 +0100 Subject: MacGui: switched the audio defaults track tableview to view based, and fixed a number of typo. --- macosx/HBAudioTrackPreset.m | 40 ++++++++++++++++++++++++---------------- 1 file changed, 24 insertions(+), 16 deletions(-) (limited to 'macosx/HBAudioTrackPreset.m') 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 *)encoders { - NSMutableArray *encoders = [[NSMutableArray alloc] init]; + NSMutableArray *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 *)mixdowns { - NSMutableArray *mixdowns = [[NSMutableArray alloc] init]; + NSMutableArray *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 *)sampleRates { - NSMutableArray *samplerates = [[NSMutableArray alloc] init]; + NSMutableArray *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 *)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 *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 { -- cgit v1.2.3