MacGui: run the Xcode "convert to modern objective-c" on the entire project.

git-svn-id: svn://svn.handbrake.fr/HandBrake/trunk@7075 b64f7644-9d1e-0410-96f1-a4d463321fa5
This commit is contained in:
ritsuka 2015-04-09 19:43:33 +00:00
parent f0cc63a21d
commit f360714523
43 changed files with 111 additions and 111 deletions

View File

@ -15,7 +15,7 @@
@synthesize startColor = _startColor;
@synthesize endColor = _endColor;
- (id)initWithFrame:(NSRect)frame
- (instancetype)initWithFrame:(NSRect)frame
{
self = [super initWithFrame:frame];
if (self) {

View File

@ -416,7 +416,7 @@
NSUInteger currentOptsArrayCount = [currentOptsArray count];
for (loopcounter = 0; loopcounter < currentOptsArrayCount; loopcounter++)
{
thisOpt = [currentOptsArray objectAtIndex:loopcounter];
thisOpt = currentOptsArray[loopcounter];
NSRange splitOptRange = [thisOpt rangeOfString:@"="];
if (splitOptRange.location != NSNotFound)
@ -735,7 +735,7 @@
NSUInteger currentOptsArrayCount = [currentOptsArray count];
for (loopcounter = 0; loopcounter < currentOptsArrayCount; loopcounter++)
{
thisOpt = [currentOptsArray objectAtIndex:loopcounter];
thisOpt = currentOptsArray[loopcounter];
/* Verify the option sets a value */
NSRange splitOptRange = [thisOpt rangeOfString:@"="];
@ -1332,7 +1332,7 @@
NSUInteger currentOptsArrayCount = [currentOptsArray count];
for (loopcounter = 0; loopcounter < currentOptsArrayCount; loopcounter++)
{
thisOpt = [currentOptsArray objectAtIndex:loopcounter];
thisOpt = currentOptsArray[loopcounter];
NSRange splitOptRange = [thisOpt rangeOfString:@"="];
if (splitOptRange.location != NSNotFound)

View File

@ -16,6 +16,8 @@
#import "HBCore.h"
#import "HBController.h"
#define PRESET_FILE @"UserPresets.plist"
@interface HBAppDelegate ()
@property (nonatomic, strong) HBPresetsManager *presetsManager;
@ -49,7 +51,7 @@
_outputPanel = [[HBOutputPanelController alloc] init];
// we init the HBPresetsManager
NSURL *presetsURL = [[HBUtilities appSupportURL] URLByAppendingPathComponent:@"UserPresets.plist"];
NSURL *presetsURL = [[HBUtilities appSupportURL] URLByAppendingPathComponent:PRESET_FILE];
_presetsManager = [[HBPresetsManager alloc] initWithURL:presetsURL];
_queueController = [[HBQueueController alloc] init];

View File

@ -34,7 +34,7 @@ extern NSString *HBAudioChangedNotification;
@interface HBAudio (KVC)
- (NSUInteger)countOfTracks;
@property (nonatomic, readonly) NSUInteger countOfTracks;
- (HBAudioTrack *)objectInTracksAtIndex:(NSUInteger)index;
- (void)insertObject:(HBAudioTrack *)track inTracksAtIndex:(NSUInteger)index;
- (void)removeObjectFromTracksAtIndex:(NSUInteger)index;

View File

@ -387,7 +387,7 @@ NSString *HBAudioChangedNotification = @"HBAudioChangedNotification";
encodeObject(_defaults);
}
- (id)initWithCoder:(NSCoder *)decoder
- (instancetype)initWithCoder:(NSCoder *)decoder
{
self = [super init];

View File

@ -285,7 +285,7 @@
encodeBool(_secondaryEncoderMode);
}
- (id)initWithCoder:(NSCoder *)decoder
- (instancetype)initWithCoder:(NSCoder *)decoder
{
self = [super init];

View File

@ -607,7 +607,7 @@ static NSMutableArray *masterBitRateArray = nil;
encodeObject(_bitRates);
}
- (id)initWithCoder:(NSCoder *)decoder
- (instancetype)initWithCoder:(NSCoder *)decoder
{
self = [super init];

View File

@ -277,7 +277,7 @@ static void *HBAudioEncoderContex = &HBAudioEncoderContex;
encodeInt(_container);
}
- (id)initWithCoder:(NSCoder *)decoder
- (instancetype)initWithCoder:(NSCoder *)decoder
{
self = [super init];

View File

@ -48,9 +48,8 @@
{
if (aTableColumn != nil && [[aTableColumn identifier] intValue] == 2)
{
[self.chapterTitles replaceObjectAtIndex:rowIndex
withObject:[NSString
stringWithString:anObject]];
(self.chapterTitles)[rowIndex] = [NSString
stringWithString:anObject];
}
}
@ -64,8 +63,7 @@
}
else
{
return [NSString stringWithString:[self.chapterTitles
objectAtIndex:rowIndex]];
return [NSString stringWithString:(self.chapterTitles)[rowIndex]];
}
return @"__DATA ERROR__";
}
@ -81,11 +79,11 @@ a timer to avoid interfering with the chain of events that handles the edit. */
// Edit the cell in the next row, same column
row++;
textMovement = [[[notification userInfo] objectForKey:@"NSTextMovement"] integerValue];
textMovement = [[notification userInfo][@"NSTextMovement"] integerValue];
if( textMovement == NSReturnTextMovement && row < [chapterTable numberOfRows] )
{
NSArray *info = [NSArray arrayWithObjects:chapterTable,
[NSNumber numberWithInteger:column], [NSNumber numberWithInteger:row], nil];
NSArray *info = @[chapterTable,
@(column), @(row)];
/* The delay is unimportant; editNextRow: won't be called until the responder
chain finishes because the event loop containing the timer is on this thread */
[self performSelector:@selector(editNextRow:) withObject:info afterDelay:0.0];
@ -94,9 +92,9 @@ a timer to avoid interfering with the chain of events that handles the edit. */
- (void)editNextRow: (id) objects
{
NSTableView *chapterTable = [objects objectAtIndex:0];
NSInteger column = [[objects objectAtIndex:1] integerValue];
NSInteger row = [[objects objectAtIndex:2] integerValue];
NSTableView *chapterTable = objects[0];
NSInteger column = [objects[1] integerValue];
NSInteger row = [objects[2] integerValue];
if( row >= 0 && row < [chapterTable numberOfRows] )
{
@ -133,7 +131,7 @@ a timer to avoid interfering with the chain of events that handles the edit. */
if ([chaptersMutableArray count] > 0)
{
/* if last item is empty remove it */
if ([[chaptersMutableArray objectAtIndex:[chaptersArray count]-1] length] == 0)
if ([chaptersMutableArray[[chaptersArray count]-1] length] == 0)
{
[chaptersMutableArray removeLastObject];
}
@ -154,12 +152,12 @@ a timer to avoid interfering with the chain of events that handles the edit. */
for (i=0; i<chapters; i++)
{
if([[chaptersMutableArray objectAtIndex:i] length] > 5)
if([chaptersMutableArray[i] length] > 5)
{
/* avoid a segfault */
/* Get the Range.location of the first comma in the line and then put everything after that into chapterTitle */
NSRange firstCommaRange = [[chaptersMutableArray objectAtIndex:i] rangeOfString:@","];
NSString *chapterTitle = [[chaptersMutableArray objectAtIndex:i] substringFromIndex:firstCommaRange.location + 1];
NSRange firstCommaRange = [chaptersMutableArray[i] rangeOfString:@","];
NSString *chapterTitle = [chaptersMutableArray[i] substringFromIndex:firstCommaRange.location + 1];
/* Since we store our chapterTitle commas as "\," for the cli, we now need to remove the escaping "\" from the title */
chapterTitle = [chapterTitle stringByReplacingOccurrencesOfString:@"\\," withString:@","];
[self tableView:fChapterTable

View File

@ -69,8 +69,7 @@
{
// Init libhb
int loggingLevel = [[[NSUserDefaults standardUserDefaults] objectForKey:@"LoggingLevel"] intValue];
_core = [[HBCore alloc] initWithLoggingLevel:loggingLevel];
_core.name = @"ScanCore";
_core = [[HBCore alloc] initWithLogLevel:loggingLevel name:@"ScanCore"];
// Inits the controllers
fPreviewController = [[HBPreviewController alloc] init];
@ -1323,7 +1322,7 @@
NSMutableDictionary *preset = [NSMutableDictionary dictionary];
NSDictionary *currentPreset = self.selectedPreset.content;
preset[@"PresetBuildNumber"] = [NSString stringWithFormat: @"%d", [[[[NSBundle mainBundle] infoDictionary] objectForKey:@"CFBundleVersion"] intValue]];
preset[@"PresetBuildNumber"] = [NSString stringWithFormat: @"%d", [[[NSBundle mainBundle] infoDictionary][@"CFBundleVersion"] intValue]];
preset[@"PresetName"] = self.job.presetName;
preset[@"Folder"] = @NO;

View File

@ -62,9 +62,18 @@ typedef void (^HBCoreCompletionHandler)(BOOL success);
* Opens low level HandBrake library. This should be called once before other
* functions HBCore are used.
*
* @param loggingLevel the desired libhb logging level.
* @param level the desired libhb logging level.
*/
- (instancetype)initWithLoggingLevel:(int)loggingLevel;
- (instancetype)initWithLogLevel:(int)level NS_DESIGNATED_INITIALIZER;
/**
* Opens low level HandBrake library. This should be called once before other
* functions HBCore are used.
*
* @param level the desired libhb logging level
* @param name the instance debug name
*/
- (instancetype)initWithLogLevel:(int)level name:(NSString *)name;
/**
* Current state of HBCore.
@ -123,7 +132,7 @@ typedef void (^HBCoreCompletionHandler)(BOOL success);
- (CGImageRef)copyImageAtIndex:(NSUInteger)index
forTitle:(HBTitle *)title
pictureFrame:(HBPicture *)frame
deinterlace:(BOOL)deinterlace;
deinterlace:(BOOL)deinterlace CF_RETURNS_RETAINED;
/**
* Initiates an asynchronous encode operation and returns immediately.

View File

@ -81,21 +81,12 @@ static void hb_error_handler(const char *errmsg)
hb_register_error_handler(&hb_error_handler);
}
/**
* Initializes HBCore.
*/
- (instancetype)init
{
return [self initWithLoggingLevel:0];
return [self initWithLogLevel:0];
}
/**
* Opens low level HandBrake library. This should be called once before other
* functions HBCore are used.
*
* @param debugMode If set to YES, libhb will print verbose debug output.
*/
- (instancetype)initWithLoggingLevel:(int)loggingLevel
- (instancetype)initWithLogLevel:(int)level
{
self = [super init];
if (self)
@ -105,7 +96,7 @@ static void hb_error_handler(const char *errmsg)
_updateTimerQueue = dispatch_queue_create("fr.handbrake.coreQueue", DISPATCH_QUEUE_SERIAL);
_hb_state = malloc(sizeof(struct hb_state_s));
_hb_handle = hb_init(loggingLevel, 0);
_hb_handle = hb_init(level, 0);
if (!_hb_handle)
{
return nil;
@ -115,6 +106,16 @@ static void hb_error_handler(const char *errmsg)
return self;
}
- (instancetype)initWithLogLevel:(int)level name:(NSString *)name
{
self = [self initWithLogLevel:level];
if (self)
{
_name = [name copy];
}
return self;
}
/**
* Releases resources.
*/

View File

@ -17,9 +17,9 @@
}
+ (HBDVDDetector *)detectorForPath: (NSString *)aPath;
- (HBDVDDetector *)initWithPath: (NSString *)aPath;
- (HBDVDDetector *)initWithPath: (NSString *)aPath NS_DESIGNATED_INITIALIZER;
- (BOOL)isVideoDVD;
- (NSString *)devicePath;
@property (nonatomic, getter=isVideoDVD, readonly) BOOL videoDVD;
@property (nonatomic, readonly, copy) NSString *devicePath;
@end

View File

@ -292,7 +292,7 @@ NSString *HBDistributedArraWrittenToDisk = @"HBDistributedArraWrittenToDisk";
- (void)replaceObjectAtIndex:(NSUInteger)index withObject:(id)anObject
{
[self.array replaceObjectAtIndex:index withObject:[self wrapObjectIfNeeded:anObject]];
(self.array)[index] = [self wrapObjectIfNeeded:anObject];
}
- (NSUInteger)count
@ -302,7 +302,7 @@ NSString *HBDistributedArraWrittenToDisk = @"HBDistributedArraWrittenToDisk";
- (id)objectAtIndex:(NSUInteger)index
{
return [self.array objectAtIndex:index];
return (self.array)[index];
}
@end

View File

@ -10,7 +10,7 @@
@interface HBDockTile : NSObject
- (instancetype)initWithDockTile:(NSDockTile *)dockTile image:(NSImage *)image;
- (instancetype)initWithDockTile:(NSDockTile *)dockTile image:(NSImage *)image NS_DESIGNATED_INITIALIZER;
/**
* Updates two DockTextFields on the dockTile,

View File

@ -8,7 +8,7 @@
@implementation HBExceptionAlertController
- (id)init
- (instancetype)init
{
return [self initWithWindowNibName:@"ExceptionAlert"];
}

View File

@ -278,7 +278,7 @@ NSDictionary *_HandBrake_nlmeansTunesDict;
encodeBool(_useDecomb);
}
- (id)initWithCoder:(NSCoder *)decoder
- (instancetype)initWithCoder:(NSCoder *)decoder
{
self = [super init];

View File

@ -8,23 +8,12 @@
#import <Cocoa/Cocoa.h>
@interface HBImageAndTextCell : NSTextFieldCell
{
@private
NSImage *image;
NSImageAlignment imageAlignment; // defaults to NSImageAlignTop. Supports NSImageAlignCenter & NSImageAlignBottom
NSSize imageSpacing; // horizontal and vertical spacing around the image
}
- (void) setImage:(NSImage *)anImage;
- (NSImage *) image;
- (void) setImageAlignment:(NSImageAlignment)alignment;
- (NSImageAlignment) imageAlignment;
- (void)setImageSpacing:(NSSize)aSize;
- (NSSize)imageSpacing;
@property (strong) NSImage *image;
@property (nonatomic) NSImageAlignment imageAlignment;
@property (nonatomic) NSSize imageSpacing;
- (void) drawWithFrame:(NSRect)cellFrame inView:(NSView *)controlView;
- (NSSize) cellSize;
@property (readonly) NSSize cellSize;
@end

View File

@ -70,8 +70,14 @@ scaleProportionally(NSSize imageSize, NSRect canvasRect)
#endif
@implementation HBImageAndTextCell
{
@private
NSImage *image;
NSImageAlignment imageAlignment; // defaults to NSImageAlignTop. Supports NSImageAlignCenter & NSImageAlignBottom
NSSize imageSpacing; // horizontal and vertical spacing around the image
}
-(id)initTextCell:(NSString *)aString
-(instancetype)initTextCell:(NSString *)aString
{
if (self = [super initTextCell:aString])
{
@ -81,7 +87,7 @@ scaleProportionally(NSSize imageSize, NSRect canvasRect)
return self;
}
-(id)initWithCoder:(NSCoder *)decoder
-(instancetype)initWithCoder:(NSCoder *)decoder
{
if (self = [super initWithCoder:decoder])
{

View File

@ -64,7 +64,7 @@ static NSDictionary *shortHeightAttr;
}
else
{
title = [NSString stringWithUTF8String:container->name];
title = @(container->name);
}
[containers addObject:title];
}

View File

@ -215,7 +215,7 @@ NSString *HBChaptersChangedNotification = @"HBChaptersChangedNotification";
encodeObject(_chapterTitles);
}
- (id)initWithCoder:(NSCoder *)decoder
- (instancetype)initWithCoder:(NSCoder *)decoder
{
self = [super init];

View File

@ -14,6 +14,6 @@
*/
@interface HBJobOutputFileWriter : HBOutputFileWriter
- (instancetype)initWithJob:(HBJob *)job;
- (instancetype)initWithJob:(HBJob *)job NS_DESIGNATED_INITIALIZER;
@end

View File

@ -21,7 +21,7 @@
@property (nonatomic, readonly) NSString *language;
@property (nonatomic, readonly) NSString *iso639_2;
- (instancetype)initWithLanguage:(NSString *)value iso639_2code:(NSString *)code;
- (instancetype)initWithLanguage:(NSString *)value iso639_2code:(NSString *)code NS_DESIGNATED_INITIALIZER;
@end;
@ -33,7 +33,7 @@
@property (nonatomic, readonly) NSMutableArray *languagesArray;
@property (nonatomic, readonly) NSArray *selectedLanguages;
- (instancetype)initWithLanguages:(NSArray *)languages;
- (instancetype)initWithLanguages:(NSArray *)languages NS_DESIGNATED_INITIALIZER;
@end

View File

@ -139,7 +139,7 @@
- (IBAction)copyAllOutputToPasteboard:(id)sender
{
NSPasteboard *pboard = [NSPasteboard generalPasteboard];
[pboard declareTypes:[NSArray arrayWithObject:NSStringPboardType] owner:nil];
[pboard declareTypes:@[NSStringPboardType] owner:nil];
[pboard setString:[outputTextStorage string] forType:NSStringPboardType];
}

View File

@ -35,7 +35,7 @@ static int stderrwrite(void *inFD, const char *buffer, int size);
@interface HBOutputRedirect (Private)
- (id)initWithStream:(FILE *)aStream selector:(SEL)aSelector;
- (instancetype)initWithStream:(FILE *)aStream selector:(SEL)aSelector;
- (void)startRedirect;
- (void)stopRedirect;
- (void)forwardOutput:(NSData *)data;
@ -142,7 +142,7 @@ int stderrwrite(void *inFD, const char *buffer, int size)
*
* @return New HBOutputRedirect object.
*/
- (id)initWithStream:(FILE *)aStream selector:(SEL)aSelector
- (instancetype)initWithStream:(FILE *)aStream selector:(SEL)aSelector
{
if (self = [super init])
{

View File

@ -486,7 +486,7 @@ NSString * const HBPictureChangedNotification = @"HBPictureChangedNotification";
encodeInt(_cropRight);
}
- (id)initWithCoder:(NSCoder *)decoder
- (instancetype)initWithCoder:(NSCoder *)decoder
{
self = [super init];

View File

@ -238,7 +238,7 @@ NSString *HBPresetsChangedNotification = @"HBPresetsChangedNotification";
if (parentNode.children.count > currIdx)
{
parentNode = [parentNode.children objectAtIndex:currIdx];
parentNode = (parentNode.children)[currIdx];
}
}
@ -246,7 +246,7 @@ NSString *HBPresetsChangedNotification = @"HBPresetsChangedNotification";
if (parentNode.children.count > currIdx)
{
if ([[parentNode.children objectAtIndex:currIdx] isDefault])
if ([(parentNode.children)[currIdx] isDefault])
{
[parentNode removeObjectFromChildrenAtIndex:currIdx];
// Try to select a new default preset
@ -365,7 +365,7 @@ NSString *HBPresetsChangedNotification = @"HBPresetsChangedNotification";
// set a new Default preset
[self selectNewDefault];
[HBUtilities writeToActivityLog: "built in presets updated to build number: %d", [[[[NSBundle mainBundle] infoDictionary] objectForKey:@"CFBundleVersion"] intValue]];
[HBUtilities writeToActivityLog: "built in presets updated to build number: %d", [[[NSBundle mainBundle] infoDictionary][@"CFBundleVersion"] intValue]];
}
- (void)deleteBuiltInPresets

View File

@ -194,7 +194,7 @@ typedef enum ViewMode : NSUInteger {
NSMutableDictionary *actions = [NSMutableDictionary
dictionaryWithDictionary:[self.pictureLayer actions]];
[actions setObject:[NSNull null] forKey:@"contents"];
actions[@"contents"] = [NSNull null];
[self.pictureLayer setActions:actions];
[[[[self window] contentView] layer] insertSublayer:self.backLayer below: [fMovieView layer]];
@ -289,8 +289,7 @@ typedef enum ViewMode : NSUInteger {
NSWindow *theWindow = (NSWindow *)[notification object];
CGFloat newBackingScaleFactor = [theWindow backingScaleFactor];
CGFloat oldBackingScaleFactor = [[[notification userInfo]
objectForKey:@"NSBackingPropertyOldScaleFactorKey"]
CGFloat oldBackingScaleFactor = [[notification userInfo][@"NSBackingPropertyOldScaleFactorKey"]
doubleValue];
if (newBackingScaleFactor != oldBackingScaleFactor)
@ -855,7 +854,7 @@ typedef enum ViewMode : NSUInteger {
if (subtitlesArray && [subtitlesArray count])
{
// enable the first tx3g subtitle track
[[subtitlesArray objectAtIndex: 0] setEnabled: YES];
[subtitlesArray[0] setEnabled: YES];
}
else
{
@ -865,7 +864,7 @@ typedef enum ViewMode : NSUInteger {
{
// track 0 should be video, other video tracks should
// be subtitles; force-enable the first subs track
[[subtitlesArray objectAtIndex: 1] setEnabled: YES];
[subtitlesArray[1] setEnabled: YES];
}
}

View File

@ -24,15 +24,15 @@
@property (nonatomic, unsafe_unretained) id <HBPreviewGeneratorDelegate> delegate;
- (instancetype)initWithCore:(HBCore *)core job:(HBJob *)job;
- (instancetype)initWithCore:(HBCore *)core job:(HBJob *)job NS_DESIGNATED_INITIALIZER;
/* Still image generator */
- (CGImageRef) copyImageAtIndex: (NSUInteger) index shouldCache: (BOOL) cache;
- (NSUInteger) imagesCount;
- (CGSize)imageSize;
- (CGImageRef) copyImageAtIndex: (NSUInteger) index shouldCache: (BOOL) cache CF_RETURNS_RETAINED;
@property (nonatomic, readonly) NSUInteger imagesCount;
@property (nonatomic, readonly) CGSize imageSize;
- (void) purgeImageCache;
- (NSString *)info;
@property (nonatomic, readonly, copy) NSString *info;
/* Video generator */
- (BOOL) createMovieAsyncWithImageAtIndex: (NSUInteger) index duration: (NSUInteger) seconds;

View File

@ -15,7 +15,6 @@
@interface HBPreviewGenerator ()
@property (nonatomic, readonly) NSMutableDictionary *picturePreviews;
@property (nonatomic, readonly) NSUInteger imagesCount;
@property (unsafe_unretained, nonatomic, readonly) HBCore *scanCore;
@property (unsafe_unretained, nonatomic, readonly) HBJob *job;
@ -62,7 +61,7 @@
// The preview for the specified index may not currently exist, so this method
// generates it if necessary.
CGImageRef theImage = (__bridge CGImageRef)[self.picturePreviews objectForKey:@(index)];
CGImageRef theImage = (__bridge CGImageRef)(self.picturePreviews)[@(index)];
if (!theImage)
{
@ -75,7 +74,7 @@
deinterlace:deinterlace];
if (cache && theImage)
{
[self.picturePreviews setObject:(__bridge id)theImage forKey:@(index)];
(self.picturePreviews)[@(index)] = (__bridge id)theImage;
}
}
else
@ -178,9 +177,8 @@
job.video.twoPass = NO;
// Init the libhb core
int loggingLevel = [[[NSUserDefaults standardUserDefaults] objectForKey:@"LoggingLevel"] intValue];
self.core = [[HBCore alloc] initWithLoggingLevel:loggingLevel];
self.core.name = @"PreviewCore";
int level = [[[NSUserDefaults standardUserDefaults] objectForKey:@"LoggingLevel"] intValue];
self.core = [[HBCore alloc] initWithLogLevel:level name:@"PreviewCore"];
// start the actual encode
[self.core encodeJob:job

View File

@ -77,8 +77,7 @@
int loggingLevel = [[[NSUserDefaults standardUserDefaults] objectForKey:@"LoggingLevel"] intValue];
// Init a separate instance of libhb for the queue
_core = [[HBCore alloc] initWithLoggingLevel:loggingLevel];
_core.name = @"QueueCore";
_core = [[HBCore alloc] initWithLogLevel:loggingLevel name:@"QueueCore"];
[self loadQueueFile];
}

View File

@ -41,6 +41,6 @@
* If the selected row indexes contain the clicked row index, it returns every selected row,
* otherwise it returns only the clicked row index.
*/
- (NSIndexSet *)targetedRowIndexes;
@property (nonatomic, readonly, copy) NSIndexSet *targetedRowIndexes;
@end

View File

@ -159,7 +159,7 @@ NSString *HBRangeChangedNotification = @"HBRangeChangedNotification";
encodeInt(_frameStop);
}
- (id)initWithCoder:(NSCoder *)decoder
- (instancetype)initWithCoder:(NSCoder *)decoder
{
self = [super init];

View File

@ -61,7 +61,7 @@ extern NSString *keySubTrackLanguageIndex;
@interface HBSubtitles (KVC)
- (NSUInteger)countOfTracks;
@property (nonatomic, readonly) NSUInteger countOfTracks;
- (id)objectInTracksAtIndex:(NSUInteger)index;
- (void)insertObject:(id)audioObject inTracksAtIndex:(NSUInteger)index;
- (void)removeObjectFromTracksAtIndex:(NSUInteger)index;

View File

@ -497,7 +497,7 @@ NSString *keySubTrackLanguageIndex = @"keySubTrackLanguageIndex";
encodeObject(_defaults);
}
- (id)initWithCoder:(NSCoder *)decoder
- (instancetype)initWithCoder:(NSCoder *)decoder
{
self = [super init];

View File

@ -143,7 +143,7 @@
encodeBool(_burnInBluraySubtitles);
}
- (id)initWithCoder:(NSCoder *)decoder
- (instancetype)initWithCoder:(NSCoder *)decoder
{
self = [super init];

View File

@ -20,7 +20,7 @@
* @param title the libhb title to wrap.
* @param featured whether the title is the featured one or not.
*/
- (instancetype)initWithTitle:(hb_title_t *)title featured:(BOOL)featured;
- (instancetype)initWithTitle:(hb_title_t *)title featured:(BOOL)featured NS_DESIGNATED_INITIALIZER;
@property (nonatomic, readonly) NSString *name;
@property (nonatomic, readonly, getter=isFeatured) BOOL featured;

View File

@ -36,7 +36,7 @@
- (void)enumerateObjectsUsingBlock:(void (^)(id obj, NSIndexPath *idx, BOOL *stop))block;
// KVC Accessor Methods
- (NSUInteger)countOfChildren;
@property (nonatomic, readonly) NSUInteger countOfChildren;
- (id)objectInChildrenAtIndex:(NSUInteger)index;
- (void)insertObject:(HBTreeNode *)presetObject inChildrenAtIndex:(NSUInteger)index;
- (void)removeObjectFromChildrenAtIndex:(NSUInteger)index;

View File

@ -25,7 +25,7 @@
- (id)objectInChildrenAtIndex:(NSUInteger)index
{
return [self.children objectAtIndex:index];
return (self.children)[index];
}
- (void)insertObject:(HBTreeNode *)presetObject inChildrenAtIndex:(NSUInteger)index

View File

@ -122,7 +122,7 @@
else
{
// Append the right quality suffix for the selected codec (rf/qp)
[name appendString:[[NSString stringWithUTF8String:hb_video_quality_get_name(codec)] lowercaseString]];
[name appendString:[@(hb_video_quality_get_name(codec)) lowercaseString]];
[name appendString:[NSString stringWithFormat:@"%0.2f", quality]];
}
}

View File

@ -41,9 +41,9 @@
@end
@interface HBPresetsTransformer : NSValueTransformer
- (instancetype)initWithEncoder:(int)encoder;
- (instancetype)initWithEncoder:(int)encoder NS_DESIGNATED_INITIALIZER;
@end
@interface HBQualityTransformer : NSValueTransformer
- (instancetype)initWithReversedDirection:(BOOL)reverse min:(double)min max:(double)max;
- (instancetype)initWithReversedDirection:(BOOL)reverse min:(double)min max:(double)max NS_DESIGNATED_INITIALIZER;
@end

View File

@ -132,7 +132,7 @@
// update the text field
if (fX264PresetsUnparsedUTF8String != NULL)
{
tmpString = [NSString stringWithUTF8String:fX264PresetsUnparsedUTF8String];
tmpString = @(fX264PresetsUnparsedUTF8String);
free(fX264PresetsUnparsedUTF8String);
}
else

View File

@ -421,7 +421,7 @@ NSString * const HBVideoChangedNotification = @"HBVideoChangedNotification";
encodeBool(_fastDecode);
}
- (id)initWithCoder:(NSCoder *)decoder
- (instancetype)initWithCoder:(NSCoder *)decoder
{
self = [super init];