@implementation HBAVPlayerRateObserver
-- (void)postNotification;
+- (void)postNotification
{
self.block();
}
#pragma mark public methods
-- (void)loadPlayableValueAsynchronouslyWithCompletionHandler:(nullable void (^)(void))handler;
+- (void)loadPlayableValueAsynchronouslyWithCompletionHandler:(nullable void (^)(void))handler
{
if (self.isLoaded)
{
@interface HBAddPresetController ()
-@property (unsafe_unretained) IBOutlet NSTextField *name;
-@property (unsafe_unretained) IBOutlet NSTextField *desc;
+@property (nonatomic, unsafe_unretained) IBOutlet NSTextField *name;
+@property (nonatomic, unsafe_unretained) IBOutlet NSTextField *desc;
-@property (unsafe_unretained) IBOutlet NSPopUpButton *categories;
+@property (nonatomic, unsafe_unretained) IBOutlet NSPopUpButton *categories;
-@property (unsafe_unretained) IBOutlet NSPopUpButton *picSettingsPopUp;
-@property (unsafe_unretained) IBOutlet NSTextField *picWidth;
-@property (unsafe_unretained) IBOutlet NSTextField *picHeight;
-@property (unsafe_unretained) IBOutlet NSBox *picWidthHeightBox;
+@property (nonatomic, unsafe_unretained) IBOutlet NSPopUpButton *picSettingsPopUp;
+@property (nonatomic, unsafe_unretained) IBOutlet NSTextField *picWidth;
+@property (nonatomic, unsafe_unretained) IBOutlet NSTextField *picHeight;
+@property (nonatomic, unsafe_unretained) IBOutlet NSBox *picWidthHeightBox;
@property (nonatomic, strong) HBPreset *preset;
@property (nonatomic, strong) HBMutablePreset *mutablePreset;
@property (nonatomic, strong) HBPresetsManager *presetsManager;
@property (nonatomic, strong) HBPresetsMenuBuilder *presetsMenuBuilder;
-@property (unsafe_unretained) IBOutlet NSMenu *presetsMenu;
+@property (nonatomic, unsafe_unretained) IBOutlet NSMenu *presetsMenu;
@property (nonatomic, strong) HBPreferencesController *preferencesController;
#import <Cocoa/Cocoa.h>
@interface HBApplication : NSApplication
-
@end
#pragma mark - Data Source
-- (NSDictionary<NSString *, id> *)sourceTrackAtIndex:(NSUInteger)idx;
+- (NSDictionary<NSString *, id> *)sourceTrackAtIndex:(NSUInteger)idx
{
return self.sourceTracks[idx];
}
#pragma mark - Delegate
-- (void)track:(HBAudioTrack *)track didChangeSourceFrom:(NSUInteger)oldSourceIdx;
+- (void)track:(HBAudioTrack *)track didChangeSourceFrom:(NSUInteger)oldSourceIdx
{
// If the source was changed to None, remove the track
if (track.sourceTrackIdx == NONE_TRACK_INDEX)
return self.tracks[index];
}
-- (void)insertObject:(HBAudioTrack *)track inTracksAtIndex:(NSUInteger)index;
+- (void)insertObject:(HBAudioTrack *)track inTracksAtIndex:(NSUInteger)index
{
[[self.undo prepareWithInvocationTarget:self] removeObjectFromTracksAtIndex:index];
[self.tracks insertObject:track atIndex:index];
@class HBAudio;
-/**
- * HBAudioController
- */
+NS_ASSUME_NONNULL_BEGIN
+
@interface HBAudioController : NSViewController
@property (nonatomic, readwrite, weak) HBAudio *audio;
@end
+
+NS_ASSUME_NONNULL_END
+
return self.tracksArray[index];
}
-- (void)insertObject:(HBAudioTrackPreset *)track inTracksArrayAtIndex:(NSUInteger)index;
+- (void)insertObject:(HBAudioTrackPreset *)track inTracksArrayAtIndex:(NSUInteger)index
{
[[self.undo prepareWithInvocationTarget:self] removeObjectFromTracksArrayAtIndex:index];
[self.tracksArray insertObject:track atIndex:index];
@class HBAudioDefaults;
+NS_ASSUME_NONNULL_BEGIN
+
@interface HBAudioDefaultsController : NSWindowController
- (instancetype)initWithSettings:(HBAudioDefaults *)settings;
@end
+
+NS_ASSUME_NONNULL_END
+
@property (nonatomic, readonly, strong) HBLanguagesSelection *languagesList;
-@property (unsafe_unretained) IBOutlet HBLanguageArrayController *tableController;
-@property (unsafe_unretained) IBOutlet NSButton *showAllButton;
+@property (nonatomic, unsafe_unretained) IBOutlet HBLanguageArrayController *tableController;
+@property (nonatomic, unsafe_unretained) IBOutlet NSButton *showAllButton;
-@property (unsafe_unretained) IBOutlet NSArrayController *tracksController;
+@property (nonatomic, unsafe_unretained) IBOutlet NSArrayController *tracksController;
@end
- (instancetype)initWithTrackIdx:(NSUInteger)index
container:(int)container
dataSource:(id<HBAudioTrackDataSource>)dataSource
- delegate:(id<HBAudioTrackDelegate>)delegate;
+ delegate:(id<HBAudioTrackDelegate>)delegate
{
self = [super init];
if (self)
@class HBJob;
-/**
- * HBChapterTitlesController
- */
+NS_ASSUME_NONNULL_BEGIN
+
@interface HBChapterTitlesController : NSViewController
@property (nonatomic, readwrite, weak) HBJob *job;
@end
+
+NS_ASSUME_NONNULL_END
+
// <one>
// <John said, "Hello there.">
// <three>
-+ (nullable NSArray<NSArray<NSString *> *> *)HB_arrayWithContentsOfCSVURL:(NSURL *)url;
++ (nullable NSArray<NSArray<NSString *> *> *)HB_arrayWithContentsOfCSVURL:(NSURL *)url
{
NSString *str = [[NSString alloc] initWithContentsOfURL:url encoding:NSUTF8StringEncoding error:NULL];
@interface HBChapterTitlesController () <NSTableViewDataSource, NSTableViewDelegate>
-@property (weak) IBOutlet NSTableView *table;
+@property (nonatomic, weak) IBOutlet NSTableView *table;
@property (nonatomic, readwrite, strong) NSArray<HBChapter *> *chapterTitles;
@end
@class HBJob;
+NS_ASSUME_NONNULL_BEGIN
+
@interface HBController : NSWindowController
- (instancetype)initWithDelegate:(HBAppDelegate *)delegate queue:(HBQueue *)queue presetsManager:(HBPresetsManager *)manager;
- (IBAction)deletePreset:(id)sender;
- (IBAction)reloadPreset:(id)sender;
-
@end
+
+NS_ASSUME_NONNULL_END
+
@implementation HBController
-- (instancetype)initWithDelegate:(HBAppDelegate *)delegate queue:(HBQueue *)queue presetsManager:(HBPresetsManager *)manager;
+- (instancetype)initWithDelegate:(HBAppDelegate *)delegate queue:(HBQueue *)queue presetsManager:(HBPresetsManager *)manager
{
self = [super initWithWindowNibName:@"MainWindow"];
if (self)
[self _touchBar_validateUserInterfaceItems];
}
NSUInteger count = self.queue.pendingItemsCount;
- self.showQueueToolbarItem.badgeValue = count ? @(count).stringValue : nil;
+ self.showQueueToolbarItem.badgeValue = count ? @(count).stringValue : @"";
}
- (void)updateToolbarButtonsStateForScanCore:(HBState)state
{
if ([NSUserDefaults.standardUserDefaults boolForKey:HBShowOpenPanelAtLaunch])
{
- [self browseSources:nil];
+ [self browseSources:self];
}
}
}
[self doAddTitlesToQueue:titles];
}
-- (void)doAddTitlesToQueue:(NSArray<HBTitle *> *)titles;
+- (void)doAddTitlesToQueue:(NSArray<HBTitle *> *)titles
{
NSMutableArray<HBJob *> *jobs = [[NSMutableArray alloc] init];
BOOL fileExists = NO;
}
}
-- (void)reloadPreset:(id)sender;
+- (void)reloadPreset:(id)sender
{
// Reload the currently selected preset if it is selected.
if (self.currentPreset != NULL)
hb_image_close(&image);
}
- if (angle || flipped)
+ if (img && (angle || flipped))
{
CGImageRef rotatedImg = CGImageRotated(img, angle, flipped);
CGImageRelease(img);
#pragma mark - Encodes
-- (void)encodeJob:(HBJob *)job progressHandler:(HBCoreProgressHandler)progressHandler completionHandler:(HBCoreCompletionHandler)completionHandler;
+- (void)encodeJob:(HBJob *)job progressHandler:(HBCoreProgressHandler)progressHandler completionHandler:(HBCoreCompletionHandler)completionHandler
{
NSAssert(self.state == HBStateIdle, @"[HBCore encodeJob:] called while another scan or encode already in progress");
NSAssert(job, @"[HBCore encodeJob:] called with nil job");
@end
-NS_ASSUME_NONNULL_END
\ No newline at end of file
+NS_ASSUME_NONNULL_END
+
#import <Cocoa/Cocoa.h>
+NS_ASSUME_NONNULL_BEGIN
+
@interface HBDockTextField : NSTextField
@property (nonatomic, copy) NSString *textToDisplay;
- (void)changeGradientColors:(NSColor *)startColor endColor:(NSColor *)endColor;
@end
+
+NS_ASSUME_NONNULL_END
+
#import <Cocoa/Cocoa.h>
+NS_ASSUME_NONNULL_BEGIN
+
@interface HBDockTile : NSObject
- (instancetype)init NS_UNAVAILABLE;
- (void)updateDockIcon:(double)progress hours:(NSInteger)hours minutes:(NSInteger)minutes seconds:(NSInteger)seconds;
@end
+
+NS_ASSUME_NONNULL_END
+
#import <Cocoa/Cocoa.h>
#import "HBHUD.h"
+NS_ASSUME_NONNULL_BEGIN
+
@protocol HBEncodingProgressHUDControllerDelegate <NSObject>
- (void)cancelEncoding;
@property (nonatomic, nullable, assign) id<HBEncodingProgressHUDControllerDelegate> delegate;
-@property (nonatomic, nonnull) NSString *info;
+@property (nonatomic) NSString *info;
@property (nonatomic) double progress;
@end
+
+NS_ASSUME_NONNULL_END
+
@interface HBEncodingProgressHUDController ()
-@property (weak) IBOutlet NSProgressIndicator *progressIndicator;
-@property (weak) IBOutlet NSTextField *infoLabel;
+@property (nonatomic, weak) IBOutlet NSProgressIndicator *progressIndicator;
+@property (nonatomic, weak) IBOutlet NSTextField *infoLabel;
@end
@interface HBExceptionAlertController : NSWindowController
// Properties are used by bindings
-@property (copy) NSString *exceptionMessage;
-@property (copy) NSAttributedString *exceptionBacktrace;
+@property (nonatomic, copy) NSString *exceptionMessage;
+@property (nonatomic, copy) NSAttributedString *exceptionBacktrace;
- (IBAction)btnCrashClicked:(id)sender;
- (IBAction)btnContinueClicked:(id)sender;
- (id)transformedValue:(id)value
{
- return [[self.dict allKeysForObject:value] firstObject];
+ if (value)
+ {
+ return [[self.dict allKeysForObject:value] firstObject];
+ }
+ else
+ {
+ return nil;
+ }
}
+ (BOOL)allowsReverseTransformation
@class HBFilters;
+NS_ASSUME_NONNULL_BEGIN
+
@interface HBFiltersViewController : NSViewController
@property (nonatomic, readwrite, weak) HBFilters *filters;
@end
+
+NS_ASSUME_NONNULL_END
+
#import <Foundation/Foundation.h>
-CGImageRef CreateScaledCGImageFromCGImage(CGImageRef image, CGFloat thumbnailHeight);
-CGImageRef CGImageRotated(CGImageRef imgRef, CGFloat angle, BOOL flipped) CF_RETURNS_RETAINED;
+CF_ASSUME_NONNULL_BEGIN
+
+CGImageRef __nullable CreateScaledCGImageFromCGImage(CGImageRef image, CGFloat thumbnailHeight);
+CGImageRef __nullable CGImageRotated(CGImageRef imgRef, CGFloat angle, BOOL flipped) CF_RETURNS_RETAINED;
CGColorSpaceRef copyColorSpace(int primaries, int transfer, int matrix);
+
+CF_ASSUME_NONNULL_END
+
-//
-// HBJob+HBJob_Private.h
-// HandBrake
-//
-// Created by Damiano Galassi on 29/10/16.
-//
-//
+/* HBJob+HBJob_Private.h $
+
+ This file is part of the HandBrake source code.
+ Homepage: <http://handbrake.fr/>.
+ It may be used under the terms of the GNU General Public License. */
#import <HandBrakeKit/HandBrakeKit.h>
#import "HBSecurityAccessToken.h"
+NS_ASSUME_NONNULL_BEGIN
+
@interface HBJob (Private) <HBSecurityScope>
@end
@end
+NS_ASSUME_NONNULL_END
+
_chapterTitles = [title.chapters copy];
+ _presetName = @"";
+
[self applyPreset:preset];
}
*/
@property (nonatomic, readwrite) BOOL isDragginEnabled;
-@property (unsafe_unretained) IBOutlet NSTableView *tableView;
+@property (nonatomic, unsafe_unretained) IBOutlet NSTableView *tableView;
@end
@implementation HBMutablePreset
-- (void)setObject:(id)obj forKey:(NSString *)key;
+- (void)setObject:(id)obj forKey:(NSString *)key
{
self.content[key] = obj;
}
NSDateFormatter *_formatter;
}
-- (nullable instancetype)initWithFileURL:(NSURL *)url;
+- (nullable instancetype)initWithFileURL:(NSURL *)url
{
self = [super init];
if (self)
@class HBPicture;
+NS_ASSUME_NONNULL_BEGIN
+
@interface HBPictureController : NSWindowController <NSWindowDelegate>
@property (nonatomic, readwrite, strong) HBPicture *picture;
@property (nonatomic, readwrite, assign) NSWindowController *previewController;
@end
+
+NS_ASSUME_NONNULL_END
+
@interface HBPictureHUDController ()
-@property (weak) IBOutlet NSTextField *scaleLabel;
-@property (weak) IBOutlet NSTextField *infoLabel;
+@property (nonatomic, weak) IBOutlet NSTextField *scaleLabel;
+@property (nonatomic, weak) IBOutlet NSTextField *infoLabel;
-@property (weak) IBOutlet NSSlider *slider;
+@property (nonatomic, weak) IBOutlet NSSlider *slider;
-@property (weak) IBOutlet NSPopUpButton *durationPopUp;
-@property (weak) IBOutlet NSButton *scaleToScreenButton;
+@property (nonatomic, weak) IBOutlet NSPopUpButton *durationPopUp;
+@property (nonatomic, weak) IBOutlet NSButton *scaleToScreenButton;
-@property (weak) IBOutlet NSTextField *durationLabel;
-@property (weak) IBOutlet NSTextField *durationUnitLabel;
+@property (nonatomic, weak) IBOutlet NSTextField *durationLabel;
+@property (nonatomic, weak) IBOutlet NSTextField *durationUnitLabel;
@property (nonatomic) BOOL fitToView;
@property (nonatomic) BOOL ignoreUpdates;
@class HBPicture;
+NS_ASSUME_NONNULL_BEGIN
+
@interface HBPictureViewController : NSViewController
@property (nonatomic, readwrite, weak) HBPicture *picture;
@end
+
+NS_ASSUME_NONNULL_END
+
@interface HBPictureViewController ()
-@property (weak) IBOutlet NSStepper *widthStepper;
-@property (weak) IBOutlet NSStepper *heightStepper;
+@property (nonatomic, weak) IBOutlet NSStepper *widthStepper;
+@property (nonatomic, weak) IBOutlet NSStepper *heightStepper;
@property (nonatomic, readwrite) NSColor *labelColor;
@end
-NS_ASSUME_NONNULL_END
\ No newline at end of file
+NS_ASSUME_NONNULL_END
+
#import "HBPlayer.h"
#import "HBHUD.h"
+NS_ASSUME_NONNULL_BEGIN
+
@protocol HBPlayerHUDControllerDelegate <NSObject>
- (void)stopPlayer;
@interface HBPlayerHUDController : NSViewController <HBHUD>
@property (nonatomic, nullable, assign) id<HBPlayerHUDControllerDelegate> delegate;
-
@property (nonatomic, nullable) id<HBPlayer> player;
@end
+
+NS_ASSUME_NONNULL_END
+
@interface HBPlayerHUDController ()
-@property (weak) IBOutlet NSButton *playButton;
-@property (weak) IBOutlet NSSlider *slider;
+@property (nonatomic, weak) IBOutlet NSButton *playButton;
+@property (nonatomic, weak) IBOutlet NSSlider *slider;
-@property (weak) IBOutlet NSSlider *volumeSlider;
+@property (nonatomic, weak) IBOutlet NSSlider *volumeSlider;
-@property (weak) IBOutlet NSTextField *currentTimeLabel;
-@property (weak) IBOutlet NSTextField *remaingTimeLabel;
+@property (nonatomic, weak) IBOutlet NSTextField *currentTimeLabel;
+@property (nonatomic, weak) IBOutlet NSTextField *remaingTimeLabel;
-@property (weak) IBOutlet NSPopUpButton *tracksSelection;
+@property (nonatomic, weak) IBOutlet NSPopUpButton *tracksSelection;
@property (nonatomic, readwrite) id rateObserver;
@property (nonatomic, readwrite) id periodicObserver;
return YES;
}
-- (BOOL)HB_scrollWheel:(NSEvent *)theEvent;
+- (BOOL)HB_scrollWheel:(NSEvent *)theEvent
{
if (theEvent.deltaY < 0)
{
slider.maxValue = duration;
}
-- (NSString *)_timeToString:(NSTimeInterval)timeInSeconds negative:(BOOL)negative;
+- (NSString *)_timeToString:(NSTimeInterval)timeInSeconds negative:(BOOL)negative
{
UInt16 seconds = (UInt16)fmod(timeInSeconds, 60.0);
UInt16 minutes = (UInt16)fmod(timeInSeconds / 60.0, 60.0);
@end
-NS_ASSUME_NONNULL_END
\ No newline at end of file
+NS_ASSUME_NONNULL_END
+
IBOutlet NSTextField * fSendEncodeToAppField;
}
-@property (unsafe_unretained) IBOutlet NSTokenField *formatTokenField;
-@property (unsafe_unretained) IBOutlet NSTokenField *builtInTokenField;
+@property (nonatomic, unsafe_unretained) IBOutlet NSTokenField *formatTokenField;
+@property (nonatomic, unsafe_unretained) IBOutlet NSTokenField *builtInTokenField;
@property (nonatomic, readonly, strong) NSArray *buildInFormatTokens;
@property (nonatomic, strong) NSArray *matches;
return self;
}
-- (instancetype)initWithName:(NSString *)title content:(NSDictionary *)content builtIn:(BOOL)builtIn;
+- (instancetype)initWithName:(NSString *)title content:(NSDictionary *)content builtIn:(BOOL)builtIn
{
self = [self init];
if (self)
return self;
}
-- (instancetype)initWithCategoryName:(NSString *)title builtIn:(BOOL)builtIn;
+- (instancetype)initWithCategoryName:(NSString *)title builtIn:(BOOL)builtIn
{
self = [self init];
if (self)
return self;
}
-- (nullable instancetype)initWithContentsOfURL:(NSURL *)url error:(NSError **)outError
+- (nullable instancetype)initWithContentsOfURL:(NSURL *)url error:(NSError * __autoreleasing *)outError
{
NSParameterAssert(url);
return output;
}
-- (BOOL)writeToURL:(NSURL *)url atomically:(BOOL)atomically format:(HBPresetFormat)format removeRoot:(BOOL)removeRoot;
+- (BOOL)writeToURL:(NSURL *)url atomically:(BOOL)atomically format:(HBPresetFormat)format removeRoot:(BOOL)removeRoot
{
BOOL success = NO;
NSArray *presetList;
HBPresetLoadingResultFailed
};
-- (NSDictionary *)dictionaryWithPresetsAtURL:(NSURL *)url backup:(BOOL)backup result:(HBPresetLoadingResult *)result;
+- (NSDictionary *)dictionaryWithPresetsAtURL:(NSURL *)url backup:(BOOL)backup result:(HBPresetLoadingResult *)result
{
NSData *presetData = [[NSData alloc] initWithContentsOfURL:url];
return nil;
}
-- (void)loadPresetsFromURL:(NSURL *)url;
+- (void)loadPresetsFromURL:(NSURL *)url
{
HBPresetLoadingResult result;
NSDictionary *presetsDict;
@import HandBrakeKit;
+NS_ASSUME_NONNULL_BEGIN
+
@interface HBPresetsMenuBuilder : NSObject
@property (nonatomic, readonly) NSMenu *menu;
- (void)build;
@end
+
+NS_ASSUME_NONNULL_END
+
@class HBPicture;
@class HBController;
+NS_ASSUME_NONNULL_BEGIN
+
@interface HBPreviewController : NSWindowController <NSWindowDelegate>
-@property (nonatomic, strong) HBPreviewGenerator *generator;
-@property (nonatomic, strong) HBPicture *picture;
+@property (nonatomic, strong, nullable) HBPreviewGenerator *generator;
+@property (nonatomic, strong, nullable) HBPicture *picture;
@property (nonatomic, assign) HBController *documentController;
@end
+
+NS_ASSUME_NONNULL_END
@property (nonatomic) HBPictureController *pictureSettingsWindow;
@property (nonatomic) NSPoint windowCenterPoint;
-@property (weak) IBOutlet HBPreviewView *previewView;
+@property (nonatomic, weak) IBOutlet HBPreviewView *previewView;
@end
[self switchStateToHUD:self.pictureHUD];
}
-- (void)showAlert:(NSURL *)fileURL;
+- (void)showAlert:(NSURL *)fileURL
{
NSAlert *alert = [[NSAlert alloc] init];
alert.messageText = NSLocalizedString(@"HandBrake can't open the preview.", @"Preview -> live preview alert message");
}];
}
-- (void)setUpPlaybackOfURL:(NSURL *)fileURL playerClass:(Class)class;
+- (void)setUpPlaybackOfURL:(NSURL *)fileURL playerClass:(Class)class
{
NSArray<Class> *availablePlayerClasses = @[[HBAVPlayer class]];
- (void)keyDown:(NSEvent *)event
{
- if ([self.currentHUD HB_keyDown:event] == NO)
+ if (self.generator && [self.currentHUD HB_keyDown:event] == NO)
{
[super keyDown:event];
}
- (void)scrollWheel:(NSEvent *)event
{
- if ([self.currentHUD HB_scrollWheel:event] == NO)
+ if (self.generator && [self.currentHUD HB_scrollWheel:event] == NO)
{
[super scrollWheel:event];
}
* @param index picture index in title.
* @param duration the duration in seconds of the preview movie.
*/
-- (BOOL) createMovieAsyncWithImageAtIndex: (NSUInteger) index duration: (NSUInteger) seconds;
+- (BOOL) createMovieAsyncWithImageAtIndex: (NSUInteger) index duration: (NSUInteger) seconds
{
// return if an encoding if already started.
if (self.core || index >= self.imagesCount)
return resultSize;
}
-#pragma MARK: - Accessibility
+#pragma mark - Accessibility
- (BOOL)isAccessibilityElement
{
@class HBPreviewGenerator;
@class HBPreviewController;
+NS_ASSUME_NONNULL_BEGIN
+
@interface HBPreviewViewController : NSViewController
@property (nonatomic, readwrite, weak, nullable) HBPreviewGenerator *generator;
- (void)update;
@end
+
+NS_ASSUME_NONNULL_END
+
[self updatePicture];
}
-#pragma MARK: - HUD
+#pragma mark - HUD
- (void)mouseEntered:(NSEvent *)theEvent
{
}
}
-#pragma MARK: - Preview index
+#pragma mark - Preview index
- (void)setSelectedIndex:(NSInteger)selectedIndex
{
#import "HBDistributedArray.h"
#import "HBQueueItem.h"
-#import "HBJobOutputFileWriter.h"
NS_ASSUME_NONNULL_BEGIN
#import "HBPreferencesKeys.h"
#import "NSArray+HBAdditions.h"
+#import "HBJobOutputFileWriter.h"
static void *HBQueueContext = &HBQueueContext;
[self addJobs:@[item]];
}
-- (void)addJobs:(NSArray<HBJob *> *)jobs;
+- (void)addJobs:(NSArray<HBJob *> *)jobs
{
NSParameterAssert(jobs);
[self.items commit];
}
-- (void)completedItem:(HBQueueItem *)item result:(HBCoreResult)result;
+- (void)completedItem:(HBQueueItem *)item result:(HBCoreResult)result
{
NSParameterAssert(item);
[self.items beginTransaction];
@interface HBQueueController () <NSUserNotificationCenterDelegate, HBQueueTableViewControllerDelegate, HBQueueDetailsViewControllerDelegate>
-@property (weak) IBOutlet NSSplitView *splitView;
+@property (nonatomic, weak) IBOutlet NSSplitView *splitView;
@property (nonatomic) NSSplitViewController *splitViewController;
@property (nonatomic) HBQueueTableViewController *tableViewController;
@property (nonatomic) NSViewController *containerViewController;
return item.state == HBQueueItemStateWorking;
}];
- if ([workingItems containsObject:self.queue.currentItem])
+ if (self.queue.currentItem && [workingItems containsObject:self.queue.currentItem])
{
NSString *alertTitle = [NSString stringWithFormat:NSLocalizedString(@"Stop This Encode and Remove It?", @"Queue Stop Alert -> stop and remove message")];
return nil;
}
-- (void)_touchBar_updateButtonsState;
+- (void)_touchBar_updateButtonsState
{
NSButton *ripButton = (NSButton *)[[self.touchBar itemForIdentifier:HBTouchBarRip] view];
NSButton *pauseButton = (NSButton *)[[self.touchBar itemForIdentifier:HBTouchBarPause] view];
@interface HBQueueInfoViewController ()
-@property (weak) IBOutlet NSView *statisticsHeader;
-@property (weak) IBOutlet NSTextField *statisticsLabel;
-@property (weak) IBOutlet NSTextField *summaryLabel;
-@property (weak) IBOutlet NSScrollView *scrollView;
+@property (nonatomic, weak) IBOutlet NSView *statisticsHeader;
+@property (nonatomic, weak) IBOutlet NSTextField *statisticsLabel;
+@property (nonatomic, weak) IBOutlet NSTextField *summaryLabel;
+@property (nonatomic, weak) IBOutlet NSScrollView *scrollView;
-@property (weak) id<HBQueueDetailsViewControllerDelegate> delegate;
+@property (nonatomic, weak) id<HBQueueDetailsViewControllerDelegate> delegate;
@property (nonatomic) BOOL canReset;
{
[self resumedAtDate:endedDate];
}
- self.encodeDuration = [self.endedDate timeIntervalSinceDate:self.startedDate];
- self.encodeDuration -= self.pauseDuration;
+ if (endedDate && self.startedDate)
+ {
+ self.encodeDuration = [self.endedDate timeIntervalSinceDate:self.startedDate];
+ self.encodeDuration -= self.pauseDuration;
+ }
[self.completeOutputURL removeCachedResourceValueForKey:NSURLFileSizeKey];
NSDictionary<NSURLResourceKey, id> *values = [self.completeOutputURL resourceValuesForKeys:@[NSURLFileSizeKey] error:NULL];
@interface HBQueueMultiSelectionViewController ()
-@property (weak) IBOutlet NSTextField *label;
+@property (nonatomic, weak) IBOutlet NSTextField *label;
@end
@property (nonatomic, weak, readonly) HBQueue *queue;
@property (nonatomic) NSArray<HBQueueItem *> *dragNodesArray;
-@property (strong) id<HBQueueTableViewControllerDelegate> delegate;
+@property (nonatomic, strong) id<HBQueueTableViewControllerDelegate> delegate;
-@property (weak) IBOutlet HBTableView *tableView;
+@property (nonatomic, weak) IBOutlet HBTableView *tableView;
@end
[self removeSelectedQueueItem:tableView];
}
-- (BOOL)tableView:(NSTableView *)tableView writeRowsWithIndexes:(NSIndexSet *)rowIndexes toPasteboard:(NSPasteboard *)pboard;
+- (BOOL)tableView:(NSTableView *)tableView writeRowsWithIndexes:(NSIndexSet *)rowIndexes toPasteboard:(NSPasteboard *)pboard
{
NSArray<HBQueueItem *> *items = [self.queue.items objectsAtIndexes:rowIndexes];
// Dragging is only allowed of the pending items.
// We do not let the user drop a pending item before or *above*
// already finished or currently encoding items.
- NSInteger encodingRow = [self.queue.items indexOfObject:self.queue.currentItem];
+ NSInteger encodingRow = self.queue.currentItem ? [self.queue.items indexOfObject:self.queue.currentItem] : NSNotFound;
if (encodingRow != NSNotFound && row <= encodingRow)
{
return NSDragOperationNone;
@implementation HBSecurityAccessToken
-- (instancetype)initWithObject:(id<HBSecurityScope>)object;
+- (instancetype)initWithObject:(id<HBSecurityScope>)object
{
self = [super init];
if (self)
#pragma mark - Data Source
-- (NSDictionary<NSString *, id> *)sourceTrackAtIndex:(NSUInteger)idx;
+- (NSDictionary<NSString *, id> *)sourceTrackAtIndex:(NSUInteger)idx
{
return self.sourceTracks[idx];
}
#pragma mark - Delegate
-- (void)track:(HBSubtitlesTrack *)track didChangeSourceFrom:(NSUInteger)oldSourceIdx;
+- (void)track:(HBSubtitlesTrack *)track didChangeSourceFrom:(NSUInteger)oldSourceIdx
{
// If the source was changed to None, remove the track
if (track.sourceTrackIdx == NONE_TRACK_INDEX)
return self.tracks[index];
}
-- (void)insertObject:(HBSubtitlesTrack *)track inTracksAtIndex:(NSUInteger)index;
+- (void)insertObject:(HBSubtitlesTrack *)track inTracksAtIndex:(NSUInteger)index
{
[[self.undo prepareWithInvocationTarget:self] removeObjectFromTracksAtIndex:index];
[self.tracks insertObject:track atIndex:index];
@class HBSubtitles;
-/**
- * HBSubtitlesController
- */
+NS_ASSUME_NONNULL_BEGIN
+
@interface HBSubtitlesController : NSViewController
@property (nonatomic, readwrite, weak) HBSubtitles *subtitles;
@end
+
+NS_ASSUME_NONNULL_END
+
@class HBSubtitlesDefaults;
+NS_ASSUME_NONNULL_BEGIN
+
@interface HBSubtitlesDefaultsController : NSWindowController
- (instancetype)initWithSettings:(HBSubtitlesDefaults *)settings;
@end
+
+NS_ASSUME_NONNULL_END
+
@property (nonatomic, readonly) HBSubtitlesDefaults *settings;
@property (nonatomic, readonly) HBLanguagesSelection *languagesList;
-@property (unsafe_unretained) IBOutlet HBLanguageArrayController *tableController;
-@property (unsafe_unretained) IBOutlet NSButton *showAllButton;
+@property (nonatomic, unsafe_unretained) IBOutlet HBLanguageArrayController *tableController;
+@property (nonatomic, unsafe_unretained) IBOutlet NSButton *showAllButton;
@end
- (void)setIsoLanguage:(NSString *)isoLanguage
{
- if (![isoLanguage isEqualToString:_isoLanguage])
+ if (_isoLanguage != isoLanguage || (_isoLanguage && ![isoLanguage isEqualToString:_isoLanguage]))
{
[[self.undo prepareWithInvocationTarget:self] setIsoLanguage:_isoLanguage];
}
- (void)setCharCode:(NSString *)charCode
{
- if (![charCode isEqualToString:_charCode])
+ if (_charCode != charCode || (_charCode && ![charCode isEqualToString:_charCode]))
{
[[self.undo prepareWithInvocationTarget:self] setCharCode:_charCode];
}
#import <Cocoa/Cocoa.h>
#import "HBPreviewGenerator.h"
+NS_ASSUME_NONNULL_BEGIN
+
@interface HBThumbnailItemView : NSScrubberItemView
-@property (nonatomic) NSImage *thumbnail;
+@property (nonatomic, nullable) NSImage *thumbnail;
@property (nonatomic) NSUInteger thumbnailIndex;
@property (nonatomic, weak) HBPreviewGenerator *generator;
-
@end
+
+NS_ASSUME_NONNULL_END
+
@interface HBThumbnailItemView ()
-@property (strong) NSImageView *imageView;
+@property (nonatomic, strong) NSImageView *imageView;
@end
@implementation HBTitleSelectionController
-- (instancetype)initWithTitles:(NSArray<HBTitle *> *)titles presetName:(NSString *)presetName delegate:(id<HBTitleSelectionDelegate>)delegate;
+- (instancetype)initWithTitles:(NSArray<HBTitle *> *)titles presetName:(NSString *)presetName delegate:(id<HBTitleSelectionDelegate>)delegate
{
self = [super initWithWindowNibName:@"HBTitleSelection"];
if (self)
#import <Cocoa/Cocoa.h>
+NS_ASSUME_NONNULL_BEGIN
+
@interface HBToolbarBadgedItem : NSToolbarItem
@property (nonatomic, copy) NSString *badgeValue;
@property (nonatomic, copy) NSColor *badgeFillColor;
@end
+
+NS_ASSUME_NONNULL_END
+
@implementation HBVideo
-- (instancetype)initWithJob:(HBJob *)job;
+- (instancetype)initWithJob:(HBJob *)job
{
self = [super init];
if (self) {
_profile = @"auto";
_level = @"auto";
+ _videoOptionExtra = @"";
+
[self updateQualityBounds];
_notificationsEnabled = YES;
@class HBVideo;
-/**
- * HBVideoController
- */
+NS_ASSUME_NONNULL_BEGIN
+
@interface HBVideoController : NSViewController
@property (nonatomic, readwrite, weak) HBVideo *video;
@end
+
+NS_ASSUME_NONNULL_END
+
A916C9961C8449BE00C7B560 /* HBJobOutputFileWriter.m in Sources */ = {isa = PBXBuildFile; fileRef = A91AFD0E1A949472009BECED /* HBJobOutputFileWriter.m */; };
A916C9971C8449CA00C7B560 /* HBAudioDefaultsController.m in Sources */ = {isa = PBXBuildFile; fileRef = A932E26E198833920047D13E /* HBAudioDefaultsController.m */; };
A916C9981C8449DB00C7B560 /* HBTitleSelectionController.m in Sources */ = {isa = PBXBuildFile; fileRef = A9C183941A716B8F00C897C2 /* HBTitleSelectionController.m */; };
- A916C9991C8449E200C7B560 /* main.mm in Sources */ = {isa = PBXBuildFile; fileRef = 273F20BD14ADC09F0021BE6D /* main.mm */; };
+ A916C9991C8449E200C7B560 /* main.m in Sources */ = {isa = PBXBuildFile; fileRef = 273F20BD14ADC09F0021BE6D /* main.m */; };
A916C99B1C844A0800C7B560 /* HBTableView.m in Sources */ = {isa = PBXBuildFile; fileRef = A9EA43671A2210C400785E95 /* HBTableView.m */; };
A919430D1FB5E2FE001E9BB0 /* HBSummaryViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = A919430B1FB5E2FE001E9BB0 /* HBSummaryViewController.m */; };
A91943111FB5E39E001E9BB0 /* HBSummaryViewController.xib in Resources */ = {isa = PBXBuildFile; fileRef = A919430F1FB5E39E001E9BB0 /* HBSummaryViewController.xib */; };
273F20A414ADBE670021BE6D /* HBPreviewController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = HBPreviewController.m; sourceTree = "<group>"; };
273F20A914ADBE670021BE6D /* HBPictureController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = HBPictureController.h; sourceTree = "<group>"; };
273F20AA14ADBE670021BE6D /* HBPictureController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = HBPictureController.m; sourceTree = "<group>"; };
- 273F20BD14ADC09F0021BE6D /* main.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = main.mm; sourceTree = "<group>"; };
+ 273F20BD14ADC09F0021BE6D /* main.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = main.m; sourceTree = "<group>"; };
275916DA14B2AB27007211E9 /* native.xcconfig */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.xcconfig; path = native.xcconfig; sourceTree = "<group>"; };
277EFE8D17ED5628001D4A6A /* supplemental.xcconfig */ = {isa = PBXFileReference; lastKnownFileType = text.xcconfig; path = supplemental.xcconfig; sourceTree = "<group>"; };
277EFE9217ED799E001D4A6A /* libfdk-aac.a */ = {isa = PBXFileReference; lastKnownFileType = archive.ar; name = "libfdk-aac.a"; path = "external/contrib/lib/libfdk-aac.a"; sourceTree = BUILT_PRODUCTS_DIR; };
A95121E51B5F7BE700FD773D /* NSArray+HBAdditions.m */,
A943873F22ED911B005F701B /* HBJob+HBAdditions.h */,
A943874022ED911B005F701B /* HBJob+HBAdditions.m */,
- 273F20BD14ADC09F0021BE6D /* main.mm */,
+ 273F20BD14ADC09F0021BE6D /* main.m */,
);
name = Others;
sourceTree = "<group>";
A954010322FF397000F83A5F /* HBRedirect.m in Sources */,
A95BA161220CA5DB00A2F9F9 /* HBDistributedArray.m in Sources */,
A916C99B1C844A0800C7B560 /* HBTableView.m in Sources */,
- A916C9991C8449E200C7B560 /* main.mm in Sources */,
+ A916C9991C8449E200C7B560 /* main.m in Sources */,
A973E10C216E74E900D498EC /* HBThumbnailItemView.m in Sources */,
A916C9981C8449DB00C7B560 /* HBTitleSelectionController.m in Sources */,
A943874122ED911B005F701B /* HBJob+HBAdditions.m in Sources */,
CLANG_ANALYZER_LOCALIZABILITY_EMPTY_CONTEXT = YES;
CLANG_ANALYZER_LOCALIZABILITY_NONLOCALIZED = YES;
CLANG_ANALYZER_NONNULL = YES;
+ CLANG_ANALYZER_SECURITY_FLOATLOOPCOUNTER = YES;
+ CLANG_ANALYZER_SECURITY_INSECUREAPI_RAND = YES;
+ CLANG_ANALYZER_SECURITY_INSECUREAPI_STRCPY = YES;
CLANG_ENABLE_MODULES = YES;
+ CLANG_UNDEFINED_BEHAVIOR_SANITIZER_NULLABILITY = YES;
+ CLANG_WARN_ASSIGN_ENUM = YES;
CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES;
CLANG_WARN_BOOL_CONVERSION = YES;
CLANG_WARN_COMMA = YES;
CLANG_WARN_INFINITE_RECURSION = YES;
CLANG_WARN_INT_CONVERSION = YES;
CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES;
- CLANG_WARN_OBJC_IMPLICIT_ATOMIC_PROPERTIES = NO;
+ CLANG_WARN_OBJC_IMPLICIT_ATOMIC_PROPERTIES = YES;
CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES;
CLANG_WARN_OBJC_LITERAL_CONVERSION = YES;
CLANG_WARN_RANGE_LOOP_ANALYSIS = YES;
- CLANG_WARN_STRICT_PROTOTYPES = NO;
+ CLANG_WARN_SEMICOLON_BEFORE_METHOD_BODY = YES;
+ CLANG_WARN_STRICT_PROTOTYPES = YES;
CLANG_WARN_SUSPICIOUS_MOVE = YES;
CLANG_WARN_UNREACHABLE_CODE = YES;
CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
"DEBUG=1",
"$(inherited)",
);
+ GCC_TREAT_IMPLICIT_FUNCTION_DECLARATIONS_AS_ERRORS = YES;
+ GCC_TREAT_INCOMPATIBLE_POINTER_TYPE_WARNINGS_AS_ERRORS = YES;
GCC_VERSION = com.apple.compilers.llvm.clang.1_0;
GCC_WARN_64_TO_32_BIT_CONVERSION = YES;
GCC_WARN_ABOUT_MISSING_FIELD_INITIALIZERS = YES;
+ GCC_WARN_ABOUT_MISSING_NEWLINE = YES;
GCC_WARN_ABOUT_MISSING_PROTOTYPES = YES;
GCC_WARN_ABOUT_RETURN_TYPE = YES;
GCC_WARN_FOUR_CHARACTER_CONSTANTS = YES;
GCC_WARN_SHADOW = YES;
GCC_WARN_UNDECLARED_SELECTOR = YES;
GCC_WARN_UNINITIALIZED_AUTOS = YES;
+ GCC_WARN_UNKNOWN_PRAGMAS = YES;
GCC_WARN_UNUSED_FUNCTION = YES;
GCC_WARN_UNUSED_LABEL = YES;
GCC_WARN_UNUSED_VARIABLE = YES;
HBKitLocalizedString,
);
MACOSX_DEPLOYMENT_TARGET = 10.11;
- OTHER_CFLAGS = "";
+ OTHER_CFLAGS = "-Wno-duplicate-decl-specifier ";
OTHER_LDFLAGS = (
"-filelist",
"$(EXTERNAL_BUILD)/macosx/osl.filelist.txt",
CLANG_ANALYZER_LOCALIZABILITY_EMPTY_CONTEXT = YES;
CLANG_ANALYZER_LOCALIZABILITY_NONLOCALIZED = YES;
CLANG_ANALYZER_NONNULL = YES;
+ CLANG_ANALYZER_SECURITY_FLOATLOOPCOUNTER = YES;
+ CLANG_ANALYZER_SECURITY_INSECUREAPI_RAND = YES;
+ CLANG_ANALYZER_SECURITY_INSECUREAPI_STRCPY = YES;
CLANG_ENABLE_MODULES = YES;
+ CLANG_UNDEFINED_BEHAVIOR_SANITIZER_NULLABILITY = YES;
+ CLANG_WARN_ASSIGN_ENUM = YES;
CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES;
CLANG_WARN_BOOL_CONVERSION = YES;
CLANG_WARN_COMMA = YES;
CLANG_WARN_INFINITE_RECURSION = YES;
CLANG_WARN_INT_CONVERSION = YES;
CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES;
- CLANG_WARN_OBJC_IMPLICIT_ATOMIC_PROPERTIES = NO;
+ CLANG_WARN_OBJC_IMPLICIT_ATOMIC_PROPERTIES = YES;
CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES;
CLANG_WARN_OBJC_LITERAL_CONVERSION = YES;
CLANG_WARN_RANGE_LOOP_ANALYSIS = YES;
- CLANG_WARN_STRICT_PROTOTYPES = NO;
+ CLANG_WARN_SEMICOLON_BEFORE_METHOD_BODY = YES;
+ CLANG_WARN_STRICT_PROTOTYPES = YES;
CLANG_WARN_SUSPICIOUS_MOVE = YES;
CLANG_WARN_UNREACHABLE_CODE = YES;
CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
GCC_C_LANGUAGE_STANDARD = gnu99;
GCC_ENABLE_OBJC_EXCEPTIONS = YES;
GCC_NO_COMMON_BLOCKS = YES;
+ GCC_TREAT_IMPLICIT_FUNCTION_DECLARATIONS_AS_ERRORS = YES;
+ GCC_TREAT_INCOMPATIBLE_POINTER_TYPE_WARNINGS_AS_ERRORS = YES;
GCC_VERSION = com.apple.compilers.llvm.clang.1_0;
GCC_WARN_64_TO_32_BIT_CONVERSION = YES;
GCC_WARN_ABOUT_MISSING_FIELD_INITIALIZERS = YES;
+ GCC_WARN_ABOUT_MISSING_NEWLINE = YES;
GCC_WARN_ABOUT_MISSING_PROTOTYPES = YES;
GCC_WARN_ABOUT_RETURN_TYPE = YES;
GCC_WARN_FOUR_CHARACTER_CONSTANTS = YES;
GCC_WARN_SHADOW = YES;
GCC_WARN_UNDECLARED_SELECTOR = YES;
GCC_WARN_UNINITIALIZED_AUTOS = YES;
+ GCC_WARN_UNKNOWN_PRAGMAS = YES;
GCC_WARN_UNUSED_FUNCTION = YES;
GCC_WARN_UNUSED_LABEL = YES;
GCC_WARN_UNUSED_VARIABLE = YES;
HBKitLocalizedString,
);
MACOSX_DEPLOYMENT_TARGET = 10.11;
- OTHER_CFLAGS = "";
+ OTHER_CFLAGS = "-Wno-duplicate-decl-specifier ";
OTHER_LDFLAGS = (
"-filelist",
"$(EXTERNAL_BUILD)/macosx/osl.filelist.txt",
CLANG_ANALYZER_LOCALIZABILITY_EMPTY_CONTEXT = YES;
CLANG_ANALYZER_LOCALIZABILITY_NONLOCALIZED = YES;
CLANG_ANALYZER_NONNULL = YES;
+ CLANG_ANALYZER_SECURITY_FLOATLOOPCOUNTER = YES;
+ CLANG_ANALYZER_SECURITY_INSECUREAPI_RAND = YES;
+ CLANG_ANALYZER_SECURITY_INSECUREAPI_STRCPY = YES;
CLANG_ENABLE_MODULES = YES;
+ CLANG_UNDEFINED_BEHAVIOR_SANITIZER_NULLABILITY = YES;
+ CLANG_WARN_ASSIGN_ENUM = YES;
CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES;
CLANG_WARN_BOOL_CONVERSION = YES;
CLANG_WARN_COMMA = YES;
CLANG_WARN_INFINITE_RECURSION = YES;
CLANG_WARN_INT_CONVERSION = YES;
CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES;
- CLANG_WARN_OBJC_IMPLICIT_ATOMIC_PROPERTIES = NO;
+ CLANG_WARN_OBJC_IMPLICIT_ATOMIC_PROPERTIES = YES;
CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES;
CLANG_WARN_OBJC_LITERAL_CONVERSION = YES;
CLANG_WARN_RANGE_LOOP_ANALYSIS = YES;
- CLANG_WARN_STRICT_PROTOTYPES = NO;
+ CLANG_WARN_SEMICOLON_BEFORE_METHOD_BODY = YES;
+ CLANG_WARN_STRICT_PROTOTYPES = YES;
CLANG_WARN_SUSPICIOUS_MOVE = YES;
CLANG_WARN_UNREACHABLE_CODE = YES;
CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
"$(inherited)",
"__SANDBOX_ENABLED__=1",
);
+ GCC_TREAT_IMPLICIT_FUNCTION_DECLARATIONS_AS_ERRORS = YES;
+ GCC_TREAT_INCOMPATIBLE_POINTER_TYPE_WARNINGS_AS_ERRORS = YES;
GCC_VERSION = com.apple.compilers.llvm.clang.1_0;
GCC_WARN_64_TO_32_BIT_CONVERSION = YES;
GCC_WARN_ABOUT_MISSING_FIELD_INITIALIZERS = YES;
+ GCC_WARN_ABOUT_MISSING_NEWLINE = YES;
GCC_WARN_ABOUT_MISSING_PROTOTYPES = YES;
GCC_WARN_ABOUT_RETURN_TYPE = YES;
GCC_WARN_FOUR_CHARACTER_CONSTANTS = YES;
GCC_WARN_SHADOW = YES;
GCC_WARN_UNDECLARED_SELECTOR = YES;
GCC_WARN_UNINITIALIZED_AUTOS = YES;
+ GCC_WARN_UNKNOWN_PRAGMAS = YES;
GCC_WARN_UNUSED_FUNCTION = YES;
GCC_WARN_UNUSED_LABEL = YES;
GCC_WARN_UNUSED_VARIABLE = YES;
HBKitLocalizedString,
);
MACOSX_DEPLOYMENT_TARGET = 10.11;
- OTHER_CFLAGS = "";
+ OTHER_CFLAGS = "-Wno-duplicate-decl-specifier ";
OTHER_LDFLAGS = (
"-filelist",
"$(EXTERNAL_BUILD)/macosx/osl.filelist.txt",
CLANG_ANALYZER_LOCALIZABILITY_EMPTY_CONTEXT = YES;
CLANG_ANALYZER_LOCALIZABILITY_NONLOCALIZED = YES;
CLANG_ANALYZER_NONNULL = YES;
+ CLANG_ANALYZER_SECURITY_FLOATLOOPCOUNTER = YES;
+ CLANG_ANALYZER_SECURITY_INSECUREAPI_RAND = YES;
+ CLANG_ANALYZER_SECURITY_INSECUREAPI_STRCPY = YES;
CLANG_ENABLE_MODULES = YES;
+ CLANG_UNDEFINED_BEHAVIOR_SANITIZER_NULLABILITY = YES;
+ CLANG_WARN_ASSIGN_ENUM = YES;
CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES;
CLANG_WARN_BOOL_CONVERSION = YES;
CLANG_WARN_COMMA = YES;
CLANG_WARN_INFINITE_RECURSION = YES;
CLANG_WARN_INT_CONVERSION = YES;
CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES;
- CLANG_WARN_OBJC_IMPLICIT_ATOMIC_PROPERTIES = NO;
+ CLANG_WARN_OBJC_IMPLICIT_ATOMIC_PROPERTIES = YES;
CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES;
CLANG_WARN_OBJC_LITERAL_CONVERSION = YES;
CLANG_WARN_RANGE_LOOP_ANALYSIS = YES;
+ CLANG_WARN_SEMICOLON_BEFORE_METHOD_BODY = YES;
CLANG_WARN_STRICT_PROTOTYPES = YES;
CLANG_WARN_SUSPICIOUS_MOVE = YES;
CLANG_WARN_UNREACHABLE_CODE = YES;
GCC_ENABLE_OBJC_EXCEPTIONS = YES;
GCC_NO_COMMON_BLOCKS = YES;
GCC_PREPROCESSOR_DEFINITIONS = "__SANDBOX_ENABLED__=1";
+ GCC_TREAT_IMPLICIT_FUNCTION_DECLARATIONS_AS_ERRORS = YES;
+ GCC_TREAT_INCOMPATIBLE_POINTER_TYPE_WARNINGS_AS_ERRORS = YES;
GCC_VERSION = com.apple.compilers.llvm.clang.1_0;
GCC_WARN_64_TO_32_BIT_CONVERSION = YES;
GCC_WARN_ABOUT_MISSING_FIELD_INITIALIZERS = YES;
+ GCC_WARN_ABOUT_MISSING_NEWLINE = YES;
GCC_WARN_ABOUT_MISSING_PROTOTYPES = YES;
GCC_WARN_ABOUT_RETURN_TYPE = YES;
GCC_WARN_FOUR_CHARACTER_CONSTANTS = YES;
GCC_WARN_SHADOW = YES;
GCC_WARN_UNDECLARED_SELECTOR = YES;
GCC_WARN_UNINITIALIZED_AUTOS = YES;
+ GCC_WARN_UNKNOWN_PRAGMAS = YES;
GCC_WARN_UNUSED_FUNCTION = YES;
GCC_WARN_UNUSED_LABEL = YES;
GCC_WARN_UNUSED_VARIABLE = YES;
HBKitLocalizedString,
);
MACOSX_DEPLOYMENT_TARGET = 10.11;
- OTHER_CFLAGS = "";
+ OTHER_CFLAGS = "-Wno-duplicate-decl-specifier ";
OTHER_LDFLAGS = (
"-filelist",
"$(EXTERNAL_BUILD)/macosx/osl.filelist.txt",
@import HandBrakeKit;
+NS_ASSUME_NONNULL_BEGIN
+
@protocol HBRemoteCoreProtocol
- (void)setDVDNav:(BOOL)enabled;
@end
+NS_ASSUME_NONNULL_END
+
#import <Foundation/Foundation.h>
#import "HBRemoteCoreProtocol.h"
+NS_ASSUME_NONNULL_BEGIN
+
@interface HandBrakeXPCService : NSObject <HBRemoteCoreProtocol>
- (instancetype)init NS_UNAVAILABLE;
- (instancetype)initWithConnection:(NSXPCConnection *)connection;
@end
+
+NS_ASSUME_NONNULL_END
+
});
}
- - (void)encodeJob:(HBJob *)job withReply:(void (^)(HBCoreResult))reply;
+ - (void)encodeJob:(HBJob *)job withReply:(void (^)(HBCoreResult))reply
{
dispatch_sync(_queue, ^{
void (^progressHandler)(HBState state, HBProgress progress, NSString *info) = ^(HBState state, HBProgress progress, NSString *info)
#import <Foundation/Foundation.h>
+NS_ASSUME_NONNULL_BEGIN
+
@interface NSArray (HBAdditions)
- (NSArray *)filteredArrayUsingBlock:(BOOL (^)(id object))block;
- (NSIndexSet *)indexesOfObjectsUsingBlock:(BOOL (^)(id object))block;
-@end
\ No newline at end of file
+@end
+
+NS_ASSUME_NONNULL_END
+
@interface NSJSONSerialization (HBAdditions)
-+ (nullable id)HB_JSONObjectWithUTF8String:(const char *)nullTerminatedCString options:(NSJSONReadingOptions)opt error:(NSError **)error;
-+ (nullable NSString *)HB_StringWithJSONObject:(id)obj options:(NSJSONWritingOptions)opt error:(NSError **)error;
++ (nullable id)HB_JSONObjectWithUTF8String:(const char *)nullTerminatedCString options:(NSJSONReadingOptions)opt error:(NSError * __autoreleasing *)error;
++ (nullable NSString *)HB_StringWithJSONObject:(id)obj options:(NSJSONWritingOptions)opt error:(NSError * __autoreleasing *)error;
@end
@implementation NSJSONSerialization (HBAdditions)
-+ (id)HB_JSONObjectWithUTF8String:(const char *)nullTerminatedCString options:(NSJSONReadingOptions)opt error:(NSError **)error;
++ (id)HB_JSONObjectWithUTF8String:(const char *)nullTerminatedCString options:(NSJSONReadingOptions)opt error:(NSError * __autoreleasing *)error
{
if (!nullTerminatedCString) {
return nil;
return result;
}
-+ (NSString *)HB_StringWithJSONObject:(id)obj options:(NSJSONWritingOptions)opt error:(NSError **)error
++ (NSString *)HB_StringWithJSONObject:(id)obj options:(NSJSONWritingOptions)opt error:(NSError * __autoreleasing *)error
{
NSData *data = [NSJSONSerialization dataWithJSONObject:obj options:opt error:error];
if (data)
return center;
}
-- (BOOL)HB_endEditing;
+- (BOOL)HB_endEditing
{
BOOL success;
NSRange selectedRange = NSMakeRange(0, 0);
return success;
}
-- (void)HB_forceEndEditing;
+- (void)HB_forceEndEditing
{
[self endEditingFor:nil];
}