Add a queue action to rename chapters.
This commit is contained in:
5 files changed
+74
-30
No files matched your search
+38
-21
@@ -15,7 +15,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="382" height="506"/>
|
||||
<rect key="frame" x="0.0" y="0.0" width="382" height="524"/>
|
||||
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMinY="YES"/>
|
||||
<subviews>
|
||||
<button translatesAutoresizingMaskIntoConstraints="NO" id="zEH-aV-Tl7">
|
||||
@@ -33,7 +33,7 @@
|
||||
</connections>
|
||||
</button>
|
||||
<button toolTip="Clear existing metadata" translatesAutoresizingMaskIntoConstraints="NO" id="9GN-f6-r2j">
|
||||
<rect key="frame" x="110" y="480" width="146" height="18"/>
|
||||
<rect key="frame" x="110" y="498" width="146" height="18"/>
|
||||
<buttonCell key="cell" type="check" title="Clear existing metadata" bezelStyle="regularSquare" imagePosition="left" alignment="left" controlSize="small" state="on" inset="2" id="QNO-e1-WUJ">
|
||||
<behavior key="behavior" changeContents="YES" doesNotDimImage="YES" lightByContents="YES"/>
|
||||
<font key="font" metaFont="smallSystem"/>
|
||||
@@ -61,7 +61,7 @@
|
||||
</connections>
|
||||
</button>
|
||||
<button toolTip="Organize the mp4 alternate groups" translatesAutoresizingMaskIntoConstraints="NO" id="ccd-Xn-Dj3">
|
||||
<rect key="frame" x="110" y="317" width="111" height="18"/>
|
||||
<rect key="frame" x="110" y="335" width="111" height="18"/>
|
||||
<buttonCell key="cell" type="check" title="Organize Groups" bezelStyle="regularSquare" imagePosition="left" alignment="left" controlSize="small" state="on" inset="2" id="240-c7-2UW">
|
||||
<behavior key="behavior" changeContents="YES" doesNotDimImage="YES" lightByContents="YES"/>
|
||||
<font key="font" metaFont="smallSystem"/>
|
||||
@@ -75,7 +75,7 @@
|
||||
</connections>
|
||||
</button>
|
||||
<button toolTip="Load the external srt subtitles file" translatesAutoresizingMaskIntoConstraints="NO" id="etc-K7-Atw">
|
||||
<rect key="frame" x="110" y="281" width="142" height="18"/>
|
||||
<rect key="frame" x="110" y="299" width="142" height="18"/>
|
||||
<buttonCell key="cell" type="check" title="Load external subtitles" bezelStyle="regularSquare" imagePosition="left" alignment="left" controlSize="small" state="on" inset="2" id="59T-kp-mV1">
|
||||
<behavior key="behavior" changeContents="YES" doesNotDimImage="YES" lightByContents="YES"/>
|
||||
<font key="font" metaFont="smallSystem"/>
|
||||
@@ -159,7 +159,7 @@
|
||||
</textFieldCell>
|
||||
</textField>
|
||||
<textField verticalHuggingPriority="750" allowsCharacterPickerTouchBarItem="YES" preferredMaxLayoutWidth="200" translatesAutoresizingMaskIntoConstraints="NO" id="eTL-yP-QQ5">
|
||||
<rect key="frame" x="123" y="441" width="48" height="14"/>
|
||||
<rect key="frame" x="123" y="459" width="48" height="14"/>
|
||||
<textFieldCell key="cell" controlSize="small" scrollable="YES" lineBreakMode="clipping" sendsActionOnEndEditing="YES" title="Movies:" id="W6m-cd-JMe">
|
||||
<font key="font" metaFont="smallSystemBold"/>
|
||||
<color key="textColor" name="controlTextColor" catalog="System" colorSpace="catalog"/>
|
||||
@@ -170,7 +170,7 @@
|
||||
</connections>
|
||||
</textField>
|
||||
<textField verticalHuggingPriority="750" allowsCharacterPickerTouchBarItem="YES" preferredMaxLayoutWidth="200" translatesAutoresizingMaskIntoConstraints="NO" id="bDo-OD-bck">
|
||||
<rect key="frame" x="123" y="395" width="63" height="14"/>
|
||||
<rect key="frame" x="123" y="413" width="63" height="14"/>
|
||||
<textFieldCell key="cell" controlSize="small" scrollable="YES" lineBreakMode="clipping" sendsActionOnEndEditing="YES" title="TV Shows:" id="PCe-Pw-D2s">
|
||||
<font key="font" metaFont="smallSystemBold"/>
|
||||
<color key="textColor" name="controlTextColor" catalog="System" colorSpace="catalog"/>
|
||||
@@ -189,7 +189,7 @@
|
||||
</textFieldCell>
|
||||
</textField>
|
||||
<textField verticalHuggingPriority="750" allowsCharacterPickerTouchBarItem="YES" preferredMaxLayoutWidth="200" translatesAutoresizingMaskIntoConstraints="NO" id="S7L-mA-j3Y">
|
||||
<rect key="frame" x="18" y="482" width="89" height="14"/>
|
||||
<rect key="frame" x="18" y="500" width="89" height="14"/>
|
||||
<textFieldCell key="cell" controlSize="small" scrollable="YES" lineBreakMode="clipping" sendsActionOnEndEditing="YES" alignment="right" title="Add item:" id="9ls-xq-YGz">
|
||||
<font key="font" metaFont="smallSystemBold"/>
|
||||
<color key="textColor" name="controlTextColor" catalog="System" colorSpace="catalog"/>
|
||||
@@ -226,7 +226,7 @@
|
||||
</connections>
|
||||
</popUpButton>
|
||||
<popUpButton verticalHuggingPriority="750" translatesAutoresizingMaskIntoConstraints="NO" id="ZVm-yi-3cE">
|
||||
<rect key="frame" x="177" y="440" width="111" height="17"/>
|
||||
<rect key="frame" x="177" y="458" width="111" height="17"/>
|
||||
<constraints>
|
||||
<constraint firstAttribute="width" relation="greaterThanOrEqual" constant="111" id="GuB-yU-C8O"/>
|
||||
</constraints>
|
||||
@@ -253,7 +253,7 @@
|
||||
</connections>
|
||||
</popUpButton>
|
||||
<popUpButton verticalHuggingPriority="750" translatesAutoresizingMaskIntoConstraints="NO" id="tLh-V3-OfB">
|
||||
<rect key="frame" x="192" y="394" width="111" height="17"/>
|
||||
<rect key="frame" x="192" y="412" width="111" height="17"/>
|
||||
<popUpButtonCell key="cell" type="roundRect" bezelStyle="roundedRect" alignment="left" controlSize="small" lineBreakMode="truncatingTail" borderStyle="border" imageScaling="proportionallyDown" inset="2" id="UOb-Qe-IPw">
|
||||
<behavior key="behavior" pushIn="YES" lightByBackground="YES" lightByGray="YES"/>
|
||||
<font key="font" metaFont="smallSystem"/>
|
||||
@@ -277,7 +277,7 @@
|
||||
</connections>
|
||||
</popUpButton>
|
||||
<textField verticalHuggingPriority="750" allowsCharacterPickerTouchBarItem="YES" preferredMaxLayoutWidth="200" translatesAutoresizingMaskIntoConstraints="NO" id="BWL-Nn-iGH">
|
||||
<rect key="frame" x="133" y="375" width="63" height="14"/>
|
||||
<rect key="frame" x="133" y="393" width="63" height="14"/>
|
||||
<textFieldCell key="cell" controlSize="small" scrollable="YES" lineBreakMode="clipping" sendsActionOnEndEditing="YES" title="Language:" id="1dC-y4-0rx">
|
||||
<font key="font" metaFont="smallSystemBold"/>
|
||||
<color key="textColor" name="controlTextColor" catalog="System" colorSpace="catalog"/>
|
||||
@@ -288,7 +288,7 @@
|
||||
</connections>
|
||||
</textField>
|
||||
<textField verticalHuggingPriority="750" allowsCharacterPickerTouchBarItem="YES" preferredMaxLayoutWidth="200" translatesAutoresizingMaskIntoConstraints="NO" id="Ns9-7q-hsh">
|
||||
<rect key="frame" x="123" y="348" width="54" height="14"/>
|
||||
<rect key="frame" x="123" y="366" width="54" height="14"/>
|
||||
<textFieldCell key="cell" controlSize="small" scrollable="YES" lineBreakMode="clipping" sendsActionOnEndEditing="YES" title="Artwork:" id="1HP-Np-D97">
|
||||
<font key="font" metaFont="smallSystemBold"/>
|
||||
<color key="textColor" name="controlTextColor" catalog="System" colorSpace="catalog"/>
|
||||
@@ -299,7 +299,7 @@
|
||||
</connections>
|
||||
</textField>
|
||||
<popUpButton verticalHuggingPriority="750" translatesAutoresizingMaskIntoConstraints="NO" id="Ce4-O7-Iu4">
|
||||
<rect key="frame" x="202" y="374" width="111" height="17"/>
|
||||
<rect key="frame" x="202" y="392" width="111" height="17"/>
|
||||
<popUpButtonCell key="cell" type="roundRect" bezelStyle="roundedRect" alignment="left" controlSize="small" lineBreakMode="truncatingTail" borderStyle="border" imageScaling="proportionallyDown" inset="2" id="nqF-p0-mT7">
|
||||
<behavior key="behavior" pushIn="YES" lightByBackground="YES" lightByGray="YES"/>
|
||||
<font key="font" metaFont="smallSystem"/>
|
||||
@@ -324,7 +324,7 @@
|
||||
</connections>
|
||||
</popUpButton>
|
||||
<textField verticalHuggingPriority="750" allowsCharacterPickerTouchBarItem="YES" preferredMaxLayoutWidth="200" translatesAutoresizingMaskIntoConstraints="NO" id="73q-gi-fe2">
|
||||
<rect key="frame" x="133" y="421" width="63" height="14"/>
|
||||
<rect key="frame" x="133" y="439" width="63" height="14"/>
|
||||
<textFieldCell key="cell" controlSize="small" scrollable="YES" lineBreakMode="clipping" sendsActionOnEndEditing="YES" title="Language:" id="VkG-jW-ibO">
|
||||
<font key="font" metaFont="smallSystemBold"/>
|
||||
<color key="textColor" name="controlTextColor" catalog="System" colorSpace="catalog"/>
|
||||
@@ -335,7 +335,7 @@
|
||||
</connections>
|
||||
</textField>
|
||||
<popUpButton verticalHuggingPriority="750" translatesAutoresizingMaskIntoConstraints="NO" id="5rh-cM-iOg">
|
||||
<rect key="frame" x="202" y="420" width="111" height="17"/>
|
||||
<rect key="frame" x="202" y="438" width="111" height="17"/>
|
||||
<popUpButtonCell key="cell" type="roundRect" bezelStyle="roundedRect" alignment="left" controlSize="small" lineBreakMode="truncatingTail" borderStyle="border" imageScaling="proportionallyDown" inset="2" id="gZb-sF-UQs">
|
||||
<behavior key="behavior" pushIn="YES" lightByBackground="YES" lightByGray="YES"/>
|
||||
<font key="font" metaFont="smallSystem"/>
|
||||
@@ -360,7 +360,7 @@
|
||||
</connections>
|
||||
</popUpButton>
|
||||
<button toolTip="Organize the audio fallbacks" translatesAutoresizingMaskIntoConstraints="NO" id="TV6-Sk-Bqr">
|
||||
<rect key="frame" x="110" y="299" width="119" height="18"/>
|
||||
<rect key="frame" x="110" y="317" width="119" height="18"/>
|
||||
<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"/>
|
||||
@@ -441,7 +441,7 @@
|
||||
</connections>
|
||||
</button>
|
||||
<button toolTip="Delete all custom track names" translatesAutoresizingMaskIntoConstraints="NO" id="22k-mA-HyA">
|
||||
<rect key="frame" x="110" y="263" width="123" height="18"/>
|
||||
<rect key="frame" x="110" y="281" width="123" height="18"/>
|
||||
<buttonCell key="cell" type="check" title="Clear tracks names" bezelStyle="regularSquare" imagePosition="left" alignment="left" controlSize="small" state="on" inset="2" id="mtK-5C-Pzh">
|
||||
<behavior key="behavior" changeContents="YES" doesNotDimImage="YES" lightByContents="YES"/>
|
||||
<font key="font" metaFont="smallSystem"/>
|
||||
@@ -455,7 +455,7 @@
|
||||
</connections>
|
||||
</button>
|
||||
<button toolTip="Rename audio tracks according to channel count (Mono, Stereo, Surround)" translatesAutoresizingMaskIntoConstraints="NO" id="81E-pQ-vyQ">
|
||||
<rect key="frame" x="110" y="245" width="160" height="18"/>
|
||||
<rect key="frame" x="110" y="263" width="160" height="18"/>
|
||||
<buttonCell key="cell" type="check" title="Prettify audio track names" bezelStyle="regularSquare" imagePosition="left" alignment="left" controlSize="small" state="on" inset="2" id="akF-dR-OPB" userLabel="Prettify audio track names">
|
||||
<behavior key="behavior" changeContents="YES" doesNotDimImage="YES" lightByContents="YES"/>
|
||||
<font key="font" metaFont="smallSystem"/>
|
||||
@@ -468,8 +468,22 @@
|
||||
</binding>
|
||||
</connections>
|
||||
</button>
|
||||
<button toolTip="Rename chapters titles to "Chapter N" format." translatesAutoresizingMaskIntoConstraints="NO" id="0qr-Nt-Pan">
|
||||
<rect key="frame" x="110" y="245" width="143" height="18"/>
|
||||
<buttonCell key="cell" type="check" title="Rename chapters titles" bezelStyle="regularSquare" imagePosition="left" alignment="left" controlSize="small" state="on" inset="2" id="yFm-Nq-s66" userLabel="Prettify audio track names">
|
||||
<behavior key="behavior" changeContents="YES" doesNotDimImage="YES" lightByContents="YES"/>
|
||||
<font key="font" metaFont="smallSystem"/>
|
||||
</buttonCell>
|
||||
<connections>
|
||||
<binding destination="-2" name="value" keyPath="self.options.renameChapters" id="v5q-TA-ZZi">
|
||||
<dictionary key="options">
|
||||
<bool key="NSValidatesImmediately" value="YES"/>
|
||||
</dictionary>
|
||||
</binding>
|
||||
</connections>
|
||||
</button>
|
||||
<popUpButton verticalHuggingPriority="750" translatesAutoresizingMaskIntoConstraints="NO" id="08Q-2k-0Gb">
|
||||
<rect key="frame" x="183" y="346" width="76" height="17"/>
|
||||
<rect key="frame" x="183" y="364" width="76" height="17"/>
|
||||
<popUpButtonCell key="cell" type="roundRect" title="Poster" bezelStyle="roundedRect" alignment="left" controlSize="small" lineBreakMode="truncatingTail" state="on" borderStyle="border" imageScaling="proportionallyDown" inset="2" selectedItem="YjX-6f-SPu" id="1t8-o9-ckI">
|
||||
<behavior key="behavior" pushIn="YES" lightByBackground="YES" lightByGray="YES"/>
|
||||
<font key="font" metaFont="smallSystem"/>
|
||||
@@ -563,7 +577,7 @@
|
||||
</connections>
|
||||
</button>
|
||||
<button toolTip="Search metadata online" translatesAutoresizingMaskIntoConstraints="NO" id="s8r-Cf-VfB">
|
||||
<rect key="frame" x="110" y="462" width="105" height="18"/>
|
||||
<rect key="frame" x="110" y="480" width="105" height="18"/>
|
||||
<buttonCell key="cell" type="check" title="Fetch Metadata" bezelStyle="regularSquare" imagePosition="left" alignment="left" controlSize="small" state="on" inset="2" id="h5x-un-6cJ">
|
||||
<behavior key="behavior" changeContents="YES" doesNotDimImage="YES" lightByContents="YES"/>
|
||||
<font key="font" metaFont="smallSystem"/>
|
||||
@@ -653,6 +667,7 @@
|
||||
<constraint firstItem="DVM-Js-DwK" firstAttribute="top" secondItem="Hjl-i0-gFW" secondAttribute="bottom" constant="8" id="c6c-TQ-ldg"/>
|
||||
<constraint firstItem="eTL-yP-QQ5" firstAttribute="baseline" secondItem="ZVm-yi-3cE" secondAttribute="baseline" id="cev-uP-NXR"/>
|
||||
<constraint firstAttribute="trailing" relation="greaterThanOrEqual" secondItem="yI9-2a-q2a" secondAttribute="trailing" constant="20" id="d2E-dG-y9d"/>
|
||||
<constraint firstItem="0qr-Nt-Pan" firstAttribute="top" secondItem="81E-pQ-vyQ" secondAttribute="bottom" constant="6" id="dCb-rK-kxo"/>
|
||||
<constraint firstItem="73q-gi-fe2" firstAttribute="baseline" secondItem="5rh-cM-iOg" secondAttribute="baseline" id="dQ5-0I-48F"/>
|
||||
<constraint firstItem="s2g-Iz-52P" firstAttribute="baseline" secondItem="2Hf-2V-95U" secondAttribute="baseline" id="dUG-gL-yak"/>
|
||||
<constraint firstAttribute="trailing" relation="greaterThanOrEqual" secondItem="etc-K7-Atw" secondAttribute="trailing" constant="20" id="dkQ-8f-2fd"/>
|
||||
@@ -668,6 +683,7 @@
|
||||
<constraint firstItem="KWg-Ak-bB6" firstAttribute="leading" secondItem="muY-E0-hVI" secondAttribute="trailing" constant="5" id="jAq-2z-d2z"/>
|
||||
<constraint firstItem="tLh-V3-OfB" firstAttribute="width" secondItem="Ce4-O7-Iu4" secondAttribute="width" id="jHG-5y-O2G"/>
|
||||
<constraint firstItem="BWL-Nn-iGH" firstAttribute="leading" secondItem="bDo-OD-bck" secondAttribute="leading" constant="10" id="jVz-7g-q3T"/>
|
||||
<constraint firstItem="slL-2h-MPl" firstAttribute="top" secondItem="0qr-Nt-Pan" secondAttribute="bottom" constant="6" id="kNj-HU-2kI"/>
|
||||
<constraint firstAttribute="trailing" relation="greaterThanOrEqual" secondItem="Ce4-O7-Iu4" secondAttribute="trailing" constant="20" id="kcg-1f-F0u"/>
|
||||
<constraint firstItem="bDo-OD-bck" firstAttribute="leading" secondItem="eTL-yP-QQ5" secondAttribute="leading" id="lFc-KN-zLO"/>
|
||||
<constraint firstItem="ZVm-yi-3cE" firstAttribute="top" secondItem="s8r-Cf-VfB" secondAttribute="bottom" constant="8" id="lfE-fa-WVU"/>
|
||||
@@ -682,12 +698,14 @@
|
||||
<constraint firstItem="Pdq-s0-erT" firstAttribute="top" secondItem="ZZk-4j-Ji7" secondAttribute="bottom" constant="4" id="nve-cv-GjI"/>
|
||||
<constraint firstAttribute="trailing" relation="greaterThanOrEqual" secondItem="ZZk-4j-Ji7" secondAttribute="trailing" constant="20" id="o5D-5D-f9z"/>
|
||||
<constraint firstItem="81E-pQ-vyQ" firstAttribute="top" secondItem="22k-mA-HyA" secondAttribute="bottom" constant="6" id="onR-dd-XHA"/>
|
||||
<constraint firstItem="0qr-Nt-Pan" firstAttribute="leading" secondItem="81E-pQ-vyQ" secondAttribute="leading" id="pO0-z0-vKd"/>
|
||||
<constraint firstItem="08Q-2k-0Gb" firstAttribute="leading" secondItem="Ns9-7q-hsh" secondAttribute="trailing" constant="8" id="pqo-4J-2VU"/>
|
||||
<constraint firstItem="ZZk-4j-Ji7" firstAttribute="baseline" secondItem="swT-iM-shZ" secondAttribute="baseline" id="prq-pC-1Vf"/>
|
||||
<constraint firstAttribute="trailing" relation="greaterThanOrEqual" secondItem="86l-GG-SpO" secondAttribute="trailing" constant="20" id="qRH-fx-yda"/>
|
||||
<constraint firstItem="5rh-cM-iOg" firstAttribute="leading" secondItem="73q-gi-fe2" secondAttribute="trailing" constant="8" id="r5f-g8-Pns"/>
|
||||
<constraint firstItem="s8r-Cf-VfB" firstAttribute="leading" secondItem="9GN-f6-r2j" secondAttribute="leading" id="r6R-Dz-3iB"/>
|
||||
<constraint firstAttribute="bottom" secondItem="yI9-2a-q2a" secondAttribute="bottom" constant="10" id="rDU-qM-lCp"/>
|
||||
<constraint firstAttribute="trailing" relation="greaterThanOrEqual" secondItem="0qr-Nt-Pan" secondAttribute="trailing" constant="20" id="reP-qw-E9F"/>
|
||||
<constraint firstAttribute="trailing" relation="greaterThanOrEqual" secondItem="08Q-2k-0Gb" secondAttribute="trailing" constant="54" id="rwm-CD-0kE"/>
|
||||
<constraint firstItem="2Hf-2V-95U" firstAttribute="leading" secondItem="Pdq-s0-erT" secondAttribute="leading" constant="22" id="scm-66-i3p"/>
|
||||
<constraint firstItem="MGZ-hB-jhx" firstAttribute="baseline" secondItem="Uoo-hZ-D1f" secondAttribute="baseline" id="tXr-4J-GsO"/>
|
||||
@@ -696,10 +714,9 @@
|
||||
<constraint firstAttribute="trailing" relation="greaterThanOrEqual" secondItem="zEH-aV-Tl7" secondAttribute="trailing" constant="20" id="uIU-b1-ler"/>
|
||||
<constraint firstItem="MGZ-hB-jhx" firstAttribute="leading" secondItem="Uoo-hZ-D1f" secondAttribute="trailing" constant="8" id="x7P-ao-di2"/>
|
||||
<constraint firstItem="MGZ-hB-jhx" firstAttribute="top" secondItem="zVi-vU-sh2" secondAttribute="bottom" constant="16" id="yi4-ru-tUN"/>
|
||||
<constraint firstItem="slL-2h-MPl" firstAttribute="top" secondItem="81E-pQ-vyQ" secondAttribute="bottom" constant="6" id="yuN-3A-a71"/>
|
||||
<constraint firstAttribute="trailing" relation="greaterThanOrEqual" secondItem="ccd-Xn-Dj3" secondAttribute="trailing" constant="20" id="zrg-ax-2rw"/>
|
||||
</constraints>
|
||||
<point key="canvasLocation" x="-711" y="-76"/>
|
||||
<point key="canvasLocation" x="-937" y="-78"/>
|
||||
</customView>
|
||||
<arrayController objectClassName="Preset" automaticallyPreparesContent="YES" id="vyv-na-Xpo" userLabel="Set Controller">
|
||||
<declaredKeys>
|
||||
|
||||
@@ -114,9 +114,7 @@ class QueueSubtitlesAction : NSObject, QueueActionProtocol {
|
||||
}
|
||||
|
||||
func encode(with aCoder: NSCoder) {}
|
||||
|
||||
required init?(coder aDecoder: NSCoder) {}
|
||||
|
||||
static var supportsSecureCoding: Bool { return true }
|
||||
|
||||
}
|
||||
@@ -357,9 +355,7 @@ class QueueOrganizeGroupsAction : NSObject, QueueActionProtocol {
|
||||
}
|
||||
|
||||
func encode(with aCoder: NSCoder) {}
|
||||
|
||||
required init?(coder aDecoder: NSCoder) {}
|
||||
|
||||
static var supportsSecureCoding: Bool { return true }
|
||||
|
||||
}
|
||||
@@ -379,9 +375,7 @@ class QueueFixFallbacksAction : NSObject, QueueActionProtocol {
|
||||
}
|
||||
|
||||
func encode(with aCoder: NSCoder) {}
|
||||
|
||||
required init?(coder aDecoder: NSCoder) {}
|
||||
|
||||
static var supportsSecureCoding: Bool { return true }
|
||||
|
||||
}
|
||||
@@ -443,9 +437,7 @@ class QueueClearTrackNameAction : NSObject, QueueActionProtocol {
|
||||
}
|
||||
|
||||
func encode(with aCoder: NSCoder) {}
|
||||
|
||||
required init?(coder aDecoder: NSCoder) {}
|
||||
|
||||
static var supportsSecureCoding: Bool { return true }
|
||||
|
||||
}
|
||||
@@ -471,9 +463,35 @@ class QueuePrettifyAudioTrackNameAction : NSObject, QueueActionProtocol {
|
||||
}
|
||||
|
||||
func encode(with aCoder: NSCoder) {}
|
||||
|
||||
required init?(coder aDecoder: NSCoder) {}
|
||||
static var supportsSecureCoding: Bool { return true }
|
||||
|
||||
}
|
||||
|
||||
/// An action that renames all the chapters titles.
|
||||
class QueueRenameChaptersAction : NSObject, QueueActionProtocol {
|
||||
|
||||
var type: QueueActionType { return .pre }
|
||||
var localizedDescription: String { return NSLocalizedString("Prettifying audio track names", comment: "Action localized description") }
|
||||
override var description: String { return NSLocalizedString("Prettify audio track names", comment: "Action description") }
|
||||
|
||||
override init() {}
|
||||
|
||||
func runAction(_ item: QueueItem) -> Bool {
|
||||
let chaptersTracks = item.mp4File?.tracks.compactMap { $0 as? MP42ChapterTrack } ?? []
|
||||
|
||||
chaptersTracks.forEach {
|
||||
for (index, chapter) in $0.chapters.enumerated() {
|
||||
let title = "Chapter \(index + 1)"
|
||||
$0.setTitle(title, forChapter: chapter)
|
||||
}
|
||||
}
|
||||
|
||||
return true
|
||||
}
|
||||
|
||||
func encode(with aCoder: NSCoder) {}
|
||||
required init?(coder aDecoder: NSCoder) {}
|
||||
static var supportsSecureCoding: Bool { return true }
|
||||
|
||||
}
|
||||
|
||||
@@ -269,6 +269,9 @@ final class QueueController : NSWindowController, NSWindowDelegate, NSPopoverDel
|
||||
if prefs.prettifyAudioTrackName {
|
||||
item.addAction(QueuePrettifyAudioTrackNameAction())
|
||||
}
|
||||
if prefs.renameChapters {
|
||||
item.addAction(QueueRenameChaptersAction())
|
||||
}
|
||||
if prefs.fixTrackLanguage {
|
||||
item.addAction(QueueSetLanguageAction(language: prefs.fixTrackLanguageValue))
|
||||
}
|
||||
|
||||
@@ -474,6 +474,7 @@ import MP42Foundation
|
||||
QueueMetadataAction.classForCoder(), QueueSubtitlesAction.classForCoder(),
|
||||
QueueSetLanguageAction.classForCoder(), QueueFixFallbacksAction.classForCoder(),
|
||||
QueueClearTrackNameAction.classForCoder(), QueuePrettifyAudioTrackNameAction.classForCoder(),
|
||||
QueueRenameChaptersAction.classForCoder(),
|
||||
QueueOrganizeGroupsAction.classForCoder(), QueueColorSpaceAction.classForCoder(),
|
||||
QueueSetOutputFilenameAction.classForCoder(), QueueClearExistingMetadataAction.classForCoder(),
|
||||
QueueOptimizeAction.classForCoder(), QueueSendToiTunesAction.classForCoder()], forKey: "SBQueueItemActions") as! [QueueActionProtocol]
|
||||
|
||||
@@ -14,6 +14,7 @@ final class QueuePreferences: NSObject {
|
||||
static private let SBQueueFixFallbacks: String = "SBQueueFixFallbacks"
|
||||
static private let SBQueueClearTrackName: String = "SBQueueClearTrackName"
|
||||
static private let SBQueuePrettifyAudioTrackName: String = "SBQueuePrettifyAudioTrackName"
|
||||
static private let SBQueueRenameChapters: String = "SBQueueRenameChapters"
|
||||
static private let SBQueueMetadata: String = "SBQueueMetadata"
|
||||
static private let SBQueueSubtitles: String = "SBQueueSubtitles"
|
||||
static private let SBQueueSet: String = "SBQueueSet"
|
||||
@@ -53,6 +54,7 @@ final class QueuePreferences: NSObject {
|
||||
@objc dynamic var fixFallbacks: Bool
|
||||
@objc dynamic var clearTrackName: Bool
|
||||
@objc dynamic var prettifyAudioTrackName: Bool
|
||||
@objc dynamic var renameChapters: Bool
|
||||
@objc dynamic var subtitles: Bool
|
||||
@objc dynamic var metadataSet: MetadataPreset?
|
||||
|
||||
@@ -90,6 +92,7 @@ final class QueuePreferences: NSObject {
|
||||
self.fixFallbacks = ud.bool(forKey: QueuePreferences.SBQueueFixFallbacks)
|
||||
self.clearTrackName = ud.bool(forKey: QueuePreferences.SBQueueClearTrackName)
|
||||
self.prettifyAudioTrackName = ud.bool(forKey: QueuePreferences.SBQueuePrettifyAudioTrackName)
|
||||
self.renameChapters = ud.bool(forKey: QueuePreferences.SBQueueRenameChapters)
|
||||
self.subtitles = ud.bool(forKey: QueuePreferences.SBQueueSubtitles)
|
||||
if let presetName = ud.string(forKey: QueuePreferences.SBQueueSet) {
|
||||
self.metadataSet = PresetManager.shared.item(name: presetName) as? MetadataPreset
|
||||
@@ -126,6 +129,7 @@ final class QueuePreferences: NSObject {
|
||||
QueuePreferences.SBQueueFixFallbacks: false,
|
||||
QueuePreferences.SBQueueClearTrackName: false,
|
||||
QueuePreferences.SBQueuePrettifyAudioTrackName: false,
|
||||
QueuePreferences.SBQueueRenameChapters: false,
|
||||
QueuePreferences.SBQueueMetadata : false,
|
||||
QueuePreferences.SBQueueSubtitles: true,
|
||||
QueuePreferences.SBQueueApplyColorSpace: false,
|
||||
@@ -159,6 +163,7 @@ final class QueuePreferences: NSObject {
|
||||
ud.set(fixFallbacks, forKey: QueuePreferences.SBQueueFixFallbacks)
|
||||
ud.set(clearTrackName, forKey: QueuePreferences.SBQueueClearTrackName)
|
||||
ud.set(prettifyAudioTrackName, forKey: QueuePreferences.SBQueuePrettifyAudioTrackName)
|
||||
ud.set(renameChapters, forKey: QueuePreferences.SBQueueRenameChapters)
|
||||
ud.set(subtitles, forKey: QueuePreferences.SBQueueSubtitles)
|
||||
ud.set(metadataSet?.title, forKey: QueuePreferences.SBQueueSet)
|
||||
|
||||
|
||||
Reference in new issue
Block a user