From 1943a5c88df391171b59cb05106e57a60bf0efbf Mon Sep 17 00:00:00 2001 From: ritsuka Date: Sun, 10 Aug 2014 14:33:15 +0000 Subject: MacGui: fixed some audio presets key: AudioSamplerate -> string, AudioTrackDRCSlider -> float. git-svn-id: svn://svn.handbrake.fr/HandBrake/trunk@6282 b64f7644-9d1e-0410-96f1-a4d463321fa5 --- macosx/HBAudioSettings.m | 24 +++++++++++++++++++----- macosx/HBAudioTrackPreset.h | 2 +- 2 files changed, 20 insertions(+), 6 deletions(-) (limited to 'macosx') diff --git a/macosx/HBAudioSettings.m b/macosx/HBAudioSettings.m index 654012b8d..4f0f1003d 100644 --- a/macosx/HBAudioSettings.m +++ b/macosx/HBAudioSettings.m @@ -115,12 +115,21 @@ for (NSDictionary *track in preset[@"AudioList"]) { HBAudioTrackPreset *newTrack = [[HBAudioTrackPreset alloc] init]; - newTrack.encoder = hb_audio_encoder_get_from_name([track[@"AudioEncoder"] UTF8String]); - newTrack.mixdown = hb_mixdown_get_from_name([track[@"AudioMixdown"] UTF8String]); - newTrack.sampleRate = [track[@"AudioSamplerate"] intValue]; + if ([track[@"AudioEncoder"] isKindOfClass:[NSString class]]) + { + newTrack.encoder = hb_audio_encoder_get_from_name([track[@"AudioEncoder"] UTF8String]); + } + if ([track[@"AudioMixdown"] isKindOfClass:[NSString class]]) + { + newTrack.mixdown = hb_mixdown_get_from_name([track[@"AudioMixdown"] UTF8String]); + } + if ([track[@"AudioSamplerate"] isKindOfClass:[NSString class]]) + { + newTrack.sampleRate = hb_audio_samplerate_get_from_name([track[@"AudioSamplerate"] UTF8String]); + } newTrack.bitRate = [track[@"AudioBitrate"] intValue]; - newTrack.drc = [track[@"AudioTrackDRCSlider"] intValue]; + newTrack.drc = [track[@"AudioTrackDRCSlider"] floatValue]; newTrack.gain = [track[@"AudioTrackGainSlider"] intValue]; [self.tracksArray addObject:newTrack]; [newTrack release]; @@ -159,9 +168,14 @@ for (HBAudioTrackPreset *track in self.tracksArray) { + NSString *sampleRate = @"Auto"; + if (hb_audio_samplerate_get_name(track.sampleRate)) + { + sampleRate = @(hb_audio_samplerate_get_name(track.sampleRate)); + } NSDictionary *newTrack = @{@"AudioEncoder": @(hb_audio_encoder_get_name(track.encoder)), @"AudioMixdown": @(hb_mixdown_get_name(track.mixdown)), - @"AudioSamplerate": @(track.sampleRate), + @"AudioSamplerate": sampleRate, @"AudioBitrate": @(track.bitRate), @"AudioTrackDRCSlider": @(track.drc), @"AudioTrackGainSlider": @(track.gain)}; diff --git a/macosx/HBAudioTrackPreset.h b/macosx/HBAudioTrackPreset.h index 49abe9820..76950472b 100644 --- a/macosx/HBAudioTrackPreset.h +++ b/macosx/HBAudioTrackPreset.h @@ -24,7 +24,7 @@ @property (nonatomic, readwrite) int bitRate; @property (nonatomic, readwrite) int gain; -@property (nonatomic, readwrite) int drc; +@property (nonatomic, readwrite) float drc; /** * Arrays of possible options for the track properties. -- cgit v1.2.3