MacGui: fix a bunch of regressions (various crash when in some textfields, encode log going to the wrong directory).

git-svn-id: svn://svn.handbrake.fr/HandBrake/trunk@6676 b64f7644-9d1e-0410-96f1-a4d463321fa5
This commit is contained in:
ritsuka 2014-12-30 07:13:07 +00:00
parent 30d1c1cc1e
commit e85690352f
17 changed files with 164 additions and 118 deletions

View File

@ -136,7 +136,6 @@
IBOutlet NSMenu * presetsMenu;
IBOutlet NSDrawer * fPresetDrawer;
IBOutlet NSTextField * fPresetSelectedDisplay;
/* Queue variables */
int hbInstanceNum; //stores the number of HandBrake instances currently running

View File

@ -141,10 +141,6 @@
[fQueueController setHBController:self];
[[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(autoSetM4vExtension:) name:HBMixdownChangedNotification object:nil];
[[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(pictureSettingsDidChange) name:HBPictureChangedNotification object:nil];
[[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(pictureSettingsDidChange) name:HBFiltersChangedNotification object:nil];
[[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(formatChanged:) name:HBContainerChangedNotification object:nil];
[[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(customSettingUsed) name:HBVideoChangedNotification object:nil];
}
return self;
@ -322,11 +318,24 @@
fPictureController.filters = job.filters;
fPreviewController.job = job;
fVideoController.video = job.video;
fVideoController.job = job;
fAudioController.job = job;
fSubtitlesViewController.job = job;
fChapterTitlesController.job = job;
if (job)
{
[[NSNotificationCenter defaultCenter] removeObserver:_job];
[[NSNotificationCenter defaultCenter] removeObserver:_job.picture];
[[NSNotificationCenter defaultCenter] removeObserver:_job.filters];
[[NSNotificationCenter defaultCenter] removeObserver:_job.video];
[[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(pictureSettingsDidChange) name:HBPictureChangedNotification object:job.picture];
[[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(pictureSettingsDidChange) name:HBFiltersChangedNotification object:job.filters];
[[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(formatChanged:) name:HBContainerChangedNotification object:job];
[[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(customSettingUsed) name:HBVideoChangedNotification object:job.video];
}
// Retain the new job
[_job autorelease];
_job = [job retain];
@ -1132,7 +1141,7 @@
}
if (action == @selector(selectPresetFromMenu:))
{
if (!self.customPreset && [menuItem.representedObject isEqualTo:self.selectedPreset])
if ([menuItem.representedObject isEqualTo:self.selectedPreset])
{
[menuItem setState:NSOnState];
}
@ -1537,7 +1546,6 @@
if (self.jobFromQueue)
{
[fPresetsView deselect];
[self pictureSettingsDidChange];
self.jobFromQueue = nil;
}
@ -1951,12 +1959,13 @@ static void queueFSEventStreamCallback(
{
HBJob *queueJob = QueueFileArray[currentQueueEncodeIndex];
// Tell HB to output a new activity log file for this encode
[outputPanel startEncodeLog:[queueJob.destURL.path stringByDeletingLastPathComponent]];
[outputPanel startEncodeLog:queueJob.destURL];
// We now flag the queue item as being owned by this instance of HB using the PID
queueJob.pidId = pidNum;
// Get the currentQueueEncodeNameString from the queue item to display in the status field */
currentQueueEncodeNameString = [[queueJob.destURL.path lastPathComponent]retain];
[currentQueueEncodeNameString autorelease];
currentQueueEncodeNameString = [[queueJob.destURL.path lastPathComponent] retain];
// We save all of the Queue data here
[self saveQueueFileItem];
@ -2477,9 +2486,6 @@ static void queueFSEventStreamCallback(
// apply the current preset
if (!self.jobFromQueue)
{
// Set Auto Crop to on upon selecting a new title
self.job.picture.autocrop = YES;
[self applyPreset:self.selectedPreset];
}
}
@ -2553,11 +2559,10 @@ static void queueFSEventStreamCallback(
*/
- (void)customSettingUsed
{
// Deselect the currently selected Preset if there is one*/
// Deselect the currently selected Preset if there is one
[fPresetsView deselect];
// Change UI to show "Custom" settings are being used */
fPresetSelectedDisplay.stringValue = NSLocalizedString(@"Custom", @"");
self.customPreset = YES;
// Change UI to show "Custom" settings are being used
self.job.presetName = NSLocalizedString(@"Custom", @"");
// If Auto Naming is on it might need to be update if it includes the quality token
if ([[NSUserDefaults standardUserDefaults] boolForKey:@"DefaultAutoNaming"])
@ -2574,12 +2579,7 @@ static void queueFSEventStreamCallback(
*/
- (void)pictureSettingsDidChange
{
// align picture settings and video filters in the UI using tabs
fVideoController.pictureSettings = self.job.picture.summary;
fVideoController.pictureFilters = self.job.filters.summary;
[fPreviewController reloadPreviews];
[self customSettingUsed];
}
@ -2672,16 +2672,6 @@ static void queueFSEventStreamCallback(
if (preset != nil && self.job)
{
self.selectedPreset = preset;
self.customPreset = NO;
if (preset.isDefault)
{
fPresetSelectedDisplay.stringValue = [NSString stringWithFormat:@"%@ (Default)", preset.name];
}
else
{
fPresetSelectedDisplay.stringValue = preset.name;
}
// Apply the preset to the current job
[self.job applyPreset:preset];
@ -2698,10 +2688,6 @@ static void queueFSEventStreamCallback(
[self updateFileName];
}
// align picture settings and video filters in the UI using tabs
fVideoController.pictureSettings = self.job.picture.summary;
fVideoController.pictureFilters = self.job.filters.summary;
[fPreviewController reloadPreviews];
}
}
@ -2764,7 +2750,7 @@ static void queueFSEventStreamCallback(
NSDictionary *currentPreset = self.selectedPreset.content;
preset[@"PresetBuildNumber"] = [NSString stringWithFormat: @"%d", [[[[NSBundle mainBundle] infoDictionary] objectForKey:@"CFBundleVersion"] intValue]];
preset[@"PresetName"] = fPresetSelectedDisplay.stringValue;
preset[@"PresetName"] = self.job.presetName;
preset[@"Folder"] = @NO;
// Set whether or not this is a user preset or factory 0 is factory, 1 is user

View File

@ -292,12 +292,12 @@
<color key="backgroundColor" name="textBackgroundColor" catalog="System" colorSpace="catalog"/>
</textFieldCell>
<connections>
<binding destination="240" name="value" keyPath="self.job.range.frameStart" id="7yg-HW-q0R"/>
<binding destination="240" name="hidden" keyPath="self.job.range.framesSelected" id="nnF-AN-v4Q">
<dictionary key="options">
<string key="NSValueTransformerName">NSNegateBoolean</string>
</dictionary>
</binding>
<binding destination="240" name="value" keyPath="self.job.range.frameStart" id="7yg-HW-q0R"/>
</connections>
</textField>
<textField hidden="YES" verticalHuggingPriority="750" id="5493">
@ -326,12 +326,12 @@
<color key="backgroundColor" name="textBackgroundColor" catalog="System" colorSpace="catalog"/>
</textFieldCell>
<connections>
<binding destination="240" name="value" keyPath="self.job.range.frameStop" id="8G6-K0-vyD"/>
<binding destination="240" name="hidden" keyPath="self.job.range.framesSelected" id="P5u-F3-Qyx">
<dictionary key="options">
<string key="NSValueTransformerName">NSNegateBoolean</string>
</dictionary>
</binding>
<binding destination="240" name="value" keyPath="self.job.range.frameStop" id="8G6-K0-vyD"/>
</connections>
</textField>
<textField verticalHuggingPriority="750" id="1627">
@ -358,6 +358,9 @@
<color key="textColor" name="controlTextColor" catalog="System" colorSpace="catalog"/>
<color key="backgroundColor" name="controlColor" catalog="System" colorSpace="catalog"/>
</textFieldCell>
<connections>
<binding destination="240" name="value" keyPath="self.job.presetName" id="R4b-YQ-IeI"/>
</connections>
</textField>
<textField verticalHuggingPriority="750" id="2006">
<rect key="frame" x="711" y="15" width="218" height="14"/>
@ -443,13 +446,13 @@
</popUpButtonCell>
<accessibility description="Start Chapter"/>
<connections>
<binding destination="240" name="selectedIndex" keyPath="self.job.range.chapterStart" previousBinding="6kP-TS-bEc" id="U76-2W-TvD"/>
<binding destination="240" name="content" keyPath="self.job.range.chapters" id="6kP-TS-bEc"/>
<binding destination="240" name="hidden" keyPath="self.job.range.chaptersSelected" id="fix-9c-5P3">
<dictionary key="options">
<string key="NSValueTransformerName">NSNegateBoolean</string>
</dictionary>
</binding>
<binding destination="240" name="selectedIndex" keyPath="self.job.range.chapterStart" previousBinding="6kP-TS-bEc" id="U76-2W-TvD"/>
<binding destination="240" name="content" keyPath="self.job.range.chapters" id="6kP-TS-bEc"/>
</connections>
</popUpButton>
<popUpButton verticalHuggingPriority="750" id="1548">
@ -466,13 +469,13 @@
</popUpButtonCell>
<accessibility description="End Chapter"/>
<connections>
<binding destination="240" name="selectedIndex" keyPath="self.job.range.chapterStop" previousBinding="Yqp-Sg-lBf" id="4k2-Sm-RoJ"/>
<binding destination="240" name="content" keyPath="self.job.range.chapters" id="Yqp-Sg-lBf"/>
<binding destination="240" name="hidden" keyPath="self.job.range.chaptersSelected" id="PxP-LY-ZXR">
<dictionary key="options">
<string key="NSValueTransformerName">NSNegateBoolean</string>
</dictionary>
</binding>
<binding destination="240" name="selectedIndex" keyPath="self.job.range.chapterStop" previousBinding="Yqp-Sg-lBf" id="4k2-Sm-RoJ"/>
<binding destination="240" name="content" keyPath="self.job.range.chapters" id="Yqp-Sg-lBf"/>
</connections>
</popUpButton>
</subviews>
@ -1025,7 +1028,6 @@ DQ
<outlet property="fMainTabView" destination="1474" id="XMU-Vi-8QM"/>
<outlet property="fOpenSourceTitleMMenu" destination="2698" id="2700"/>
<outlet property="fPresetDrawer" destination="1841" id="1889"/>
<outlet property="fPresetSelectedDisplay" destination="1882" id="1883"/>
<outlet property="fQueueStatus" destination="2006" id="2007"/>
<outlet property="fRipIndicator" destination="1373" id="1374"/>
<outlet property="fScanHorizontalLine" destination="3205" id="6004"/>

View File

@ -106,11 +106,6 @@
<color key="backgroundColor" name="textBackgroundColor" catalog="System" colorSpace="catalog"/>
</textFieldCell>
<connections>
<binding destination="-2" name="enabled" keyPath="self.picture.keepDisplayAspect" previousBinding="zMs-ue-T1n" id="gD3-Yl-3au">
<dictionary key="options">
<string key="NSValueTransformerName">NSNegateBoolean</string>
</dictionary>
</binding>
<binding destination="-2" name="hidden" keyPath="self.picture.customAnamorphicEnabled" previousBinding="gD3-Yl-3au" id="PSj-Fl-3Ni">
<dictionary key="options">
<string key="NSValueTransformerName">NSNegateBoolean</string>
@ -118,6 +113,11 @@
</binding>
<binding destination="-2" name="editable" keyPath="self.picture.customAnamorphicEnabled" id="zMs-ue-T1n"/>
<binding destination="-2" name="value" keyPath="self.picture.displayWidth" id="nMg-v2-Fvg"/>
<binding destination="-2" name="enabled" keyPath="self.picture.keepDisplayAspect" previousBinding="zMs-ue-T1n" id="gD3-Yl-3au">
<dictionary key="options">
<string key="NSValueTransformerName">NSNegateBoolean</string>
</dictionary>
</binding>
</connections>
</textField>
<textField verticalHuggingPriority="750" id="440">
@ -129,17 +129,17 @@
<color key="backgroundColor" name="textBackgroundColor" catalog="System" colorSpace="catalog"/>
</textFieldCell>
<connections>
<binding destination="-2" name="enabled" keyPath="self.picture.keepDisplayAspect" previousBinding="Wvz-jo-lwE" id="b7l-Ej-dxa">
<dictionary key="options">
<string key="NSValueTransformerName">NSNegateBoolean</string>
</dictionary>
</binding>
<binding destination="-2" name="hidden" keyPath="self.picture.customAnamorphicEnabled" previousBinding="b7l-Ej-dxa" id="4ER-Vi-m2V">
<dictionary key="options">
<string key="NSValueTransformerName">NSNegateBoolean</string>
</dictionary>
</binding>
<binding destination="-2" name="editable" keyPath="self.picture.customAnamorphicEnabled" id="Wvz-jo-lwE"/>
<binding destination="-2" name="enabled" keyPath="self.picture.keepDisplayAspect" previousBinding="Wvz-jo-lwE" id="b7l-Ej-dxa">
<dictionary key="options">
<string key="NSValueTransformerName">NSNegateBoolean</string>
</dictionary>
</binding>
<binding destination="-2" name="value" keyPath="self.picture.parWidth" id="PXg-GA-vo6"/>
</connections>
</textField>
@ -152,17 +152,17 @@
<color key="backgroundColor" name="textBackgroundColor" catalog="System" colorSpace="catalog"/>
</textFieldCell>
<connections>
<binding destination="-2" name="enabled" keyPath="self.picture.keepDisplayAspect" previousBinding="Vjg-8L-veN" id="kG8-EC-OJR">
<dictionary key="options">
<string key="NSValueTransformerName">NSNegateBoolean</string>
</dictionary>
</binding>
<binding destination="-2" name="hidden" keyPath="self.picture.customAnamorphicEnabled" previousBinding="kG8-EC-OJR" id="6PT-Pz-qs1">
<dictionary key="options">
<string key="NSValueTransformerName">NSNegateBoolean</string>
</dictionary>
</binding>
<binding destination="-2" name="editable" keyPath="self.picture.customAnamorphicEnabled" id="Vjg-8L-veN"/>
<binding destination="-2" name="enabled" keyPath="self.picture.keepDisplayAspect" previousBinding="Vjg-8L-veN" id="kG8-EC-OJR">
<dictionary key="options">
<string key="NSValueTransformerName">NSNegateBoolean</string>
</dictionary>
</binding>
<binding destination="-2" name="value" keyPath="self.picture.parHeight" id="HrI-5d-evg"/>
</connections>
</textField>
@ -201,7 +201,7 @@
<stepper horizontalHuggingPriority="750" verticalHuggingPriority="750" id="44">
<rect key="frame" x="143" y="103" width="15" height="22"/>
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMaxY="YES"/>
<stepperCell key="cell" controlSize="small" continuous="YES" alignment="left" increment="16" minValue="64" maxValue="59" doubleValue="59" id="169">
<stepperCell key="cell" controlSize="small" continuous="YES" alignment="left" increment="16" minValue="64" maxValue="59" doubleValue="64" id="169">
<font key="font" metaFont="smallSystem"/>
</stepperCell>
<connections>
@ -233,27 +233,27 @@
<rect key="frame" x="76" y="107" width="62" height="16"/>
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMaxY="YES"/>
<textFieldCell key="cell" controlSize="mini" scrollable="YES" lineBreakMode="clipping" selectable="YES" editable="YES" sendsActionOnEndEditing="YES" state="on" borderStyle="bezel" alignment="left" drawsBackground="YES" id="167">
<numberFormatter key="formatter" formatterBehavior="custom10_4" localizesFormat="NO" numberStyle="decimal" usesGroupingSeparator="NO" minimumIntegerDigits="1" maximumIntegerDigits="309" maximumFractionDigits="3" id="le0-iC-NhW">
<real key="minimum" value="64"/>
<numberFormatter key="formatter" formatterBehavior="default10_4" localizesFormat="NO" usesGroupingSeparator="NO" minimumIntegerDigits="0" maximumIntegerDigits="42" id="le0-iC-NhW">
<real key="minimum" value="32"/>
</numberFormatter>
<font key="font" metaFont="miniSystem"/>
<color key="textColor" name="textColor" catalog="System" colorSpace="catalog"/>
<color key="backgroundColor" name="textBackgroundColor" catalog="System" colorSpace="catalog"/>
</textFieldCell>
<connections>
<binding destination="-2" name="editable" keyPath="self.picture.widthEditable" id="YBx-pZ-bPA"/>
<binding destination="-2" name="value" keyPath="self.picture.width" id="Dr6-U5-h7T">
<dictionary key="options">
<integer key="NSNullPlaceholder" value="0"/>
<bool key="NSValidatesImmediately" value="YES"/>
</dictionary>
</binding>
<binding destination="-2" name="editable" keyPath="self.picture.widthEditable" id="YBx-pZ-bPA"/>
</connections>
</textField>
<stepper horizontalHuggingPriority="750" verticalHuggingPriority="750" id="46">
<rect key="frame" x="143" y="78" width="15" height="22"/>
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMaxY="YES"/>
<stepperCell key="cell" controlSize="small" continuous="YES" alignment="left" increment="16" minValue="64" maxValue="59" doubleValue="64" id="171">
<stepperCell key="cell" controlSize="small" continuous="YES" alignment="left" increment="16" minValue="64" maxValue="59" doubleValue="59" id="171">
<font key="font" metaFont="smallSystem"/>
</stepperCell>
<connections>
@ -320,24 +320,21 @@
<rect key="frame" x="76" y="81" width="62" height="16"/>
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMaxY="YES"/>
<textFieldCell key="cell" controlSize="mini" scrollable="YES" lineBreakMode="clipping" selectable="YES" editable="YES" sendsActionOnEndEditing="YES" state="on" borderStyle="bezel" alignment="left" drawsBackground="YES" id="168">
<numberFormatter key="formatter" formatterBehavior="custom10_4" localizesFormat="NO" numberStyle="decimal" usesGroupingSeparator="NO" minimumIntegerDigits="1" maximumIntegerDigits="309" maximumFractionDigits="3" id="9iU-HJ-b4u">
<numberFormatter key="formatter" formatterBehavior="default10_4" localizesFormat="NO" usesGroupingSeparator="NO" minimumIntegerDigits="0" maximumIntegerDigits="42" id="9iU-HJ-b4u">
<real key="minimum" value="64"/>
<metadata>
<real key="inspectorSampleValue" value="1.234"/>
</metadata>
</numberFormatter>
<font key="font" metaFont="miniSystem"/>
<color key="textColor" name="textColor" catalog="System" colorSpace="catalog"/>
<color key="backgroundColor" name="textBackgroundColor" catalog="System" colorSpace="catalog"/>
</textFieldCell>
<connections>
<binding destination="-2" name="editable" keyPath="self.picture.heightEditable" id="Je1-xf-WNB"/>
<binding destination="-2" name="value" keyPath="self.picture.height" id="T7h-fp-Qs6">
<dictionary key="options">
<integer key="NSNullPlaceholder" value="0"/>
<bool key="NSValidatesImmediately" value="YES"/>
</dictionary>
</binding>
<binding destination="-2" name="editable" keyPath="self.picture.heightEditable" id="Je1-xf-WNB"/>
</connections>
</textField>
<button id="45">
@ -371,13 +368,13 @@
<font key="font" metaFont="smallSystem"/>
</stepperCell>
<connections>
<binding destination="-2" name="maxValue" keyPath="self.picture.maxVerticalCrop" id="9ff-Ns-69S"/>
<binding destination="-2" name="enabled" keyPath="self.picture.autocrop" id="Vp0-sU-c5s">
<dictionary key="options">
<string key="NSValueTransformerName">NSNegateBoolean</string>
</dictionary>
</binding>
<binding destination="-2" name="value" keyPath="self.picture.cropTop" previousBinding="9ff-Ns-69S" id="4Cj-4f-6FM"/>
<binding destination="-2" name="maxValue" keyPath="self.picture.maxVerticalCrop" id="9ff-Ns-69S"/>
</connections>
</stepper>
<stepper horizontalHuggingPriority="750" verticalHuggingPriority="750" id="15">
@ -387,13 +384,13 @@
<font key="font" metaFont="smallSystem"/>
</stepperCell>
<connections>
<binding destination="-2" name="maxValue" keyPath="self.picture.maxHorizontalCrop" id="39d-dv-rDM"/>
<binding destination="-2" name="enabled" keyPath="self.picture.autocrop" id="5QD-Dh-bzl">
<dictionary key="options">
<string key="NSValueTransformerName">NSNegateBoolean</string>
</dictionary>
</binding>
<binding destination="-2" name="value" keyPath="self.picture.cropRight" previousBinding="39d-dv-rDM" id="OUg-17-HR9"/>
<binding destination="-2" name="maxValue" keyPath="self.picture.maxHorizontalCrop" id="39d-dv-rDM"/>
</connections>
</stepper>
<matrix verticalHuggingPriority="750" allowsEmptySelection="NO" autosizesCells="NO" id="16">
@ -477,13 +474,13 @@
<font key="font" metaFont="smallSystem"/>
</stepperCell>
<connections>
<binding destination="-2" name="maxValue" keyPath="self.picture.maxHorizontalCrop" id="2Rh-om-NkW"/>
<binding destination="-2" name="enabled" keyPath="self.picture.autocrop" id="WmV-2A-EDo">
<dictionary key="options">
<string key="NSValueTransformerName">NSNegateBoolean</string>
</dictionary>
</binding>
<binding destination="-2" name="value" keyPath="self.picture.cropLeft" previousBinding="2Rh-om-NkW" id="hk3-CS-WKR"/>
<binding destination="-2" name="maxValue" keyPath="self.picture.maxHorizontalCrop" id="2Rh-om-NkW"/>
</connections>
</stepper>
<textField verticalHuggingPriority="750" id="9">
@ -537,13 +534,13 @@
<font key="font" metaFont="smallSystem"/>
</stepperCell>
<connections>
<binding destination="-2" name="maxValue" keyPath="self.picture.maxVerticalCrop" id="jS8-Tg-h3O"/>
<binding destination="-2" name="enabled" keyPath="self.picture.autocrop" id="soK-UE-pde">
<dictionary key="options">
<string key="NSValueTransformerName">NSNegateBoolean</string>
</dictionary>
</binding>
<binding destination="-2" name="value" keyPath="self.picture.cropBottom" previousBinding="jS8-Tg-h3O" id="k6f-Bd-Crr"/>
<binding destination="-2" name="maxValue" keyPath="self.picture.maxVerticalCrop" id="jS8-Tg-h3O"/>
</connections>
</stepper>
<textField verticalHuggingPriority="750" id="382">

View File

@ -43,6 +43,9 @@
<rect key="frame" x="507" y="241" width="78" height="19"/>
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMinY="YES"/>
<textFieldCell key="cell" controlSize="small" scrollable="YES" lineBreakMode="clipping" selectable="YES" editable="YES" sendsActionOnEndEditing="YES" state="on" borderStyle="bezel" alignment="left" drawsBackground="YES" id="eQl-KB-XJu">
<numberFormatter key="formatter" formatterBehavior="default10_4" usesGroupingSeparator="NO" minimumIntegerDigits="0" maximumIntegerDigits="42" id="TQJ-nd-2BX">
<real key="minimum" value="0.0"/>
</numberFormatter>
<font key="font" metaFont="smallSystem"/>
<color key="textColor" name="textColor" catalog="System" colorSpace="catalog"/>
<color key="backgroundColor" name="textBackgroundColor" catalog="System" colorSpace="catalog"/>
@ -57,7 +60,15 @@
<string key="NSValueTransformerName">NSIsNotNil</string>
</dictionary>
</binding>
<binding destination="-2" name="value" keyPath="self.video.avgBitrate" id="7eN-5J-5WV"/>
<binding destination="-2" name="value" keyPath="self.video.avgBitrate" id="c27-4i-SiJ">
<dictionary key="options">
<bool key="NSContinuouslyUpdatesValue" value="YES"/>
<string key="NSNotApplicablePlaceholder">0</string>
<string key="NSNullPlaceholder">0</string>
<bool key="NSRaisesForNotApplicableKeys" value="NO"/>
<bool key="NSValidatesImmediately" value="YES"/>
</dictionary>
</binding>
<binding destination="-2" name="enabled" keyPath="self.video.qualityType" id="mjs-X8-KV8">
<dictionary key="options">
<string key="NSValueTransformerName">NSNegateBoolean</string>
@ -163,15 +174,6 @@
<font key="font" metaFont="smallSystem"/>
</buttonCell>
<connections>
<binding destination="-2" name="hidden2" keyPath="self.video.turboTwoPassSupported" previousBinding="jpH-IH-e0p" id="BFH-ET-uPq">
<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">NSNegateBoolean</string>
</dictionary>
</binding>
<binding destination="-2" name="enabled2" keyPath="self.video" previousBinding="iZE-er-OQN" id="Fbv-qd-JTg">
<dictionary key="options">
<integer key="NSMultipleValuesPlaceholder" value="-1"/>
@ -187,6 +189,15 @@
</dictionary>
</binding>
<binding destination="-2" name="value" keyPath="self.video.turboTwoPass" id="4A4-hg-qhy"/>
<binding destination="-2" name="hidden2" keyPath="self.video.turboTwoPassSupported" previousBinding="jpH-IH-e0p" id="BFH-ET-uPq">
<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">NSNegateBoolean</string>
</dictionary>
</binding>
<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>
@ -371,13 +382,13 @@
<color key="backgroundColor" name="controlColor" catalog="System" colorSpace="catalog"/>
</textFieldCell>
<connections>
<binding destination="-2" name="value" keyPath="pictureSettings" id="hem-VY-3fR"/>
<binding destination="-2" name="textColor" keyPath="self.labelColor" id="aVY-g8-jGq"/>
<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="self.job.picture.summary" id="D4c-Mx-33o"/>
</connections>
</textField>
<textField verticalHuggingPriority="750" id="PW6-gP-Dyj">
@ -389,13 +400,13 @@
<color key="backgroundColor" name="controlColor" catalog="System" colorSpace="catalog"/>
</textFieldCell>
<connections>
<binding destination="-2" name="value" keyPath="pictureFilters" id="Sr7-JI-M4y"/>
<binding destination="-2" name="textColor" keyPath="self.labelColor" id="FtS-pM-hKz"/>
<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="self.job.filters.summary" id="tHU-9i-NhZ"/>
</connections>
</textField>
</subviews>

View File

@ -60,6 +60,7 @@ typedef NS_ENUM(NSUInteger, HBJobState) {
* Current state of the job.
*/
@property (nonatomic, readwrite) HBJobState state;
@property (nonatomic, readwrite, copy) NSString *presetName;
@property (nonatomic, readwrite, assign) HBTitle *title;
@property (nonatomic, readonly) int titleIdx;
@ -71,7 +72,6 @@ typedef NS_ENUM(NSUInteger, HBJobState) {
// Libhb job
@property (nonatomic, readonly) hb_job_t *hb_job;
@property (nonatomic, readonly) NSAttributedString *jobDescription;
// Job settings
@property (nonatomic, readwrite) int container;

View File

@ -64,6 +64,15 @@ NSString *keyContainerTag = @"keyContainerTag";
- (void)applyPreset:(HBPreset *)preset
{
if (preset.isDefault)
{
self.presetName = [NSString stringWithFormat:@"%@ (Default)", preset.name];
}
else
{
self.presetName = preset.name;
}
NSDictionary *content = preset.content;
self.container = hb_container_get_from_name(hb_container_sanitize_name([content[@"FileFormat"] UTF8String]));
@ -648,6 +657,7 @@ NSString *keyContainerTag = @"keyContainerTag";
if (copy)
{
copy->_state = HBJobStateReady;
copy->_presetName = [_presetName copy];
copy->_titleIdx = _titleIdx;
copy->_pidId = _pidId;
@ -664,6 +674,8 @@ NSString *keyContainerTag = @"keyContainerTag";
copy->_picture = [_picture copy];
copy->_filters = [_filters copy];
copy->_video.job = copy;
// Copy the tracks, but not the last one because it's empty.
copy->_audioTracks = [[NSMutableArray alloc] init];
[_audioTracks enumerateObjectsUsingBlock:^(id obj, NSUInteger idx, BOOL *stop) {
@ -696,6 +708,7 @@ NSString *keyContainerTag = @"keyContainerTag";
[coder encodeInt:1 forKey:@"HBVideoVersion"];
encodeInt(_state);
encodeObject(_presetName);
encodeInt(_titleIdx);
encodeInt(_pidId);
@ -727,6 +740,7 @@ NSString *keyContainerTag = @"keyContainerTag";
self = [super init];
decodeInt(_state);
decodeObject(_presetName);
decodeInt(_titleIdx);
decodeInt(_pidId);

View File

@ -32,7 +32,7 @@
- (IBAction)openActivityLogFile:(id)sender;
- (IBAction)openEncodeLogDirectory:(id)sender;
- (IBAction)clearActivityLogFile:(id)sender;
- (void) startEncodeLog:(NSString *) logPath;
- (void) endEncodeLog;
- (void)startEncodeLog:(NSURL *)logURL;
- (void)endEncodeLog;
@end

View File

@ -107,10 +107,10 @@
}
}
- (void) startEncodeLog:(NSString *) logPath
- (void)startEncodeLog:(NSURL *)logURL
{
encodeLogOn = YES;
NSString *outputFileForEncode = logPath ;
NSString *outputFileForEncode = logURL.path ;
/* Since the destination path matches the extension of the output file, replace the
* output movie extension and replace it with ".txt"
*/

View File

@ -16,6 +16,7 @@ NSString * const HBPictureChangedNotification = @"HBPictureChangedNotification";
@interface HBPicture ()
@property (nonatomic, readwrite, getter=isValidating) BOOL validating;
@property (nonatomic, readwrite, getter=areNotificationsEnabled) BOOL notificationsEnabled;
@property (nonatomic, readwrite) int keep;
@property (nonatomic, readwrite) BOOL darUpdated;
@ -49,15 +50,20 @@ NSString * const HBPictureChangedNotification = @"HBPictureChangedNotification";
_height = title.hb_title->geometry.height;
[self validateSettings];
_notificationsEnabled = YES;
}
return self;
}
- (void)postChangedNotification
{
[[NSNotificationCenter defaultCenter] postNotification: [NSNotification notificationWithName:HBPictureChangedNotification
object:self
userInfo:nil]];
if (self.areNotificationsEnabled)
{
[[NSNotificationCenter defaultCenter] postNotification: [NSNotification notificationWithName:HBPictureChangedNotification
object:self
userInfo:nil]];
}
}
- (void)setWidth:(int)width
@ -345,7 +351,7 @@ NSString * const HBPictureChangedNotification = @"HBPictureChangedNotification";
retval = [NSSet setWithObjects:@"cropTop", @"cropBottom", @"cropLeft", @"cropRight", nil];
}
if ([key isEqualToString:@"info"])
if ([key isEqualToString:@"info"] || [key isEqualToString:@"summary"])
{
retval = [NSSet setWithObjects:@"width", @"height",@"anamorphicMode", @"cropTop", @"cropBottom", @"cropLeft", @"cropRight", nil];
}
@ -353,6 +359,11 @@ NSString * const HBPictureChangedNotification = @"HBPictureChangedNotification";
return retval;
}
- (void)setNilValueForKey:(NSString *)key
{
[self setValue:@0 forKey:key];
}
#pragma mark - Picture Update Logic
/**
@ -437,6 +448,8 @@ NSString * const HBPictureChangedNotification = @"HBPictureChangedNotification";
copy->_cropBottom = _cropBottom;
copy->_cropLeft = _cropLeft;
copy->_cropRight = _cropRight;
copy->_notificationsEnabled = _notificationsEnabled;
}
return copy;
@ -487,6 +500,8 @@ NSString * const HBPictureChangedNotification = @"HBPictureChangedNotification";
decodeInt(_cropLeft);
decodeInt(_cropRight);
_notificationsEnabled = YES;
return self;
}
@ -510,6 +525,7 @@ NSString * const HBPictureChangedNotification = @"HBPictureChangedNotification";
- (void)applyPreset:(NSDictionary *)preset
{
self.validating = YES;
self.notificationsEnabled = NO;
hb_title_t *title = self.title.hb_title;
/* Note: objectForKey:@"UsesPictureSettings" refers to picture size, which encompasses:
@ -634,6 +650,7 @@ NSString * const HBPictureChangedNotification = @"HBPictureChangedNotification";
self.displayWidth = display_width;
self.validating = NO;
self.notificationsEnabled = YES;
}
@end

View File

@ -55,6 +55,7 @@
NSMutableIndexSet *fSavedExpandedItems; // used by save/restoreOutlineViewState to preserve which items are expanded
NSMutableIndexSet *fSavedSelectedItems; // used by save/restoreOutlineViewState to preserve which items are selected
NSMutableDictionary *descriptions;
NSTimer *fAnimationTimer; // animates the icon of the current job in the queue outline view
int fAnimationIndex; // used to generate name of image used to animate the current job in the queue outline view
@ -102,6 +103,7 @@
[[NSUserDefaults standardUserDefaults] registerDefaults:@{@"QueueWindowIsOpen": @"NO"}];
fJobGroups = [[NSMutableArray arrayWithCapacity:0] retain];
descriptions = [[NSMutableDictionary alloc] init];
[self initStyles];
}
@ -112,6 +114,7 @@
- (void)setQueueArray:(NSMutableArray *)QueueFileArray
{
[fJobGroups setArray:QueueFileArray];
[descriptions removeAllObjects];
[fOutlineView reloadData];
@ -705,10 +708,16 @@
{
if ([[tableColumn identifier] isEqualToString:@"desc"])
{
HBJob *job = item;
if ([descriptions objectForKey:@(job.hash)])
{
return [descriptions objectForKey:@(job.hash)];
}
NSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init];
/* Below should be put into a separate method but I am way too f'ing lazy right now */
NSMutableAttributedString *finalString = [[NSMutableAttributedString alloc] initWithString: @""];
HBJob *job = item;
/* First line, we should strip the destination path and just show the file name and add the title num and chapters (if any) */
NSString *summaryInfo;
@ -770,10 +779,8 @@
// End of Title Stuff
// Second Line (Preset Name)
// FIXME
//[finalString appendString: @"Preset: " withAttributes:detailBoldAttr];
//[finalString appendString:[NSString stringWithFormat:@"%@\n", item[@"PresetName"]] withAttributes:detailAttr];
[finalString appendString: @"Preset: " withAttributes:detailBoldAttr];
[finalString appendString:[NSString stringWithFormat:@"%@\n", job.presetName] withAttributes:detailAttr];
// Third Line (Format Summary)
NSString *audioCodecSummary = @""; // This seems to be set by the last track we have available...
@ -1057,6 +1064,8 @@
[pool release];
[descriptions setObject:finalString forKey:@(job.hash)];
return [finalString autorelease];
}
else if ([[tableColumn identifier] isEqualToString:@"icon"])

View File

@ -105,6 +105,11 @@
return retval;
}
- (void)setNilValueForKey:(NSString *)key
{
[self setValue:@0 forKey:key];
}
#pragma mark - NSCopying
- (instancetype)copyWithZone:(NSZone *)zone

View File

@ -105,17 +105,17 @@
}
else if ([formatKey isEqualToString:@"{Quality/Bitrate}"])
{
if (quality)
if (bitrate)
{
[name appendString:@"abr"];
[name appendString:[NSString stringWithFormat:@"%d", bitrate]];
}
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:[NSString stringWithFormat:@"%0.2f", quality]];
}
else
{
[name appendString:@"abr"];
[name appendString:[NSString stringWithFormat:@"%d", bitrate]];
}
}
else
{

View File

@ -69,7 +69,7 @@
- (BOOL)fastDecodeSupported
{
return (self.encoder == HB_VCODEC_X264);
return (self.encoder == HB_VCODEC_X264 || self.encoder == HB_VCODEC_X265);
}
- (BOOL)turboTwoPassSupported

View File

@ -272,6 +272,11 @@ NSString * const HBVideoChangedNotification = @"HBVideoChangedNotification";
return retval;
}
- (void)setNilValueForKey:(NSString *)key
{
[self setValue:@0 forKey:key];
}
#pragma mark -
- (NSArray *)presets
@ -371,6 +376,8 @@ NSString * const HBVideoChangedNotification = @"HBVideoChangedNotification";
copy->_level = [_level copy];
copy->_videoOptionExtra = [_videoOptionExtra copy];
copy->_fastDecode = _fastDecode;
copy->_notificationsEnabled = _notificationsEnabled;
}
return copy;
@ -437,6 +444,8 @@ NSString * const HBVideoChangedNotification = @"HBVideoChangedNotification";
decodeBool(_fastDecode);
_notificationsEnabled = YES;
return self;
}

View File

@ -7,7 +7,7 @@
#import <Cocoa/Cocoa.h>
@class HBAdvancedController;
@class HBVideo;
@class HBJob;
/**
* HBVideoController
@ -16,12 +16,6 @@
- (instancetype)initWithAdvancedController:(HBAdvancedController *)advancedController;
/**
* Summaries of the pictures and filters settings
*/
@property (nonatomic, copy, readwrite) NSString *pictureSettings;
@property (nonatomic, copy, readwrite) NSString *pictureFilters;
@property (nonatomic, readwrite, assign) HBVideo *video;
@property (nonatomic, readwrite, assign) HBJob *job;
@end

View File

@ -7,6 +7,7 @@
#import "HBVideoController.h"
#import "HBAdvancedController.h"
#import "HBVideo+UIAdditions.h"
#import "HBJob.h"
#include "hb.h"
@ -36,6 +37,7 @@ static void *HBVideoControllerContext = &HBVideoControllerContext;
}
@property (nonatomic, retain, readwrite) HBAdvancedController *advancedController;
@property (nonatomic, readwrite, assign) HBVideo *video;
@property (nonatomic, readwrite) BOOL presetViewEnabled;
@ -84,11 +86,12 @@ static void *HBVideoControllerContext = &HBVideoControllerContext;
return self;
}
- (void)setVideo:(HBVideo *)video
- (void)setJob:(HBJob *)job
{
_video = video;
_job = job;
self.video = job.video;
if (_video)
if (job)
{
self.labelColor = [NSColor controlTextColor];
}
@ -97,7 +100,7 @@ static void *HBVideoControllerContext = &HBVideoControllerContext;
self.labelColor = [NSColor disabledControlTextColor];
}
[self enableEncoderOptionsWidgets:(video != nil)];
[self enableEncoderOptionsWidgets:(job != nil)];
}
#pragma mark - KVO