@class HBPresetsManager;
@class HBDockTile;
-@interface HBController : NSObject <NSApplicationDelegate, GrowlApplicationBridgeDelegate, HBPictureControllerDelegate, NSDrawerDelegate>
+@interface HBController : NSObject <NSApplicationDelegate, NSDrawerDelegate, GrowlApplicationBridgeDelegate>
{
IBOutlet NSWindow * fWindow;
- (void) processNewQueueEncode;
- (void) clearQueueEncodedItems;
/* Queue Editing */
-- (IBAction)rescanQueueItemToMainWindow:(NSUInteger) selectedQueueItem;
-
+- (void)rescanQueueItemToMainWindow:(NSUInteger) selectedQueueItem;
- (void) removeQueueFileItem:(NSUInteger) queueItemToRemove;
- (void) clearQueueAllItems;
- (IBAction) showAddPresetPanel: (id) sender;
- (IBAction)selectDefaultPreset:(id)sender;
- (IBAction)addFactoryPresets:(id)sender;
-
--(void)sendToMetaX:(NSString *) filePath;
-// Growl methods
-- (NSDictionary *) registrationDictionaryForGrowl;
--(void)showGrowlDoneNotification:(NSString *) filePath;
- (IBAction)showDebugOutputPanel:(id)sender;
- (void) remindUserOfSleepOrShutdown;
// DockTile update freqency in total percent increment
#define dockTileUpdateFrequency 0.1f
-@interface HBController () <HBPresetsViewControllerDelegate, HBPreviewControllerDelegate>
+@interface HBController () <HBPresetsViewControllerDelegate, HBPreviewControllerDelegate, HBPictureControllerDelegate>
@property (nonatomic, copy) NSString *browsedSourceDisplayName;
}
fPresetsView.enabled = b;
- fVideoController.enabled = b;
- fAudioController.enabled = b;
- fSubtitlesViewController.enabled = b;
}
/**
// to determine if we should check for encode done notifications.
if (fEncodeState != 2)
{
- NSString *pathOfFinishedEncode;
// Get the output file name for the finished encode
HBJob *finishedJob = QueueFileArray[currentQueueEncodeIndex];
- pathOfFinishedEncode = finishedJob.destURL.path;
// Both the Growl Alert and Sending to tagger can be done as encodes roll off the queue
if ([[[NSUserDefaults standardUserDefaults] stringForKey:@"AlertWhenDone"] isEqualToString: @"Growl Notification"] ||
{
NSBeep();
}
- [self showGrowlDoneNotification:pathOfFinishedEncode];
+ [self showGrowlDoneNotification:finishedJob.destURL];
}
// Send to tagger
- [self sendToMetaX:pathOfFinishedEncode];
+ [self sendToExternalApp:finishedJob.destURL];
// since we have successfully completed an encode, we increment the queue counter
[self incrementQueueItemDone:currentQueueEncodeIndex];
#pragma mark -
#pragma mark Encode Done Actions
-// register a test notification and make
-// it enabled by default
+
#define SERVICE_NAME @"Encode Done"
+
+/**
+ * Register a test notification and make
+ * it enabled by default
+ */
- (NSDictionary *)registrationDictionaryForGrowl
{
- NSDictionary *registrationDictionary = [NSDictionary dictionaryWithObjectsAndKeys:
- [NSArray arrayWithObjects:SERVICE_NAME,nil], GROWL_NOTIFICATIONS_ALL,
- [NSArray arrayWithObjects:SERVICE_NAME,nil], GROWL_NOTIFICATIONS_DEFAULT,
- nil];
-
- return registrationDictionary;
-}
-
--(void)showGrowlDoneNotification:(NSString *) filePath
-{
- /* This end of encode action is called as each encode rolls off of the queue */
- /* Setup the Growl stuff */
- NSString * finishedEncode = filePath;
- /* strip off the path to just show the file name */
- finishedEncode = [finishedEncode lastPathComponent];
- NSString * growlMssg = [NSString stringWithFormat: @"your HandBrake encode %@ is done!",finishedEncode];
- [GrowlApplicationBridge
- notifyWithTitle:@"Put down that cocktail…"
- description:growlMssg
- notificationName:SERVICE_NAME
- iconData:nil
- priority:0
- isSticky:1
- clickContext:nil];
-}
--(void)sendToMetaX:(NSString *) filePath
-{
- /* This end of encode action is called as each encode rolls off of the queue */
+ return @{GROWL_NOTIFICATIONS_ALL: @[SERVICE_NAME],
+ GROWL_NOTIFICATIONS_DEFAULT: @[SERVICE_NAME]};
+}
+
+- (void)showGrowlDoneNotification:(NSURL *)fileURL
+{
+ // This end of encode action is called as each encode rolls off of the queue
+ // Setup the Growl stuff
+ NSString *growlMssg = [NSString stringWithFormat:@"your HandBrake encode %@ is done!", fileURL.lastPathComponent];
+ [GrowlApplicationBridge notifyWithTitle:@"Put down that cocktail…"
+ description:growlMssg
+ notificationName:SERVICE_NAME
+ iconData:nil
+ priority:0
+ isSticky:1
+ clickContext:nil];
+}
+
+- (void)sendToExternalApp:(NSURL *)fileURL
+{
+ // This end of encode action is called as each encode rolls off of the queue
if([[NSUserDefaults standardUserDefaults] boolForKey: @"sendToMetaX"] == YES)
{
- NSString *sendToApp = [[NSUserDefaults standardUserDefaults] objectForKey: @"SendCompletedEncodeToApp"];
+ NSString *sendToApp = [[NSUserDefaults standardUserDefaults] objectForKey:@"SendCompletedEncodeToApp"];
if (![sendToApp isEqualToString:@"None"])
{
[HBUtilities writeToActivityLog: "trying to send encode to: %s", [sendToApp UTF8String]];
- NSAppleScript *myScript = [[NSAppleScript alloc] initWithSource: [NSString stringWithFormat: @"%@%@%@%@%@", @"tell application \"",sendToApp,@"\" to open (POSIX file \"", filePath, @"\")"]];
+ NSAppleScript *myScript = [[NSAppleScript alloc] initWithSource: [NSString stringWithFormat: @"%@%@%@%@%@", @"tell application \"",sendToApp,@"\" to open (POSIX file \"", fileURL.path, @"\")"]];
[myScript executeAndReturnError: nil];
[myScript release];
}
-
}
}
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
-<document type="com.apple.InterfaceBuilder3.Cocoa.XIB" version="3.0" toolsVersion="5056" systemVersion="14A329r" targetRuntime="MacOSX.Cocoa" propertyAccessControl="none">
+<document type="com.apple.InterfaceBuilder3.Cocoa.XIB" version="3.0" toolsVersion="6254" systemVersion="14C81f" targetRuntime="MacOSX.Cocoa" propertyAccessControl="none">
<dependencies>
- <deployment version="1060" defaultVersion="1060" identifier="macosx"/>
- <plugIn identifier="com.apple.InterfaceBuilder.CocoaPlugin" version="5056"/>
+ <deployment version="1060" identifier="macosx"/>
+ <plugIn identifier="com.apple.InterfaceBuilder.CocoaPlugin" version="6254"/>
</dependencies>
<objects>
<customObject id="-2" userLabel="File's Owner" customClass="HBAudioController">
</connections>
</customObject>
<customObject id="-1" userLabel="First Responder" customClass="FirstResponder"/>
- <customObject id="-3" userLabel="Application"/>
+ <customObject id="-3" userLabel="Application" customClass="NSObject"/>
<arrayController id="iWY-gv-3ab" userLabel="Audio Inputs">
<declaredKeys>
<string>keyAudioTrackName</string>
<autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
<subviews>
<tableView verticalHuggingPriority="750" allowsExpansionToolTips="YES" columnAutoresizingStyle="firstColumnOnly" columnReordering="NO" multipleSelection="NO" autosaveColumns="NO" typeSelect="NO" rowHeight="25" headerView="GLD-lI-qeh" id="LlC-ua-mth">
- <rect key="frame" x="0.0" y="0.0" width="884" height="248"/>
+ <rect key="frame" x="0.0" y="0.0" width="884" height="27"/>
<autoresizingMask key="autoresizingMask"/>
<size key="intercellSpacing" width="3" height="2"/>
<color key="backgroundColor" white="1" alpha="1" colorSpace="calibratedWhite"/>
</tableColumn>
</tableColumns>
<connections>
+ <binding destination="-2" name="enabled" keyPath="self.job" id="FGZ-gP-H5Y">
+ <dictionary key="options">
+ <string key="NSValueTransformerName">NSIsNotNil</string>
+ </dictionary>
+ </binding>
<outlet property="menu" destination="hyy-qd-qpe" id="e5W-aS-mPB"/>
</connections>
</tableView>
</buttonCell>
<connections>
<action selector="showSettingsSheet:" target="-2" id="D9K-M3-zHd"/>
+ <binding destination="-2" name="enabled" keyPath="self.job" id="VMC-Xv-X3R">
+ <dictionary key="options">
+ <string key="NSValueTransformerName">NSIsNotNil</string>
+ </dictionary>
+ </binding>
</connections>
</button>
<button verticalHuggingPriority="750" id="wcL-rL-aYS">
</buttonCell>
<connections>
<action selector="reloadDefaults:" target="-2" id="k9I-I9-T2U"/>
+ <binding destination="-2" name="enabled" keyPath="self.job" id="rta-fa-Ezd">
+ <dictionary key="options">
+ <string key="NSValueTransformerName">NSIsNotNil</string>
+ </dictionary>
+ </binding>
</connections>
</button>
<popUpButton verticalHuggingPriority="750" id="jrP-M5-2Rq">
</items>
</menu>
</popUpButtonCell>
+ <connections>
+ <binding destination="-2" name="enabled" keyPath="self.job" id="FGP-3D-g2t">
+ <dictionary key="options">
+ <string key="NSValueTransformerName">NSIsNotNil</string>
+ </dictionary>
+ </binding>
+ </connections>
</popUpButton>
</subviews>
</view>
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
-<document type="com.apple.InterfaceBuilder3.Cocoa.XIB" version="3.0" toolsVersion="5056" systemVersion="13F14" targetRuntime="MacOSX.Cocoa" propertyAccessControl="none">
+<document type="com.apple.InterfaceBuilder3.Cocoa.XIB" version="3.0" toolsVersion="6254" systemVersion="14C81f" targetRuntime="MacOSX.Cocoa" propertyAccessControl="none">
<dependencies>
- <deployment version="1060" defaultVersion="1060" identifier="macosx"/>
- <plugIn identifier="com.apple.InterfaceBuilder.CocoaPlugin" version="5056"/>
+ <deployment version="1060" identifier="macosx"/>
+ <plugIn identifier="com.apple.InterfaceBuilder.CocoaPlugin" version="6254"/>
</dependencies>
<objects>
<customObject id="-2" userLabel="File's Owner" customClass="HBSubtitlesController">
</connections>
</customObject>
<customObject id="-1" userLabel="First Responder" customClass="FirstResponder"/>
- <customObject id="-3" userLabel="Application"/>
+ <customObject id="-3" userLabel="Application" customClass="NSObject"/>
<customView id="Hz6-mo-xeY">
<rect key="frame" x="0.0" y="0.0" width="926" height="322"/>
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMinY="YES"/>
<autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
<subviews>
<tableView verticalHuggingPriority="750" allowsExpansionToolTips="YES" columnAutoresizingStyle="firstColumnOnly" columnReordering="NO" multipleSelection="NO" autosaveColumns="NO" typeSelect="NO" rowHeight="25" headerView="IiW-3a-Drv" id="0yM-wE-D2x">
- <rect key="frame" x="0.0" y="0.0" width="884" height="248"/>
+ <rect key="frame" x="0.0" y="0.0" width="884" height="27"/>
<autoresizingMask key="autoresizingMask"/>
<size key="intercellSpacing" width="3" height="2"/>
<color key="backgroundColor" white="1" alpha="1" colorSpace="calibratedWhite"/>
</tableColumn>
</tableColumns>
<connections>
+ <binding destination="-2" name="enabled" keyPath="self.job" id="PJP-qc-FJe">
+ <dictionary key="options">
+ <string key="NSValueTransformerName">NSIsNotNil</string>
+ </dictionary>
+ </binding>
<outlet property="dataSource" destination="-2" id="DH5-v0-2ba"/>
<outlet property="delegate" destination="-2" id="Dfm-tw-89m"/>
<outlet property="menu" destination="KgC-dn-Hq2" id="Iff-7t-kdg"/>
<autoresizingMask key="autoresizingMask"/>
</scroller>
<scroller key="verticalScroller" hidden="YES" verticalHuggingPriority="750" doubleValue="1" horizontal="NO" id="GfM-TU-Tmr">
- <rect key="frame" x="-15" y="17" width="16" height="0.0"/>
<autoresizingMask key="autoresizingMask"/>
</scroller>
<tableHeaderView key="headerView" id="IiW-3a-Drv">
</items>
</menu>
</popUpButtonCell>
+ <connections>
+ <binding destination="-2" name="enabled" keyPath="self.job" id="FLd-lw-rWb">
+ <dictionary key="options">
+ <string key="NSValueTransformerName">NSIsNotNil</string>
+ </dictionary>
+ </binding>
+ </connections>
</popUpButton>
<button verticalHuggingPriority="750" id="QsM-28-Pya">
<rect key="frame" x="110" y="288" width="140" height="28"/>
</buttonCell>
<connections>
<action selector="showSettingsSheet:" target="-2" id="OAA-S8-tfS"/>
+ <binding destination="-2" name="enabled" keyPath="self.job" id="Nuv-KK-HdK">
+ <dictionary key="options">
+ <string key="NSValueTransformerName">NSIsNotNil</string>
+ </dictionary>
+ </binding>
</connections>
</button>
<button verticalHuggingPriority="750" id="Vxx-gk-9kY">
</buttonCell>
<connections>
<action selector="addTracksFromDefaults:" target="-2" id="GOz-FT-Atg"/>
+ <binding destination="-2" name="enabled" keyPath="self.job" id="Mxg-ln-sW9">
+ <dictionary key="options">
+ <string key="NSValueTransformerName">NSIsNotNil</string>
+ </dictionary>
+ </binding>
</connections>
</button>
</subviews>
<color key="backgroundColor" name="textBackgroundColor" catalog="System" colorSpace="catalog"/>
</textFieldCell>
<connections>
- <binding destination="-2" name="enabled2" keyPath="self.enabled" previousBinding="mjs-X8-KV8" id="Gpe-Tm-7wn">
+ <binding destination="-2" name="enabled2" keyPath="self.video" previousBinding="mjs-X8-KV8" id="VTs-xH-tZg">
<dictionary key="options">
<integer key="NSMultipleValuesPlaceholder" value="-1"/>
<integer key="NSNoSelectionPlaceholder" value="-1"/>
<integer key="NSNotApplicablePlaceholder" value="-1"/>
<integer key="NSNullPlaceholder" value="-1"/>
+ <string key="NSValueTransformerName">NSIsNotNil</string>
</dictionary>
</binding>
<binding destination="-2" name="value" keyPath="self.video.avgBitrate" id="7eN-5J-5WV"/>
</menu>
</popUpButtonCell>
<connections>
- <binding destination="-2" name="enabled" keyPath="self.enabled" id="mpI-26-Ajl"/>
+ <binding destination="-2" name="enabled" keyPath="self.video" id="yN5-l3-JRJ">
+ <dictionary key="options">
+ <string key="NSValueTransformerName">NSIsNotNil</string>
+ </dictionary>
+ </binding>
<binding destination="-2" name="selectedValue" keyPath="self.video.frameRate" previousBinding="Heu-SS-Uwq" id="XC7-GV-Uae">
<dictionary key="options">
<bool key="NSAllowsEditingMultipleValuesSelection" value="NO"/>
<font key="font" metaFont="smallSystem"/>
</buttonCell>
<connections>
- <binding destination="-2" name="enabled2" keyPath="self.enabled" previousBinding="7aV-7j-MzB" id="GSP-bg-aKw">
+ <binding destination="-2" name="enabled2" keyPath="self.video" previousBinding="7aV-7j-MzB" id="c4g-dz-q05">
<dictionary key="options">
<integer key="NSMultipleValuesPlaceholder" value="-1"/>
<integer key="NSNoSelectionPlaceholder" value="-1"/>
<integer key="NSNotApplicablePlaceholder" value="-1"/>
<integer key="NSNullPlaceholder" value="-1"/>
+ <string key="NSValueTransformerName">NSIsNotNil</string>
</dictionary>
</binding>
<binding destination="-2" name="enabled" keyPath="self.video.qualityType" id="7aV-7j-MzB">
<font key="font" metaFont="smallSystem"/>
</buttonCell>
<connections>
- <binding destination="-2" name="enabled2" keyPath="self.enabled" previousBinding="iZE-er-OQN" id="DQs-Z1-77T">
+ <binding destination="-2" name="enabled2" keyPath="self.video" previousBinding="iZE-er-OQN" id="Fbv-qd-JTg">
<dictionary key="options">
<integer key="NSMultipleValuesPlaceholder" value="-1"/>
<integer key="NSNoSelectionPlaceholder" value="-1"/>
<integer key="NSNotApplicablePlaceholder" value="-1"/>
<integer key="NSNullPlaceholder" value="-1"/>
+ <string key="NSValueTransformerName">NSIsNotNil</string>
</dictionary>
</binding>
- <binding destination="-2" name="enabled" keyPath="self.video.qualityType" id="iZE-er-OQN">
+ <binding destination="-2" name="hidden" keyPath="self.video.twoPass" previousBinding="Fbv-qd-JTg" id="jpH-IH-e0p">
<dictionary key="options">
<string key="NSValueTransformerName">NSNegateBoolean</string>
</dictionary>
</binding>
- <binding destination="-2" name="value" keyPath="self.video.turboTwoPass" id="4A4-hg-qhy"/>
- <binding destination="-2" name="hidden" keyPath="self.video.twoPass" previousBinding="DQs-Z1-77T" id="sfq-sw-XJu">
+ <binding destination="-2" name="enabled" keyPath="self.video.qualityType" id="iZE-er-OQN">
<dictionary key="options">
<string key="NSValueTransformerName">NSNegateBoolean</string>
</dictionary>
</binding>
+ <binding destination="-2" name="value" keyPath="self.video.turboTwoPass" id="4A4-hg-qhy"/>
</connections>
</button>
<popUpButton verticalHuggingPriority="750" id="xwK-Yu-a1e">
</menu>
</popUpButtonCell>
<connections>
- <binding destination="-2" name="enabled" keyPath="self.enabled" id="kKW-qz-38E"/>
+ <binding destination="-2" name="enabled" keyPath="self.video" id="Dhc-7W-mCB">
+ <dictionary key="options">
+ <string key="NSValueTransformerName">NSIsNotNil</string>
+ </dictionary>
+ </binding>
<binding destination="-2" name="selectedValue" keyPath="self.video.encoder" previousBinding="PbS-nr-Hjk" id="h1y-Vg-Gyg">
<dictionary key="options">
<bool key="NSAllowsEditingMultipleValuesSelection" value="NO"/>
</column>
</cells>
<connections>
- <binding destination="-2" name="enabled" keyPath="self.enabled" id="RaB-VA-rgV"/>
+ <binding destination="-2" name="enabled" keyPath="self.video" id="Bhn-TM-mbV">
+ <dictionary key="options">
+ <string key="NSValueTransformerName">NSIsNotNil</string>
+ </dictionary>
+ </binding>
<binding destination="-2" name="selectedTag" keyPath="self.video.qualityType" id="Bpj-MC-Zf7"/>
</connections>
</matrix>
</column>
</cells>
<connections>
- <binding destination="-2" name="enabled" keyPath="self.enabled" id="7Cn-NH-MAP"/>
+ <binding destination="-2" name="enabled" keyPath="self.video" id="RUB-wC-Q0A">
+ <dictionary key="options">
+ <string key="NSValueTransformerName">NSIsNotNil</string>
+ </dictionary>
+ </binding>
<binding destination="-2" name="selectedIndex" keyPath="self.video.frameRateMode" id="tJr-26-Y2P"/>
</connections>
</matrix>
<font key="font" metaFont="miniSystem"/>
</sliderCell>
<connections>
- <binding destination="-2" name="enabled2" keyPath="self.enabled" previousBinding="wCA-ag-GHJ" id="EOE-Cw-D0K">
+ <binding destination="-2" name="enabled2" keyPath="self.video" previousBinding="wCA-ag-GHJ" id="ywk-WQ-GNY">
<dictionary key="options">
<integer key="NSMultipleValuesPlaceholder" value="-1"/>
<integer key="NSNoSelectionPlaceholder" value="-1"/>
<integer key="NSNotApplicablePlaceholder" value="-1"/>
<integer key="NSNullPlaceholder" value="-1"/>
+ <string key="NSValueTransformerName">NSIsNotNil</string>
</dictionary>
</binding>
<binding destination="-2" name="value" keyPath="self.video.quality" previousBinding="nAO-gB-Jbd" id="C3d-pR-fJ2">
<color key="backgroundColor" name="controlColor" catalog="System" colorSpace="catalog"/>
</textFieldCell>
<connections>
+ <binding destination="-2" name="enabled" keyPath="self.video" id="Ph9-Gy-Sru">
+ <dictionary key="options">
+ <string key="NSValueTransformerName">NSIsNotNil</string>
+ </dictionary>
+ </binding>
<binding destination="-2" name="value" keyPath="pictureSettings" id="hem-VY-3fR"/>
- <binding destination="-2" name="enabled" keyPath="self.enabled" id="uv0-Gi-gXH"/>
<binding destination="-2" name="textColor" keyPath="self.labelColor" id="aVY-g8-jGq"/>
</connections>
</textField>
<color key="backgroundColor" name="controlColor" catalog="System" colorSpace="catalog"/>
</textFieldCell>
<connections>
+ <binding destination="-2" name="enabled" keyPath="self.video" id="ckY-jh-UvA">
+ <dictionary key="options">
+ <string key="NSValueTransformerName">NSIsNotNil</string>
+ </dictionary>
+ </binding>
<binding destination="-2" name="value" keyPath="pictureFilters" id="Sr7-JI-M4y"/>
- <binding destination="-2" name="enabled" keyPath="self.enabled" id="Joa-BW-Ekr"/>
<binding destination="-2" name="textColor" keyPath="self.labelColor" id="FtS-pM-hKz"/>
</connections>
</textField>
<font key="font" metaFont="smallSystem"/>
</buttonCell>
<connections>
- <binding destination="-2" name="enabled" keyPath="self.enabled" id="eDg-nl-sf5"/>
+ <binding destination="-2" name="enabled" keyPath="self.video" id="GDV-uX-eAs">
+ <dictionary key="options">
+ <string key="NSValueTransformerName">NSIsNotNil</string>
+ </dictionary>
+ </binding>
<binding destination="-2" name="value" keyPath="self.video.advancedOptions" id="sQg-ab-NdN"/>
</connections>
</button>
//
#import <Cocoa/Cocoa.h>
-#import "HBViewValidation.h"
extern NSString *keyAudioTrackIndex;
extern NSString *keyAudioTrackName;
*
* Responds to HBContainerChangedNotification.
*/
-@interface HBAudioController : NSViewController <HBViewValidation>
+@interface HBAudioController : NSViewController
@property (nonatomic, readonly, retain) NSArray *masterTrackArray;
@property (nonatomic, readonly) NSDictionary *noneTrack;
@synthesize masterTrackArray;
@synthesize noneTrack;
@synthesize videoContainerTag;
-@synthesize enabled = _enabled;
- (instancetype)init
{
[self switchingTrackFromNone:nil];
}
-- (void)setEnabled:(BOOL)enabled
-{
- _enabled = enabled;
- [fTableView setEnabled:enabled];
- [self.trackPopup setEnabled:enabled];
- [self.configureDefaults setEnabled:enabled];
- [self.reloadDefaults setEnabled:enabled];
-}
-
- (BOOL)validateUserInterfaceItem:(id < NSValidatedUserInterfaceItem >)anItem
{
- return self.enabled;
+ return (self.job != nil);
}
#pragma mark -
if (job)
{
+ _job = job;
[audioArray release];
audioArray = [job.audioTracks retain];
self.settings = job.audioDefaults;
}
else
{
+ _job = nil;
[audioArray release];
audioArray = nil;
self.settings = nil;
It may be used under the terms of the GNU General Public License. */
#import <Cocoa/Cocoa.h>
-#import "HBViewValidation.h"
extern NSString *keySubTrackName;
extern NSString *keySubTrackIndex;
* HBSubtitlesController
* Responds to HBContainerChangedNotification.
*/
-@interface HBSubtitlesController : NSViewController <HBViewValidation>
+@interface HBSubtitlesController : NSViewController
- (void)applySettingsFromPreset:(NSDictionary *)preset;
@implementation HBSubtitlesController
-@synthesize enabled = _enabled;
-
- (instancetype)init
{
self = [super initWithNibName:@"Subtitles" bundle:nil];
return self;
}
-- (void)setEnabled:(BOOL)enabled
-{
- [self.trackPopUp setEnabled:enabled];
- [self.configureDefaults setEnabled:enabled];
- [self.reloadDefaults setEnabled:enabled];
- [self.fTableView setEnabled:enabled];
- _enabled = enabled;
-}
-
- (void)setJob:(HBJob *)job
{
/* reset the subtitles arrays */
if (job)
{
+ _job = job;
self.subtitleArray = job.subtitlesTracks;
self.settings = job.subtitlesDefaults;
self.subtitleSourceArray = [[job.title.subtitlesTracks mutableCopy] autorelease];
// to display a "None" row in the table view
[self.subtitleArray addObject:[self createSubtitleTrack]];
}
+ else
+ {
+ _job = nil;
+ }
[self.fTableView reloadData];
}
- (BOOL)validateUserInterfaceItem:(id < NSValidatedUserInterfaceItem >)anItem
{
- return self.enabled;
+ return (self.job != nil);
}
/**
It may be used under the terms of the GNU General Public License. */
#import <Cocoa/Cocoa.h>
-#import "HBViewValidation.h"
@class HBController;
@class HBAdvancedController;
/**
* HBVideoController
*/
-@interface HBVideoController : NSViewController <HBViewValidation>
+@interface HBVideoController : NSViewController
- (instancetype)initWithAdvancedController:(HBAdvancedController *)advancedController;
@property (nonatomic, copy, readwrite) NSString *pictureSettings;
@property (nonatomic, copy, readwrite) NSString *pictureFilters;
-@property (nonatomic, readwrite, retain) HBVideo *video;
+@property (nonatomic, readwrite, assign) HBVideo *video;
@end
@implementation HBVideoController
-@synthesize enabled = _enabled;
-
- (instancetype)initWithAdvancedController:(HBAdvancedController *)advancedController
{
self = [self init];
self = [super initWithNibName:@"Video" bundle:nil];
if (self)
{
+ _labelColor = [[NSColor disabledControlTextColor] retain];
+
// Observe the advanced tab pref shown/hided state.
[[NSUserDefaultsController sharedUserDefaultsController] addObserver:self
forKeyPath:@"values.HBShowAdvancedTab"
return self;
}
-- (void)setEnabled:(BOOL)flag
+- (void)setVideo:(HBVideo *)video
{
- _enabled = flag;
+ _video = video;
- if (_enabled)
+ if (_video)
{
self.labelColor = [NSColor controlTextColor];
}
self.labelColor = [NSColor disabledControlTextColor];
}
- [self enableEncoderOptionsWidgets:flag];
+ [self enableEncoderOptionsWidgets:(video != nil)];
}
#pragma mark - KVO
}
}
// enable/disable, populate and update the various widgets
- [self enableEncoderOptionsWidgets:self.enabled];
+ [self enableEncoderOptionsWidgets:(self.video != nil)];
} else if ([keyPath isEqualToString:@"values.HBShowAdvancedTab"])
{