summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--macosx/HBAudio.m66
-rw-r--r--macosx/HBAudioController.m42
-rw-r--r--macosx/HandBrake.xcodeproj/project.pbxproj1
3 files changed, 55 insertions, 54 deletions
diff --git a/macosx/HBAudio.m b/macosx/HBAudio.m
index 920cd13ae..784d8a202 100644
--- a/macosx/HBAudio.m
+++ b/macosx/HBAudio.m
@@ -40,9 +40,9 @@ static NSMutableArray *masterBitRateArray = nil;
NSDictionary *dict;
id aValue;
- while (nil != (dict = [enumerator nextObject]) && nil == retval)
+ while (nil != (dict = [enumerator nextObject]) && !retval)
{
- if (nil != (aValue = [dict objectForKey: aKey]) && YES == [aValue isEqual: anObject])
+ if (nil != (aValue = [dict objectForKey: aKey]) && [aValue isEqual: anObject])
{
retval = dict;
}
@@ -226,7 +226,7 @@ static NSMutableArray *masterBitRateArray = nil;
}
// First get a list of the permitted codecs based on the internal rules
- if (nil != track && YES == [self enabled])
+ if (nil != track && [self enabled])
{
BOOL goodToAdd;
@@ -238,7 +238,7 @@ static NSMutableArray *masterBitRateArray = nil;
goodToAdd = [[dict objectForKey: keyThatAllows] boolValue];
// Now we make sure if DTS or AC3 is not available in the track it is not put in the codec list, but in a general way
- if (YES == [[dict objectForKey: keyAudioMustMatchTrack] boolValue])
+ if ([[dict objectForKey: keyAudioMustMatchTrack] boolValue])
{
if ([[dict objectForKey: keyAudioMustMatchTrack] intValue] != [[[self track] objectForKey: keyAudioInputCodec] intValue])
{
@@ -246,7 +246,7 @@ static NSMutableArray *masterBitRateArray = nil;
}
}
- if (YES == goodToAdd)
+ if (goodToAdd)
{
[permittedCodecs addObject: dict];
}
@@ -257,7 +257,7 @@ static NSMutableArray *masterBitRateArray = nil;
[self setCodecs: permittedCodecs];
// Ensure our codec is on the list of permitted codecs
- if (nil == [self codec] || NO == [permittedCodecs containsObject: [self codec]])
+ if (![self codec] || ![permittedCodecs containsObject: [self codec]])
{
if (0 < [permittedCodecs count])
{
@@ -307,7 +307,7 @@ static NSMutableArray *masterBitRateArray = nil;
shouldAdd = NO;
}
- if (YES == shouldAdd)
+ if (shouldAdd)
{
[permittedMixdowns addObject: dict];
}
@@ -319,7 +319,7 @@ static NSMutableArray *masterBitRateArray = nil;
theDefaultMixdown = codecCodec;
}
- if (NO == [self enabled])
+ if (![self enabled])
{
permittedMixdowns = nil;
}
@@ -328,12 +328,12 @@ static NSMutableArray *masterBitRateArray = nil;
[self setMixdowns: permittedMixdowns];
// Select the proper one
- if (YES == shouldSetDefault)
+ if (shouldSetDefault)
{
[self setMixdown: [permittedMixdowns dictionaryWithObject: [NSNumber numberWithInt: theDefaultMixdown] matchingKey: keyAudioMixdown]];
}
- if (nil == [self mixdown] || NO == [permittedMixdowns containsObject: [self mixdown]])
+ if (![self mixdown] || ![permittedMixdowns containsObject: [self mixdown]])
{
[self setMixdown: [permittedMixdowns lastObject]];
}
@@ -375,7 +375,7 @@ static NSMutableArray *masterBitRateArray = nil;
shouldAdd = (currentBitRate >= minBitRate && currentBitRate <= maxBitRate);
// Now make sure the mixdown is not limiting us to the track input bitrate
- if (YES == shouldAdd && YES == limitsToTrackInputBitRate)
+ if (shouldAdd && limitsToTrackInputBitRate)
{
if (currentBitRate != trackInputBitRate)
{
@@ -383,7 +383,7 @@ static NSMutableArray *masterBitRateArray = nil;
}
}
- if (YES == shouldAdd)
+ if (shouldAdd)
{
[permittedBitRates addObject: dict];
}
@@ -391,10 +391,10 @@ static NSMutableArray *masterBitRateArray = nil;
// There is a situation where we have a mixdown requirement to match the track input bit rate,
// but it does not fall into the range the codec supports. Therefore, we force it here.
- if (YES == limitsToTrackInputBitRate && 0 == [permittedBitRates count])
+ if (limitsToTrackInputBitRate && 0 == [permittedBitRates count])
{
NSDictionary *missingBitRate = [masterBitRateArray dictionaryWithObject: [NSNumber numberWithInt: trackInputBitRate] matchingKey: keyAudioBitrate];
- if (nil == missingBitRate)
+ if (!missingBitRate)
{
// We are in an even worse situation where the requested bit rate does not even exist in the underlying
// library of supported bitrates. Of course since this value is ignored we can freely make a bogus one
@@ -407,7 +407,7 @@ static NSMutableArray *masterBitRateArray = nil;
[permittedBitRates addObject: missingBitRate];
}
- if (NO == [self enabled])
+ if (![self enabled])
{
permittedBitRates = nil;
}
@@ -416,12 +416,12 @@ static NSMutableArray *masterBitRateArray = nil;
[self setBitRates: permittedBitRates];
// Select the proper one
- if (YES == shouldSetDefault)
+ if (shouldSetDefault)
{
[self setBitRateFromName: [NSString stringWithFormat:@"%d", theDefaultBitRate]];
}
- if (nil == [self bitRate] || NO == [permittedBitRates containsObject: [self bitRate]])
+ if (![self bitRate] || ![permittedBitRates containsObject: [self bitRate]])
{
[self setBitRate: [permittedBitRates lastObject]];
}
@@ -494,41 +494,41 @@ static NSMutableArray *masterBitRateArray = nil;
- (void) observeValueForKeyPath: (NSString *) keyPath ofObject: (id) object change: (NSDictionary *) change context: (void *) context
{
- if (YES == [keyPath isEqualToString: @"videoContainerTag"])
+ if ([keyPath isEqualToString: @"videoContainerTag"])
{
[self updateCodecs];
}
- else if (YES == [keyPath isEqualToString: @"track"])
+ else if ([keyPath isEqualToString: @"track"])
{
if (nil != [self track])
{
[self updateCodecs];
[self updateMixdowns: YES];
- if (YES == [self enabled])
+ if ([self enabled])
{
[self setSampleRate: [[self sampleRates] objectAtIndex: 0]]; // default to Auto
}
- if (YES == [[controller noneTrack] isEqual: [change objectForKey: NSKeyValueChangeOldKey]])
+ if ([[controller noneTrack] isEqual: [change objectForKey: NSKeyValueChangeOldKey]])
{
[controller switchingTrackFromNone: self];
}
- if (YES == [[controller noneTrack] isEqual: [self track]])
+ if ([[controller noneTrack] isEqual: [self track]])
{
[controller settingTrackToNone: self];
}
}
}
- else if (YES == [keyPath isEqualToString: @"codec"])
+ else if ([keyPath isEqualToString: @"codec"])
{
[self updateMixdowns: YES];
[self updateBitRates: YES];
}
- else if (YES == [keyPath isEqualToString: @"mixdown"])
+ else if ([keyPath isEqualToString: @"mixdown"])
{
[self updateBitRates: YES];
[[NSNotificationCenter defaultCenter] postNotificationName: HBMixdownChangedNotification object: self];
}
- else if (YES == [keyPath isEqualToString: @"sampleRate"])
+ else if ([keyPath isEqualToString: @"sampleRate"])
{
[self updateBitRates: NO];
}
@@ -639,7 +639,7 @@ static NSMutableArray *masterBitRateArray = nil;
- (BOOL) enabled
{
- return (nil != track) ? (NO == [track isEqual: [controller noneTrack]]) : NO;
+ return (nil != track) ? (![track isEqual: [controller noneTrack]]) : NO;
}
- (BOOL) mixdownEnabled
@@ -647,7 +647,7 @@ static NSMutableArray *masterBitRateArray = nil;
{
BOOL retval = [self enabled];
- if (YES == retval)
+ if (retval)
{
int myMixdown = [[[self mixdown] objectForKey: keyAudioMixdown] intValue];
if (myMixdown & HB_ACODEC_PASS_FLAG)
@@ -663,7 +663,7 @@ static NSMutableArray *masterBitRateArray = nil;
{
BOOL retval = [self enabled];
- if (YES == retval)
+ if ( retval)
{
int myTrackCodec = [[[self track] objectForKey: keyAudioInputCodec] intValue];
int myCodecCodec = [[[self codec] objectForKey: keyAudioCodec] intValue];
@@ -680,7 +680,7 @@ static NSMutableArray *masterBitRateArray = nil;
{
BOOL retval = [self enabled];
- if (YES == retval)
+ if (retval)
{
int myCodecCodec = [[[self codec] objectForKey: keyAudioCodec] intValue];
if (myCodecCodec & HB_ACODEC_PASS_FLAG)
@@ -696,19 +696,19 @@ static NSMutableArray *masterBitRateArray = nil;
{
NSSet *retval = nil;
- if (YES == [key isEqualToString: @"enabled"])
+ if ([key isEqualToString: @"enabled"])
{
retval = [NSSet setWithObjects: @"track", nil];
}
- else if (YES == [key isEqualToString: @"PassThruDisabled"])
+ else if ([key isEqualToString: @"PassThruDisabled"])
{
retval = [NSSet setWithObjects: @"track", @"codec", nil];
}
- else if (YES == [key isEqualToString: @"AC3Enabled"])
+ else if ([key isEqualToString: @"AC3Enabled"])
{
retval = [NSSet setWithObjects: @"track", @"codec", nil];
}
- else if (YES == [key isEqualToString: @"mixdownEnabled"])
+ else if ([key isEqualToString: @"mixdownEnabled"])
{
retval = [NSSet setWithObjects: @"track", @"mixdown", nil];
}
diff --git a/macosx/HBAudioController.m b/macosx/HBAudioController.m
index be7df4507..0b435499e 100644
--- a/macosx/HBAudioController.m
+++ b/macosx/HBAudioController.m
@@ -90,7 +90,7 @@ NSString *HBMixdownChangedNotification = @"HBMixdownChangedNotification";
for (unsigned int counter = 0; counter < audioArrayCount; counter++)
{
HBAudio *anAudio = [self objectInAudioArrayAtIndex: counter];
- if (YES == [anAudio enabled])
+ if ([anAudio enabled])
{
NSString *prefix = [NSString stringWithFormat: @"Audio%d", counter + 1];
NSNumber *sampleRateToUse = (0 == [[[anAudio sampleRate] objectForKey: keyAudioSamplerate] intValue]) ?
@@ -155,7 +155,7 @@ NSString *HBMixdownChangedNotification = @"HBMixdownChangedNotification";
for (i = 0; i < audioArrayCount; i++)
{
HBAudio *anAudio = [self objectInAudioArrayAtIndex: i];
- if (YES == [anAudio enabled])
+ if ([anAudio enabled])
{
NSNumber *sampleRateToUse = (0 == [[[anAudio sampleRate] objectForKey: keyAudioSamplerate] intValue]) ?
[[anAudio track] objectForKey: keyAudioInputSampleRate] :
@@ -189,7 +189,7 @@ NSString *HBMixdownChangedNotification = @"HBMixdownChangedNotification";
for (i = 0; i < audioArrayCount; i++)
{
HBAudio *anAudio = [self objectInAudioArrayAtIndex: i];
- if (YES == [anAudio enabled])
+ if ([anAudio enabled])
{
NSMutableDictionary *dict = [[NSMutableDictionary alloc] initWithCapacity: 7];
[dict setObject: [[anAudio track] objectForKey: keyAudioTrackIndex] forKey: @"AudioTrack"];
@@ -252,7 +252,7 @@ NSString *HBMixdownChangedNotification = @"HBMixdownChangedNotification";
{
NSArray *retval = [aPreset objectForKey: @"AudioList"];
- if (nil == retval)
+ if (!retval)
{
int maximumNumberOfAllowedAudioTracks = [HBController maximumNumberOfAllowedAudioTracks];
NSString *base;
@@ -298,15 +298,15 @@ NSString *HBMixdownChangedNotification = @"HBMixdownChangedNotification";
[newAudio setTrackFromIndex: trackIndex];
key = [dict objectForKey: @"AudioEncoder"];
if (0 == aType &&
- YES == [[NSUserDefaults standardUserDefaults] boolForKey: @"UseCoreAudio"] &&
- YES == [key isEqualToString: @"AAC (faac)"])
+ [[NSUserDefaults standardUserDefaults] boolForKey: @"UseCoreAudio"] &&
+ [key isEqualToString: @"AAC (faac)"])
{
key = @"AAC (CoreAudio)";
}
- if (YES == [[NSUserDefaults standardUserDefaults] boolForKey: @"AC3PassthruDefaultsToAC3"] &&
- YES == [key isEqualToString: @"AC3 Passthru"])
+ if ([[NSUserDefaults standardUserDefaults] boolForKey: @"AC3PassthruDefaultsToAC3"] &&
+ [key isEqualToString: @"AC3 Passthru"])
{
- if (NO == [newAudio setCodecFromName: key])
+ if (![newAudio setCodecFromName: key])
{
key = @"AC3";
fallenBack = YES;
@@ -326,11 +326,11 @@ NSString *HBMixdownChangedNotification = @"HBMixdownChangedNotification";
// If our preset wants us to support a codec that the track does not support, instead
// of changing the codec we remove the audio instead.
- if (YES == [newAudio setCodecFromName: key])
+ if ([newAudio setCodecFromName: key])
{
[newAudio setMixdownFromName: [dict objectForKey: @"AudioMixdown"]];
[newAudio setSampleRateFromName: [dict objectForKey: @"AudioSamplerate"]];
- if (NO == fallenBack)
+ if (!fallenBack)
{
[newAudio setBitRateFromName: [dict objectForKey: @"AudioBitrate"]];
}
@@ -357,10 +357,10 @@ NSString *HBMixdownChangedNotification = @"HBMixdownChangedNotification";
BOOL found = NO;
// We search for the prefix noting that our titles have the format %d: %s where the %s is the prefix
- for (unsigned int i = 1; i < count && NO == found; i++) // Note that we skip the "None" track
+ for (unsigned int i = 1; i < count && !found; i++) // Note that we skip the "None" track
{
languageTitle = [[masterTrackArray objectAtIndex: i] objectForKey: keyAudioTrackName];
- if (YES == [[languageTitle substringFromIndex: [languageTitle rangeOfString: @" "].location + 1] hasPrefix: prefix])
+ if ([[languageTitle substringFromIndex: [languageTitle rangeOfString: @" "].location + 1] hasPrefix: prefix])
{
retval = i;
found = YES;
@@ -376,7 +376,7 @@ NSString *HBMixdownChangedNotification = @"HBMixdownChangedNotification";
{
static NSMutableDictionary *retval = nil;
- if (nil == retval)
+ if (!retval)
{
retval = [[NSMutableDictionary dictionaryWithObjectsAndKeys:
[NSArray arrayWithObject:
@@ -404,7 +404,7 @@ NSString *HBMixdownChangedNotification = @"HBMixdownChangedNotification";
[self _clearAudioArray];
[self _processPresetAudioArray: whatToUse forTrack: preferredLanguage andType: [[aPreset objectForKey: @"Type"] intValue]];
- if (YES == allTracks)
+ if (allTracks)
{
unsigned int count = [masterTrackArray count];
for (unsigned int i = 1; i < count; i++)
@@ -423,7 +423,7 @@ NSString *HBMixdownChangedNotification = @"HBMixdownChangedNotification";
{
int count = [self countOfAudioArray];
- if (0 == count || NO == [[self objectInAudioArrayAtIndex: 0] enabled])
+ if (0 == count || ![[self objectInAudioArrayAtIndex: 0] enabled])
{
[self addTracksFromPreset: [self _defaultPreset] allTracks: NO];
}
@@ -452,10 +452,10 @@ NSString *HBMixdownChangedNotification = @"HBMixdownChangedNotification";
{
BOOL retval = NO;
unsigned int audioArrayCount = [self countOfAudioArray];
- for (unsigned int i = 0; i < audioArrayCount && NO == retval; i++)
+ for (unsigned int i = 0; i < audioArrayCount && !retval; i++)
{
HBAudio *anAudio = [self objectInAudioArrayAtIndex: i];
- if (YES == [anAudio enabled] && aCodecValue == [[[anAudio codec] objectForKey: keyAudioCodec] intValue])
+ if ([anAudio enabled] && aCodecValue == [[[anAudio codec] objectForKey: keyAudioCodec] intValue])
{
retval = YES;
}
@@ -509,7 +509,7 @@ NSString *HBMixdownChangedNotification = @"HBMixdownChangedNotification";
if (0 < count)
{
HBAudio *lastAudio = [self objectInAudioArrayAtIndex: count - 1];
- if (YES == [lastAudio enabled])
+ if ([lastAudio enabled])
{
needToAdd = YES;
}
@@ -520,7 +520,7 @@ NSString *HBMixdownChangedNotification = @"HBMixdownChangedNotification";
}
}
- if (YES == needToAdd)
+ if (needToAdd)
{
[self addNewAudioTrack];
}
@@ -587,7 +587,7 @@ NSString *HBMixdownChangedNotification = @"HBMixdownChangedNotification";
// Reinitialize the configured list of audio tracks
[self _clearAudioArray];
- if (NO == [myController hasValidPresetSelected])
+ if (![myController hasValidPresetSelected])
{
[self _ensureAtLeastOneNonEmptyTrackExists];
}
diff --git a/macosx/HandBrake.xcodeproj/project.pbxproj b/macosx/HandBrake.xcodeproj/project.pbxproj
index a39496c88..4a20105b4 100644
--- a/macosx/HandBrake.xcodeproj/project.pbxproj
+++ b/macosx/HandBrake.xcodeproj/project.pbxproj
@@ -540,6 +540,7 @@
};
buildConfigurationList = 4D4E7BC4087804870051572B /* Build configuration list for PBXProject "HandBrake" */;
compatibilityVersion = "Xcode 3.1";
+ developmentRegion = English;
hasScannedForEncodings = 1;
knownRegions = (
English,