<?xml version="1.0" encoding="UTF-8"?>
-<document type="com.apple.InterfaceBuilder3.Cocoa.XIB" version="3.0" toolsVersion="11762" systemVersion="16C67" targetRuntime="MacOSX.Cocoa" propertyAccessControl="none">
+<document type="com.apple.InterfaceBuilder3.Cocoa.XIB" version="3.0" toolsVersion="14295.6" targetRuntime="MacOSX.Cocoa" propertyAccessControl="none">
<dependencies>
<deployment identifier="macosx"/>
- <development version="7000" identifier="xcode"/>
- <plugIn identifier="com.apple.InterfaceBuilder.CocoaPlugin" version="11762"/>
+ <development version="8000" identifier="xcode"/>
+ <plugIn identifier="com.apple.InterfaceBuilder.CocoaPlugin" version="14295.6"/>
+ <capability name="documents saved in the Xcode 8 format" minToolsVersion="8.0"/>
</dependencies>
<objects>
<customObject id="-2" userLabel="File's Owner" customClass="HBOutputPanelController">
<scrollView horizontalLineScroll="0.0" horizontalPageScroll="0.0" verticalLineScroll="0.0" verticalPageScroll="0.0" hasHorizontalScroller="NO" usesPredominantAxisScrolling="NO" id="19">
<rect key="frame" x="-1" y="-1" width="380" height="441"/>
<autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
- <clipView key="contentView" id="mnc-sf-Cwe">
- <rect key="frame" x="1" y="1" width="363" height="439"/>
+ <clipView key="contentView" drawsBackground="NO" id="mnc-sf-Cwe">
+ <rect key="frame" x="1" y="1" width="378" height="439"/>
<autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
<subviews>
- <textView editable="NO" importsGraphics="NO" richText="NO" findStyle="bar" incrementalSearchingEnabled="YES" id="20">
+ <textView editable="NO" importsGraphics="NO" richText="NO" verticallyResizable="YES" findStyle="bar" incrementalSearchingEnabled="YES" allowsNonContiguousLayout="YES" id="20">
<rect key="frame" x="0.0" y="0.0" width="378" height="439"/>
<autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
- <color key="backgroundColor" white="1" alpha="1" colorSpace="calibratedWhite"/>
- <size key="minSize" width="363" height="439"/>
+ <color key="textColor" name="textColor" catalog="System" colorSpace="catalog"/>
+ <color key="backgroundColor" name="textBackgroundColor" catalog="System" colorSpace="catalog"/>
+ <size key="minSize" width="378" height="439"/>
<size key="maxSize" width="743" height="10000000"/>
- <color key="insertionPointColor" white="0.0" alpha="1" colorSpace="calibratedWhite"/>
+ <color key="insertionPointColor" name="textColor" catalog="System" colorSpace="catalog"/>
<connections>
<outlet property="delegate" destination="-2" id="21"/>
<outlet property="menu" destination="11" id="22"/>
</connections>
</textView>
</subviews>
- <color key="backgroundColor" white="1" alpha="1" colorSpace="calibratedWhite"/>
</clipView>
<scroller key="horizontalScroller" hidden="YES" verticalHuggingPriority="750" doubleValue="1" horizontal="YES" id="40">
<rect key="frame" x="-100" y="-100" width="87" height="18"/>
<autoresizingMask key="autoresizingMask"/>
</scroller>
<scroller key="verticalScroller" verticalHuggingPriority="750" horizontal="NO" id="39">
- <rect key="frame" x="364" y="1" width="15" height="439"/>
+ <rect key="frame" x="363" y="1" width="16" height="439"/>
<autoresizingMask key="autoresizingMask"/>
</scroller>
</scrollView>
return self;
}
-- (void)loadView
+- (void)viewDidLoad
{
- [super loadView];
+ [super viewDidLoad];
[self setHidden:NO];
}
self.chapterTitles = job.chapterTitles;
}
-- (void)loadView
+- (void)viewDidLoad
{
- [super loadView];
+ [super viewDidLoad];
self.table.doubleAction = @selector(doubleClickAction:);
}
@property (nonatomic, weak) IBOutlet HBToolbarBadgedItem *showQueueToolbarItem;
-@property (nonatomic, unsafe_unretained) IBOutlet NSView *openTitleView;
+@property (nonatomic, weak) IBOutlet NSView *openTitleView;
@property (nonatomic, readwrite) BOOL scanSpecificTitle;
@property (nonatomic, readwrite) NSInteger scanSpecificTitleIdx;
@property (nonatomic, readwrite) NSTimeInterval modifiedTime;
@property (nonatomic, readonly) NSSet *objectClasses;
-@property (nonatomic, readonly) BOOL requiresSecureCoding;
@property (nonatomic, readonly) sem_t *mutex;
@property (nonatomic, readwrite) uint32_t mutexCount;
_array = [[NSMutableArray alloc] init];
_objectClasses = [NSSet setWithObjects:[NSMutableArray class], objectClass, nil];
- // Enable secure coding only on 10.9 and later
- if ([NSURL instancesRespondToSelector:@selector(fileSystemRepresentation)])
- {
- _requiresSecureCoding = YES;
- }
-
NSString *identifier = [[NSBundle mainBundle] bundleIdentifier];
NSArray *runningInstances = [NSRunningApplication runningApplicationsWithBundleIdentifier:identifier];
const char *name = [NSString stringWithFormat:@"%@/%@", identifier, _fileURL.lastPathComponent.stringByDeletingPathExtension].UTF8String;
NSMutableArray *jobsArray = nil;
@try
{
- if (self.requiresSecureCoding)
- {
- NSData *queue = [NSData dataWithContentsOfURL:self.fileURL];
- NSKeyedUnarchiver *unarchiver = [[NSKeyedUnarchiver alloc] initForReadingWithData:queue];
- unarchiver.requiresSecureCoding = YES;
- jobsArray = [unarchiver decodeObjectOfClasses:self.objectClasses forKey:NSKeyedArchiveRootObjectKey];
- [unarchiver finishDecoding];
- }
- else
- {
- jobsArray = [NSKeyedUnarchiver unarchiveObjectWithFile:self.fileURL.path];
- }
+ NSData *queue = [NSData dataWithContentsOfURL:self.fileURL];
+ NSKeyedUnarchiver *unarchiver = [[NSKeyedUnarchiver alloc] initForReadingWithData:queue];
+ unarchiver.requiresSecureCoding = YES;
+ jobsArray = [unarchiver decodeObjectOfClasses:self.objectClasses forKey:NSKeyedArchiveRootObjectKey];
+ [unarchiver finishDecoding];
}
@catch (NSException *exception)
{
return @"HBEncodingProgressHUDController";
}
-- (void)loadView
-{
- [super loadView];
-
- if (NSClassFromString(@"NSVisualEffectView") == NO)
- {
- self.infoLabel.textColor = [NSColor whiteColor];
- }
-}
-
- (BOOL)canBeHidden
{
return NO;
return @"HBPictureHUDController";
}
-- (void)loadView
+- (void)viewDidLoad
{
- [super loadView];
-
- if (NSClassFromString(@"NSVisualEffectView") == NO)
- {
- self.scaleLabel.textColor = [NSColor whiteColor];
- self.infoLabel.textColor = [NSColor whiteColor];
- self.durationLabel.textColor = [NSColor whiteColor];
- self.durationUnitLabel.textColor = [NSColor whiteColor];
- }
+ [super viewDidLoad];
// we set the preview length popup in seconds
[self.durationPopUp removeAllItems];
return @"HBPlayerHUDController";
}
-- (void)loadView
+- (void)viewDidLoad
{
- [super loadView];
+ [super viewDidLoad];
if ([[NSFont class] respondsToSelector:@selector(monospacedDigitSystemFontOfSize:weight:)]) {
_monospacedAttr = @{NSFontAttributeName: [NSFont monospacedDigitSystemFontOfSize:[NSFont smallSystemFontSize] weight:NSFontWeightRegular]};
{
[self _buildTracksMenu];
- // 10.7 does not supports weak NSViewController,
- // so use self and disable the warning for now.
-#pragma clang diagnostic push
-#pragma clang diagnostic ignored "-Warc-retain-cycles"
+ __weak HBPlayerHUDController *weakSelf = self;
self.periodicObserver = [self.player addPeriodicTimeObserverUsingBlock:^(NSTimeInterval time) {
- [self _refreshUI];
+ [weakSelf _refreshUI];
}];
self.rateObserver = [self.player addRateObserverUsingBlock:^{
- if (self.player.rate != 0.0)
+ if (weakSelf.player.rate != 0.0)
{
- self.playButton.image = [NSImage imageNamed:@"PauseTemplate"];
+ weakSelf.playButton.image = [NSImage imageNamed:@"PauseTemplate"];
}
else
{
- self.playButton.image = [NSImage imageNamed:@"PlayTemplate"];
+ weakSelf.playButton.image = [NSImage imageNamed:@"PlayTemplate"];
}
}];
}
/**
- * -[HBPreferencesController awakeFromNib]
*
* Called after all the outlets in the nib file have been attached. Sets up the
* toolbar and shows the "General" pane.
*
*/
-- (void) awakeFromNib
+- (void)windowDidLoad
{
- NSToolbar * toolbar = [[NSToolbar alloc] initWithIdentifier: @"Preferences Toolbar"];
+ NSToolbar *toolbar = [[NSToolbar alloc] initWithIdentifier: @"Preferences Toolbar"];
[toolbar setDelegate: self];
[toolbar setAllowsUserCustomization: NO];
[toolbar setDisplayMode: NSToolbarDisplayModeIconAndLabel];
view.hidden = YES;
[NSAnimationContext runAnimationGroup:^(NSAnimationContext *context) {
- if ([context respondsToSelector:@selector(setAllowsImplicitAnimation:)] && NSClassFromString(@"NSVisualEffectView"))
+ if ([context respondsToSelector:@selector(setAllowsImplicitAnimation:)])
{
context.allowsImplicitAnimation = YES;
}
return self;
}
-- (void)loadView
+- (void)viewDidLoad
{
- [super loadView];
+ [super viewDidLoad];
if (NSAppKitVersionNumber >= NSAppKitVersionNumber10_10)
{
_backLayer = [CALayer layer];
[_backLayer setBounds:CGRectMake(0.0, 0.0, self.frame.size.width, self.frame.size.height)];
- CGColorRef white = CGColorCreateGenericRGB(1.0, 1.0, 1.0, 1.0);
- [_backLayer setBackgroundColor: white];
- CFRelease(white);
+ [_backLayer setBackgroundColor: NSColor.whiteColor.CGColor];
[_backLayer setShadowOpacity:0.5f];
[_backLayer setShadowOffset:CGSizeMake(0, 0)];
[_backLayer setAnchorPoint:CGPointMake(0, 0)];
return self;
}
-- (void)loadView
+- (void)viewDidLoad
{
- [super loadView];
+ [super viewDidLoad];
self.visible = YES;
self.previewView.showShadow = NO;
return self;
}
-- (void)loadView
+- (void)viewDidLoad
{
- [super loadView];
+ [super viewDidLoad];
self.previewViewController.view.autoresizingMask = NSViewWidthSizable | NSViewHeightSizable;
self.previewViewController.view.frame = NSMakeRect(0, 0, self.previewView.frame.size.width, self.previewView.frame.size.height);
[self.previewView addSubview:self.previewViewController.view];
}
else if (context == HBSummaryViewControllerContainerContext)
{
- if (NSAppKitVersionNumber >= NSAppKitVersionNumber10_10 && change[NSKeyValueChangeNewKey])
+ if ([change[NSKeyValueChangeNewKey] integerValue] & 0x030000)
{
- if ([change[NSKeyValueChangeNewKey] integerValue] & 0x030000)
- {
- self.bottomOptionsConstrain.active = YES;
- }
- else
- {
- self.bottomOptionsConstrain.active = NO;
- }
+ self.bottomOptionsConstrain.active = YES;
+ }
+ else
+ {
+ self.bottomOptionsConstrain.active = NO;
}
[self updateTracks:nil];
}
#pragma mark -- Private Methods
-- (CGColorRef)copyNSColorToCGColor:(NSColor *)color
-{
- // CGColor property of NSColor has been added only in 10.8,
- // we need to support 10.7 too.
- NSInteger numberOfComponents = [color numberOfComponents];
- CGFloat components[numberOfComponents];
- CGColorSpaceRef colorSpace = [[color colorSpace] CGColorSpace];
- [color getComponents:(CGFloat *)&components];
- CGColorRef cgColor = CGColorCreate(colorSpace, components);
-
- return cgColor;
-}
-
- (void)HB_refreshBadge
{
if (_badgeValue.length)
CGContextAddArcToPoint(context, maxx, maxy, midx, maxy, radius);
CGContextAddArcToPoint(context, minx, maxy, minx, midy, radius);
CGContextClosePath(context);
- CGColorRef fillColor = [self copyNSColorToCGColor:_badgeFillColor];
+ CGColorRef fillColor = _badgeFillColor.CGColor;
CGContextSetFillColorWithColor(context,fillColor);
- CFRelease(fillColor);
CGContextDrawPath(context, kCGPathFill);
// Draw the text