summaryrefslogtreecommitdiffstats
path: root/macosx
diff options
context:
space:
mode:
authorritsuka <[email protected]>2014-08-10 14:33:15 +0000
committerritsuka <[email protected]>2014-08-10 14:33:15 +0000
commit1943a5c88df391171b59cb05106e57a60bf0efbf (patch)
tree0a8e3c3a10473741fa299558aa285654e35f576f /macosx
parentff067cd49499e696f65da8efb8e565717d52d0b0 (diff)
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
Diffstat (limited to 'macosx')
-rw-r--r--macosx/HBAudioSettings.m24
-rw-r--r--macosx/HBAudioTrackPreset.h2
2 files changed, 20 insertions, 6 deletions
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.