Add the options to fix the fallbacks to the gui.

This commit is contained in:
Damiano Galassi committed 2015-11-24 15:10:17 +01:00
1 parent 8ba668a616
commit 56c4dcfc29
9 files changed
+99 -21

No files matched your search

+10
View File
@@ -385,6 +385,9 @@
if (action == @selector(iTunesFriendlyTrackGroups:))
return YES;
if (action == @selector(fixAudioFallbacks:))
return YES;
if (action == @selector(export:) && [fileTracksTable selectedRow] != -1)
if ([[self.mp4 trackAtIndex:[fileTracksTable selectedRow]] respondsToSelector:@selector(exportToURL:error:)] &&
[[self.mp4 trackAtIndex:[fileTracksTable selectedRow]] muxed])
@@ -951,6 +954,13 @@ objectValueForTableColumn:(NSTableColumn *)tableColumn
[self updateChangeCount:NSChangeDone];
}
- (IBAction)fixAudioFallbacks:(id)sender {
[self.mp4 setAutoFallback];
[fileTracksTable reloadData];
[self reloadPropertyView];
[self updateChangeCount:NSChangeDone];
}
// Drag & Drop
- (NSDragOperation)draggingEntered:(id <NSDraggingInfo>)sender {
+6
View File
@@ -60,4 +60,10 @@ NS_ASSUME_NONNULL_BEGIN
@interface SBQueueOrganizeGroupsAction : NSObject <SBQueueActionProtocol>
@end
/**
* An actions that fix the item tracks' fallbacks.
*/
@interface SBQueueFixFallbacksAction : NSObject <SBQueueActionProtocol>
@end
NS_ASSUME_NONNULL_END
+26
View File
@@ -301,5 +301,31 @@
- (void)encodeWithCoder:(NSCoder *)coder {
}
@end
/**
* An actions that fix the item tracks' fallbacks.
*/
@implementation SBQueueFixFallbacksAction : NSObject
- (void)runAction:(SBQueueItem *)item {
[item.mp4File setAutoFallback];
}
- (NSString *)description {
return NSLocalizedString(@"Fixing Fallbacks", @"");
}
- (NSString *)localizedDescription {
return NSLocalizedString(@"Fixing Fallbacks", @"");
}
- (instancetype)initWithCoder:(NSCoder *)coder {
self = [super init];
return self;
}
- (void)encodeWithCoder:(NSCoder *)coder {
}
@end
+4
View File
@@ -265,6 +265,10 @@ static void *SBQueueContex = &SBQueueContex;
[item addAction:[[[SBQueueOrganizeGroupsAction alloc] init] autorelease]];
}
if ([[self.options objectForKey:SBQueueFixFallbacks] boolValue]) {
[item addAction:[[[SBQueueFixFallbacksAction alloc] init] autorelease]];
}
if ([self.options objectForKey:SBQueueSet]) {
[item addAction:[[[SBQueueSetAction alloc] initWithSet:[self.options objectForKey:SBQueueSet]] autorelease]];
}
+1
View File
@@ -12,6 +12,7 @@ NS_ASSUME_NONNULL_BEGIN
extern NSString * const SBQueueFileType;
extern NSString * const SBQueueOrganize;
extern NSString * const SBQueueFixFallbacks;
extern NSString * const SBQueueMetadata;
extern NSString * const SBQueueSubtitles;
extern NSString * const SBQueueSet;
+4 -2
View File
@@ -13,6 +13,7 @@
NSString * const SBQueueFileType = @"SBQueueFileType";
NSString * const SBQueueOrganize = @"SBQueueOrganize";
NSString * const SBQueueFixFallbacks = @"SBQueueFixFallbacks";
NSString * const SBQueueMetadata = @"SBQueueMetadata";
NSString * const SBQueueSubtitles = @"SBQueueSubtitles";
@@ -36,7 +37,7 @@ NSString * const SBQueueSet = @"SBQueueSet";
if (self) {
_options = [[NSMutableDictionary alloc] init];
NSArray *keys = @[SBQueueFileType, SBQueueOrganize, SBQueueMetadata, SBQueueSubtitles, SBQueueAutoStart, SBQueueOptimize,
NSArray *keys = @[SBQueueFileType, SBQueueOrganize, SBQueueFixFallbacks, SBQueueMetadata, SBQueueSubtitles, SBQueueAutoStart, SBQueueOptimize,
SBQueueMovieProvider, SBQueueTVShowProvider, SBQueueMovieProviderLanguage, SBQueueTVShowProviderLanguage];
[keys enumerateObjectsUsingBlock:^(id obj, NSUInteger idx, BOOL *stop) {
@@ -61,6 +62,7 @@ NSString * const SBQueueSet = @"SBQueueSet";
+ (void)registerUserDefaults {
[[NSUserDefaults standardUserDefaults] registerDefaults:@{ SBQueueFileType : @"mp4",
SBQueueOrganize : @YES,
SBQueueFixFallbacks: @NO,
SBQueueMetadata : @NO,
SBQueueSubtitles: @YES,
SBQueueAutoStart: @NO,
@@ -75,7 +77,7 @@ NSString * const SBQueueSet = @"SBQueueSet";
* Save the queue user defaults
*/
- (void)saveUserDefaults {
NSArray<NSString *> *keys = @[SBQueueFileType, SBQueueOrganize, SBQueueMetadata, SBQueueSubtitles, SBQueueAutoStart, SBQueueOptimize,
NSArray<NSString *> *keys = @[SBQueueFileType, SBQueueOrganize, SBQueueFixFallbacks, SBQueueMetadata, SBQueueSubtitles, SBQueueAutoStart, SBQueueOptimize,
SBQueueMovieProvider, SBQueueTVShowProvider, SBQueueMovieProviderLanguage, SBQueueTVShowProviderLanguage];
[keys enumerateObjectsUsingBlock:^(id obj, NSUInteger idx, BOOL *stop) {
+8 -2
View File
@@ -1,8 +1,8 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<document type="com.apple.InterfaceBuilder3.Cocoa.XIB" version="3.0" toolsVersion="8191" systemVersion="15A282a" targetRuntime="MacOSX.Cocoa" propertyAccessControl="none">
<document type="com.apple.InterfaceBuilder3.Cocoa.XIB" version="3.0" toolsVersion="9060" systemVersion="15C47a" targetRuntime="MacOSX.Cocoa" propertyAccessControl="none">
<dependencies>
<deployment identifier="macosx"/>
<plugIn identifier="com.apple.InterfaceBuilder.CocoaPlugin" version="8191"/>
<plugIn identifier="com.apple.InterfaceBuilder.CocoaPlugin" version="9060"/>
</dependencies>
<objects>
<customObject id="-2" userLabel="File's Owner" customClass="NSApplication">
@@ -316,6 +316,12 @@
<action selector="iTunesFriendlyTrackGroups:" target="-1" id="654"/>
</connections>
</menuItem>
<menuItem title="Fix audio fallbacks" id="FXb-bX-0Wb">
<modifierMask key="keyEquivalentModifierMask"/>
<connections>
<action selector="fixAudioFallbacks:" target="-1" id="cpY-If-3df"/>
</connections>
</menuItem>
<menuItem isSeparatorItem="YES" id="568"/>
<menuItem title="Find" id="218">
<menu key="submenu" title="Find" id="220">
+31 -14
View File
@@ -1,8 +1,8 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<document type="com.apple.InterfaceBuilder3.Cocoa.XIB" version="3.0" toolsVersion="8187.4" systemVersion="15A262e" targetRuntime="MacOSX.Cocoa" propertyAccessControl="none">
<document type="com.apple.InterfaceBuilder3.Cocoa.XIB" version="3.0" toolsVersion="9060" systemVersion="15C47a" targetRuntime="MacOSX.Cocoa" propertyAccessControl="none">
<dependencies>
<deployment identifier="macosx"/>
<plugIn identifier="com.apple.InterfaceBuilder.CocoaPlugin" version="8187.4"/>
<plugIn identifier="com.apple.InterfaceBuilder.CocoaPlugin" version="9060"/>
</dependencies>
<objects>
<customObject id="-2" userLabel="File's Owner" customClass="SBOptionsViewController">
@@ -14,7 +14,7 @@
<customObject id="-1" userLabel="First Responder" customClass="FirstResponder"/>
<customObject id="-3" userLabel="Application" customClass="NSObject"/>
<customView id="UlG-O3-eNc" userLabel="OptionsView">
<rect key="frame" x="0.0" y="0.0" width="334" height="281"/>
<rect key="frame" x="0.0" y="0.0" width="334" height="299"/>
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMinY="YES"/>
<subviews>
<button id="zEH-aV-Tl7">
@@ -34,7 +34,7 @@
</connections>
</button>
<button toolTip="Search metadata online" id="9GN-f6-r2j">
<rect key="frame" x="111" y="255" width="112" height="18"/>
<rect key="frame" x="111" y="273" width="112" height="18"/>
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMinY="YES"/>
<animations/>
<buttonCell key="cell" type="check" title="Fetch Metadata" bezelStyle="regularSquare" imagePosition="left" alignment="left" controlSize="small" state="on" inset="2" id="QNO-e1-WUJ">
@@ -66,7 +66,7 @@
</connections>
</button>
<button toolTip="Organize the mp4 alternate groups" id="ccd-Xn-Dj3">
<rect key="frame" x="111" y="140" width="112" height="18"/>
<rect key="frame" x="111" y="158" width="112" height="18"/>
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMinY="YES"/>
<animations/>
<buttonCell key="cell" type="check" title="Organize Groups" bezelStyle="regularSquare" imagePosition="left" alignment="left" controlSize="small" state="on" inset="2" id="240-c7-2UW">
@@ -170,7 +170,7 @@
</textFieldCell>
</textField>
<textField verticalHuggingPriority="750" id="eTL-yP-QQ5">
<rect key="frame" x="124" y="236" width="47" height="14"/>
<rect key="frame" x="124" y="254" width="47" height="14"/>
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMinY="YES"/>
<animations/>
<textFieldCell key="cell" controlSize="small" scrollable="YES" lineBreakMode="clipping" sendsActionOnEndEditing="YES" title="Movies:" id="W6m-cd-JMe">
@@ -183,7 +183,7 @@
</connections>
</textField>
<textField verticalHuggingPriority="750" id="bDo-OD-bck">
<rect key="frame" x="124" y="190" width="63" height="14"/>
<rect key="frame" x="124" y="208" width="63" height="14"/>
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMinY="YES"/>
<animations/>
<textFieldCell key="cell" controlSize="small" scrollable="YES" lineBreakMode="clipping" sendsActionOnEndEditing="YES" title="TV Shows:" id="PCe-Pw-D2s">
@@ -206,7 +206,7 @@
</textFieldCell>
</textField>
<textField verticalHuggingPriority="750" id="S7L-mA-j3Y">
<rect key="frame" x="49" y="257" width="59" height="14"/>
<rect key="frame" x="49" y="275" width="59" height="14"/>
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMinY="YES"/>
<animations/>
<textFieldCell key="cell" controlSize="small" scrollable="YES" lineBreakMode="clipping" sendsActionOnEndEditing="YES" title="Add item:" id="9ls-xq-YGz">
@@ -246,7 +246,7 @@
</connections>
</popUpButton>
<popUpButton verticalHuggingPriority="750" id="ZVm-yi-3cE">
<rect key="frame" x="177" y="234" width="111" height="17"/>
<rect key="frame" x="177" y="252" width="111" height="17"/>
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMinY="YES"/>
<animations/>
<popUpButtonCell key="cell" type="roundRect" bezelStyle="roundedRect" alignment="left" controlSize="small" lineBreakMode="truncatingTail" borderStyle="border" imageScaling="proportionallyDown" inset="2" id="CbR-eu-sGI">
@@ -271,7 +271,7 @@
</connections>
</popUpButton>
<popUpButton verticalHuggingPriority="750" id="tLh-V3-OfB">
<rect key="frame" x="193" y="188" width="111" height="17"/>
<rect key="frame" x="193" y="206" width="111" height="17"/>
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMinY="YES"/>
<animations/>
<popUpButtonCell key="cell" type="roundRect" bezelStyle="roundedRect" alignment="left" controlSize="small" lineBreakMode="truncatingTail" borderStyle="border" imageScaling="proportionallyDown" inset="2" id="UOb-Qe-IPw">
@@ -296,7 +296,7 @@
</connections>
</popUpButton>
<textField verticalHuggingPriority="750" id="BWL-Nn-iGH">
<rect key="frame" x="134" y="170" width="62" height="14"/>
<rect key="frame" x="134" y="188" width="62" height="14"/>
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMinY="YES"/>
<animations/>
<textFieldCell key="cell" controlSize="small" scrollable="YES" lineBreakMode="clipping" sendsActionOnEndEditing="YES" title="Language:" id="1dC-y4-0rx">
@@ -309,7 +309,7 @@
</connections>
</textField>
<popUpButton verticalHuggingPriority="750" id="Ce4-O7-Iu4">
<rect key="frame" x="203" y="168" width="111" height="17"/>
<rect key="frame" x="203" y="186" width="111" height="17"/>
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMinY="YES"/>
<animations/>
<popUpButtonCell key="cell" type="roundRect" bezelStyle="roundedRect" alignment="left" controlSize="small" lineBreakMode="truncatingTail" borderStyle="border" imageScaling="proportionallyDown" inset="2" id="nqF-p0-mT7">
@@ -334,7 +334,7 @@
</connections>
</popUpButton>
<textField verticalHuggingPriority="750" id="73q-gi-fe2">
<rect key="frame" x="134" y="216" width="62" height="14"/>
<rect key="frame" x="134" y="234" width="62" height="14"/>
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMinY="YES"/>
<animations/>
<textFieldCell key="cell" controlSize="small" scrollable="YES" lineBreakMode="clipping" sendsActionOnEndEditing="YES" title="Language:" id="VkG-jW-ibO">
@@ -347,7 +347,7 @@
</connections>
</textField>
<popUpButton verticalHuggingPriority="750" id="5rh-cM-iOg">
<rect key="frame" x="203" y="214" width="111" height="17"/>
<rect key="frame" x="203" y="232" width="111" height="17"/>
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMinY="YES"/>
<animations/>
<popUpButtonCell key="cell" type="roundRect" bezelStyle="roundedRect" alignment="left" controlSize="small" lineBreakMode="truncatingTail" borderStyle="border" imageScaling="proportionallyDown" inset="2" id="gZb-sF-UQs">
@@ -371,8 +371,25 @@
<binding destination="-2" name="enabled" keyPath="self.options.SBQueueMetadata" id="ABT-BG-W0N"/>
</connections>
</popUpButton>
<button toolTip="Organize the mp4 alternate groups" id="TV6-Sk-Bqr">
<rect key="frame" x="111" y="140" width="119" height="18"/>
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMinY="YES"/>
<animations/>
<buttonCell key="cell" type="check" title="Fix audio fallbacks" bezelStyle="regularSquare" imagePosition="left" alignment="left" controlSize="small" state="on" inset="2" id="W6u-1c-BsI">
<behavior key="behavior" changeContents="YES" doesNotDimImage="YES" lightByContents="YES"/>
<font key="font" metaFont="smallSystem"/>
</buttonCell>
<connections>
<binding destination="-2" name="value" keyPath="self.options.SBQueueFixFallbacks" id="U7y-tJ-Bmc">
<dictionary key="options">
<bool key="NSValidatesImmediately" value="YES"/>
</dictionary>
</binding>
</connections>
</button>
</subviews>
<animations/>
<point key="canvasLocation" x="486" y="599.5"/>
</customView>
<arrayController objectClassName="Set" automaticallyPreparesContent="YES" id="vyv-na-Xpo" userLabel="Set Controller">
<declaredKeys>
+9 -3
View File
@@ -1,8 +1,8 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<document type="com.apple.InterfaceBuilder3.Cocoa.XIB" version="3.0" toolsVersion="8191" systemVersion="15A282a" targetRuntime="MacOSX.Cocoa" propertyAccessControl="none">
<document type="com.apple.InterfaceBuilder3.Cocoa.XIB" version="3.0" toolsVersion="9060" systemVersion="15C47a" targetRuntime="MacOSX.Cocoa" propertyAccessControl="none">
<dependencies>
<deployment identifier="macosx"/>
<plugIn identifier="com.apple.InterfaceBuilder.CocoaPlugin" version="8191"/>
<plugIn identifier="com.apple.InterfaceBuilder.CocoaPlugin" version="9060"/>
</dependencies>
<objects>
<customObject id="-2" userLabel="File's Owner" customClass="SBDocument">
@@ -55,7 +55,7 @@
<autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
<subviews>
<tableView verticalHuggingPriority="750" allowsExpansionToolTips="YES" alternatingRowBackgroundColors="YES" columnSelection="YES" multipleSelection="NO" autosaveColumns="NO" headerView="100032" id="100031" customClass="SBTableView">
<rect key="frame" x="0.0" y="0.0" width="690" height="126"/>
<rect key="frame" x="0.0" y="0.0" width="690" height="19"/>
<autoresizingMask key="autoresizingMask"/>
<animations/>
<size key="intercellSpacing" width="3" height="2"/>
@@ -274,6 +274,12 @@
<action selector="iTunesFriendlyTrackGroups:" target="-2" id="100348"/>
</connections>
</menuItem>
<menuItem title="Fix audio fallbacks" id="VSf-dv-fCc">
<modifierMask key="keyEquivalentModifierMask"/>
<connections>
<action selector="fixAudioFallbacks:" target="-2" id="b3Z-jH-svh"/>
</connections>
</menuItem>
<menuItem isSeparatorItem="YES" id="83X-pX-gUO"/>
<menuItem title="Offset…" id="lZI-ub-uVG">
<modifierMask key="keyEquivalentModifierMask"/>