Use some modern APIs and fix warnings on the latest macOS SDK

This commit is contained in:
Damiano Galassi committed 2026-09-22 16:10:37 +02:00
1 parent beb7774761
commit 17c7d67b96
14 files changed
+254 -156

No files matched your search

+26 -20
View File
@@ -1,8 +1,8 @@
<?xml version="1.0" encoding="UTF-8"?>
<document type="com.apple.InterfaceBuilder3.Cocoa.XIB" version="3.0" toolsVersion="24506" targetRuntime="MacOSX.Cocoa" propertyAccessControl="none" useAutolayout="YES">
<document type="com.apple.InterfaceBuilder3.Cocoa.XIB" version="3.0" toolsVersion="25098" targetRuntime="MacOSX.Cocoa" propertyAccessControl="none" useAutolayout="YES">
<dependencies>
<deployment identifier="macosx"/>
<plugIn identifier="com.apple.InterfaceBuilder.CocoaPlugin" version="24506"/>
<plugIn identifier="com.apple.InterfaceBuilder.CocoaPlugin" version="25098"/>
<capability name="documents saved in the Xcode 8 format" minToolsVersion="8.0"/>
</dependencies>
<objects>
@@ -20,26 +20,26 @@
<windowStyleMask key="styleMask" titled="YES" closable="YES" miniaturizable="YES" resizable="YES"/>
<windowPositionMask key="initialPositionMask" topStrut="YES" bottomStrut="YES"/>
<rect key="contentRect" x="98" y="443" width="503" height="505"/>
<rect key="screenRect" x="0.0" y="0.0" width="1920" height="1055"/>
<rect key="screenRect" x="0.0" y="0.0" width="1920" height="1049"/>
<value key="minSize" type="size" width="378" height="200"/>
<view key="contentView" wantsLayer="YES" id="2">
<rect key="frame" x="0.0" y="0.0" width="503" height="505"/>
<autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
<subviews>
<scrollView wantsLayer="YES" autohidesScrollers="YES" horizontalLineScroll="23" horizontalPageScroll="10" verticalLineScroll="23" verticalPageScroll="10" usesPredominantAxisScrolling="NO" translatesAutoresizingMaskIntoConstraints="NO" id="3">
<rect key="frame" x="-1" y="46" width="505" height="460"/>
<rect key="frame" x="-1" y="48" width="505" height="458"/>
<clipView key="contentView" id="ix7-yM-0F6">
<rect key="frame" x="1" y="1" width="503" height="458"/>
<rect key="frame" x="1" y="1" width="503" height="456"/>
<autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
<subviews>
<tableView verticalHuggingPriority="750" allowsExpansionToolTips="YES" columnAutoresizingStyle="firstColumnOnly" alternatingRowBackgroundColors="YES" columnReordering="NO" columnResizing="NO" autosaveColumns="NO" rowHeight="19" rowSizeStyle="automatic" viewBased="YES" id="7" customClass="ExpandedTableView" customModule="Subler" customModuleProvider="target">
<rect key="frame" x="0.0" y="0.0" width="503" height="458"/>
<rect key="frame" x="0.0" y="0.0" width="503" height="456"/>
<autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
<size key="intercellSpacing" width="3" height="4"/>
<color key="backgroundColor" name="controlBackgroundColor" catalog="System" colorSpace="catalog"/>
<color key="gridColor" name="gridColor" catalog="System" colorSpace="catalog"/>
<tableColumns>
<tableColumn identifier="nameColumn" editable="NO" width="462" minWidth="40" maxWidth="3000" id="8">
<tableColumn identifier="nameColumn" editable="NO" width="491" minWidth="40" maxWidth="3000" id="8">
<tableHeaderCell key="headerCell" lineBreakMode="truncatingTail" borderStyle="border" alignment="left" title="nameColumn">
<color key="textColor" name="headerTextColor" catalog="System" colorSpace="catalog"/>
<color key="backgroundColor" white="0.33333298560000002" alpha="1" colorSpace="calibratedWhite"/>
@@ -52,26 +52,23 @@
<tableColumnResizingMask key="resizingMask" resizeWithTable="YES"/>
<prototypeCellViews>
<tableCellView id="ofF-gY-wBR">
<rect key="frame" x="1" y="2" width="471" height="19"/>
<rect key="frame" x="1" y="2" width="500" height="19"/>
<autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
<subviews>
<textField focusRingType="none" verticalHuggingPriority="750" horizontalCompressionResistancePriority="250" fixedFrame="YES" translatesAutoresizingMaskIntoConstraints="NO" id="pjh-GC-aOA">
<rect key="frame" x="29" y="2" width="413" height="17"/>
<autoresizingMask key="autoresizingMask" widthSizable="YES" flexibleMinY="YES"/>
<textField focusRingType="none" horizontalHuggingPriority="249" verticalHuggingPriority="750" horizontalCompressionResistancePriority="250" translatesAutoresizingMaskIntoConstraints="NO" id="pjh-GC-aOA">
<rect key="frame" x="29" y="2" width="442" height="16"/>
<textFieldCell key="cell" lineBreakMode="truncatingMiddle" sendsActionOnEndEditing="YES" title="Name" usesSingleLineMode="YES" id="srx-EJ-mK6">
<font key="font" metaFont="system"/>
<color key="textColor" name="controlTextColor" catalog="System" colorSpace="catalog"/>
<color key="backgroundColor" name="controlColor" catalog="System" colorSpace="catalog"/>
</textFieldCell>
</textField>
<imageView horizontalHuggingPriority="251" verticalHuggingPriority="251" fixedFrame="YES" translatesAutoresizingMaskIntoConstraints="NO" id="Xeb-eQ-90j">
<imageView horizontalHuggingPriority="251" verticalHuggingPriority="251" translatesAutoresizingMaskIntoConstraints="NO" id="Xeb-eQ-90j">
<rect key="frame" x="7" y="2" width="16" height="16"/>
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMinY="YES"/>
<imageCell key="cell" refusesFirstResponder="YES" alignment="left" imageScaling="proportionallyDown" image="EncodeComplete" id="uXb-c3-MQO"/>
</imageView>
<button toolTip="Show item info" verticalHuggingPriority="750" fixedFrame="YES" translatesAutoresizingMaskIntoConstraints="NO" id="o98-wM-YAQ">
<rect key="frame" x="448" y="2" width="16" height="16"/>
<autoresizingMask key="autoresizingMask" flexibleMinX="YES" flexibleMinY="YES"/>
<button toolTip="Show item info" verticalHuggingPriority="750" translatesAutoresizingMaskIntoConstraints="NO" id="o98-wM-YAQ">
<rect key="frame" x="477" y="2" width="16" height="16"/>
<buttonCell key="cell" type="bevel" bezelStyle="rounded" image="info" imagePosition="overlaps" alignment="center" alternateImage="info-pressed" imageScaling="proportionallyDown" inset="2" id="AFW-1U-iaL">
<behavior key="behavior" lightByContents="YES"/>
<font key="font" metaFont="system"/>
@@ -82,6 +79,15 @@
</connections>
</button>
</subviews>
<constraints>
<constraint firstItem="Xeb-eQ-90j" firstAttribute="centerY" secondItem="ofF-gY-wBR" secondAttribute="centerY" id="90b-BW-lff"/>
<constraint firstItem="o98-wM-YAQ" firstAttribute="leading" secondItem="pjh-GC-aOA" secondAttribute="trailing" constant="8" symbolic="YES" id="CaB-q0-ftY"/>
<constraint firstItem="Xeb-eQ-90j" firstAttribute="leading" secondItem="ofF-gY-wBR" secondAttribute="leading" constant="7" id="G9p-cq-HKH"/>
<constraint firstItem="o98-wM-YAQ" firstAttribute="centerY" secondItem="ofF-gY-wBR" secondAttribute="centerY" id="USV-VJ-xKf"/>
<constraint firstItem="pjh-GC-aOA" firstAttribute="leading" secondItem="Xeb-eQ-90j" secondAttribute="trailing" constant="8" symbolic="YES" id="ZBk-XN-nd9"/>
<constraint firstAttribute="trailing" secondItem="o98-wM-YAQ" secondAttribute="trailing" constant="7" id="mX3-LL-ent"/>
<constraint firstItem="pjh-GC-aOA" firstAttribute="centerY" secondItem="ofF-gY-wBR" secondAttribute="centerY" id="odE-Gg-80F"/>
</constraints>
<connections>
<outlet property="imageView" destination="Xeb-eQ-90j" id="Q6V-gj-mwY"/>
<outlet property="textField" destination="pjh-GC-aOA" id="PQK-Y7-IFu"/>
@@ -100,7 +106,7 @@
</subviews>
</clipView>
<scroller key="horizontalScroller" hidden="YES" wantsLayer="YES" verticalHuggingPriority="750" horizontal="YES" id="6">
<rect key="frame" x="1" y="443" width="503" height="16"/>
<rect key="frame" x="1" y="440" width="503" height="17"/>
<autoresizingMask key="autoresizingMask"/>
</scroller>
<scroller key="verticalScroller" hidden="YES" wantsLayer="YES" verticalHuggingPriority="750" horizontal="NO" id="4">
@@ -109,7 +115,7 @@
</scroller>
</scrollView>
<textField focusRingType="none" verticalHuggingPriority="750" translatesAutoresizingMaskIntoConstraints="NO" id="12">
<rect key="frame" x="8" y="16" width="339" height="16"/>
<rect key="frame" x="8" y="18" width="339" height="16"/>
<textFieldCell key="cell" scrollable="YES" lineBreakMode="clipping" sendsActionOnEndEditing="YES" title="Queue items" id="13">
<font key="font" metaFont="system"/>
<color key="textColor" name="controlTextColor" catalog="System" colorSpace="catalog"/>
@@ -117,7 +123,7 @@
</textFieldCell>
</textField>
<progressIndicator wantsLayer="YES" maxValue="100" indeterminate="YES" style="bar" translatesAutoresizingMaskIntoConstraints="NO" id="91">
<rect key="frame" x="353" y="13" width="140" height="20"/>
<rect key="frame" x="353" y="14" width="140" height="20"/>
<constraints>
<constraint firstAttribute="width" constant="140" id="zk9-SM-dx0"/>
</constraints>
@@ -138,7 +144,7 @@
<connections>
<outlet property="delegate" destination="-2" id="c4X-w0-NMZ"/>
</connections>
<point key="canvasLocation" x="165.5" y="60.5"/>
<point key="canvasLocation" x="294.5" y="35.5"/>
</window>
<menu id="78">
<items>
+48 -47
View File
@@ -1,8 +1,8 @@
<?xml version="1.0" encoding="UTF-8"?>
<document type="com.apple.InterfaceBuilder3.Cocoa.XIB" version="3.0" toolsVersion="24127" targetRuntime="MacOSX.Cocoa" propertyAccessControl="none" useAutolayout="YES">
<document type="com.apple.InterfaceBuilder3.Cocoa.XIB" version="3.0" toolsVersion="25098" targetRuntime="MacOSX.Cocoa" propertyAccessControl="none" useAutolayout="YES">
<dependencies>
<deployment identifier="macosx"/>
<plugIn identifier="com.apple.InterfaceBuilder.CocoaPlugin" version="24127"/>
<plugIn identifier="com.apple.InterfaceBuilder.CocoaPlugin" version="25098"/>
<capability name="documents saved in the Xcode 8 format" minToolsVersion="8.0"/>
</dependencies>
<objects>
@@ -15,12 +15,12 @@
</customObject>
<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="642"/>
<customView misplaced="YES" id="UlG-O3-eNc" userLabel="OptionsView">
<rect key="frame" x="0.0" y="0.0" width="395" height="687"/>
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMinY="YES"/>
<subviews>
<button verticalHuggingPriority="251" translatesAutoresizingMaskIntoConstraints="NO" id="zEH-aV-Tl7">
<rect key="frame" x="111" y="88" width="68" height="16"/>
<rect key="frame" x="112" y="89" width="67" height="14"/>
<buttonCell key="cell" type="check" title="Optimize" bezelStyle="regularSquare" imagePosition="left" alignment="left" controlSize="small" state="on" inset="2" id="nig-pN-efw">
<behavior key="behavior" changeContents="YES" doesNotDimImage="YES" lightByContents="YES"/>
<font key="font" metaFont="label" size="11"/>
@@ -37,7 +37,7 @@
</connections>
</button>
<button toolTip="Clear existing metadata" translatesAutoresizingMaskIntoConstraints="NO" id="9GN-f6-r2j">
<rect key="frame" x="111" y="607" width="145" height="16"/>
<rect key="frame" x="112" y="653" width="142" height="14"/>
<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="label" size="11"/>
@@ -51,7 +51,7 @@
</connections>
</button>
<button verticalHuggingPriority="754" translatesAutoresizingMaskIntoConstraints="NO" id="MGZ-hB-jhx">
<rect key="frame" x="112" y="39" width="132" height="16"/>
<rect key="frame" x="113" y="40" width="129" height="14"/>
<buttonCell key="cell" type="check" title="Auto-Start the queue" bezelStyle="regularSquare" imagePosition="left" alignment="left" controlSize="small" state="on" inset="2" id="LYO-G0-9jA">
<behavior key="behavior" changeContents="YES" doesNotDimImage="YES" lightByContents="YES"/>
<font key="font" metaFont="label" size="11"/>
@@ -65,7 +65,7 @@
</connections>
</button>
<button toolTip="Organize the mp4 alternate groups" verticalHuggingPriority="757" translatesAutoresizingMaskIntoConstraints="NO" id="ccd-Xn-Dj3">
<rect key="frame" x="111" y="440" width="110" height="16"/>
<rect key="frame" x="112" y="466" width="107" height="14"/>
<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="label" size="11"/>
@@ -79,7 +79,7 @@
</connections>
</button>
<button toolTip="Load the external srt subtitles file" verticalHuggingPriority="758" translatesAutoresizingMaskIntoConstraints="NO" id="etc-K7-Atw">
<rect key="frame" x="111" y="400" width="142" height="16"/>
<rect key="frame" x="112" y="426" width="139" height="14"/>
<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="label" size="11"/>
@@ -93,7 +93,7 @@
</connections>
</button>
<popUpButton horizontalHuggingPriority="249" verticalHuggingPriority="750" translatesAutoresizingMaskIntoConstraints="NO" id="86l-GG-SpO">
<rect key="frame" x="195" y="127" width="130" height="17"/>
<rect key="frame" x="195" y="132" width="130" height="20"/>
<popUpButtonCell key="cell" type="roundRect" bezelStyle="roundedRect" imagePosition="left" alignment="left" controlSize="small" lineBreakMode="truncatingTail" state="on" borderStyle="border" imageScaling="proportionallyDown" inset="2" autoenablesItems="NO" selectedItem="6jC-r9-LzT" id="8bb-Gy-KAS">
<behavior key="behavior" pushIn="YES" lightByBackground="YES" lightByGray="YES"/>
<font key="font" metaFont="label" size="11"/>
@@ -122,7 +122,7 @@
</connections>
</popUpButton>
<textField focusRingType="none" verticalHuggingPriority="750" allowsCharacterPickerTouchBarItem="YES" preferredMaxLayoutWidth="200" translatesAutoresizingMaskIntoConstraints="NO" id="vJ5-JB-k1m">
<rect key="frame" x="132" y="129" width="56" height="14"/>
<rect key="frame" x="132" y="135" width="56" height="14"/>
<textFieldCell key="cell" controlSize="small" scrollable="YES" lineBreakMode="clipping" sendsActionOnEndEditing="YES" alignment="right" title="Location:" id="17e-9u-rVn">
<font key="font" metaFont="smallSystemBold"/>
<color key="textColor" name="controlTextColor" catalog="System" colorSpace="catalog"/>
@@ -130,7 +130,7 @@
</textFieldCell>
</textField>
<textField focusRingType="none" verticalHuggingPriority="750" allowsCharacterPickerTouchBarItem="YES" preferredMaxLayoutWidth="200" translatesAutoresizingMaskIntoConstraints="NO" id="NhN-Lg-awX">
<rect key="frame" x="126" y="149" width="62" height="14"/>
<rect key="frame" x="126" y="159" width="62" height="14"/>
<textFieldCell key="cell" controlSize="small" scrollable="YES" lineBreakMode="clipping" sendsActionOnEndEditing="YES" alignment="right" title="Apply Set:" id="9gt-mI-zIV">
<font key="font" metaFont="smallSystemBold"/>
<color key="textColor" name="controlTextColor" catalog="System" colorSpace="catalog"/>
@@ -138,7 +138,7 @@
</textFieldCell>
</textField>
<textField focusRingType="none" verticalHuggingPriority="750" allowsCharacterPickerTouchBarItem="YES" preferredMaxLayoutWidth="200" translatesAutoresizingMaskIntoConstraints="NO" id="eTL-yP-QQ5">
<rect key="frame" x="126" y="565" width="48" height="14"/>
<rect key="frame" x="126" y="608" 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"/>
@@ -149,7 +149,7 @@
</connections>
</textField>
<textField focusRingType="none" verticalHuggingPriority="750" allowsCharacterPickerTouchBarItem="YES" preferredMaxLayoutWidth="200" translatesAutoresizingMaskIntoConstraints="NO" id="bDo-OD-bck">
<rect key="frame" x="126" y="519" width="63" height="14"/>
<rect key="frame" x="126" y="554" 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"/>
@@ -168,7 +168,7 @@
</textFieldCell>
</textField>
<textField focusRingType="none" verticalHuggingPriority="750" allowsCharacterPickerTouchBarItem="YES" preferredMaxLayoutWidth="200" translatesAutoresizingMaskIntoConstraints="NO" id="S7L-mA-j3Y">
<rect key="frame" x="49" y="608" width="58" height="14"/>
<rect key="frame" x="49" y="653" width="58" 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"/>
@@ -176,7 +176,7 @@
</textFieldCell>
</textField>
<popUpButton verticalHuggingPriority="750" translatesAutoresizingMaskIntoConstraints="NO" id="DVM-Js-DwK">
<rect key="frame" x="195" y="147" width="130" height="17"/>
<rect key="frame" x="195" y="156" width="130" height="20"/>
<popUpButtonCell key="cell" type="roundRect" bezelStyle="roundedRect" alignment="left" controlSize="small" lineBreakMode="truncatingTail" borderStyle="border" imageScaling="proportionallyDown" inset="2" id="bQx-xN-b3H">
<behavior key="behavior" pushIn="YES" lightByBackground="YES" lightByGray="YES"/>
<font key="font" metaFont="label" size="11"/>
@@ -208,7 +208,7 @@
</connections>
</popUpButton>
<popUpButton horizontalHuggingPriority="249" verticalHuggingPriority="750" translatesAutoresizingMaskIntoConstraints="NO" id="ZVm-yi-3cE">
<rect key="frame" x="181" y="563" width="150" height="17"/>
<rect key="frame" x="181" y="605" width="150" height="20"/>
<popUpButtonCell key="cell" type="roundRect" bezelStyle="roundedRect" alignment="left" controlSize="small" lineBreakMode="truncatingTail" borderStyle="border" imageScaling="proportionallyDown" inset="2" id="CbR-eu-sGI">
<behavior key="behavior" pushIn="YES" lightByBackground="YES" lightByGray="YES"/>
<font key="font" metaFont="label" size="11"/>
@@ -235,7 +235,7 @@
</connections>
</popUpButton>
<popUpButton horizontalHuggingPriority="249" verticalHuggingPriority="750" translatesAutoresizingMaskIntoConstraints="NO" id="tLh-V3-OfB">
<rect key="frame" x="195" y="517" width="150" height="17"/>
<rect key="frame" x="195" y="551" width="150" height="20"/>
<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="label" size="11"/>
@@ -262,7 +262,7 @@
</connections>
</popUpButton>
<textField focusRingType="none" verticalHuggingPriority="750" allowsCharacterPickerTouchBarItem="YES" preferredMaxLayoutWidth="200" translatesAutoresizingMaskIntoConstraints="NO" id="BWL-Nn-iGH">
<rect key="frame" x="142" y="499" width="63" height="14"/>
<rect key="frame" x="142" y="530" width="63" height="14"/>
<constraints>
<constraint firstAttribute="width" relation="greaterThanOrEqual" constant="58" id="vbR-Os-38g"/>
</constraints>
@@ -276,7 +276,7 @@
</connections>
</textField>
<textField focusRingType="none" verticalHuggingPriority="750" allowsCharacterPickerTouchBarItem="YES" preferredMaxLayoutWidth="200" translatesAutoresizingMaskIntoConstraints="NO" id="Ns9-7q-hsh">
<rect key="frame" x="126" y="471" width="54" height="14"/>
<rect key="frame" x="126" y="498" width="54" height="14"/>
<constraints>
<constraint firstAttribute="width" relation="greaterThanOrEqual" constant="50" id="98L-OX-PB1"/>
</constraints>
@@ -290,7 +290,7 @@
</connections>
</textField>
<popUpButton verticalHuggingPriority="750" translatesAutoresizingMaskIntoConstraints="NO" id="Ce4-O7-Iu4">
<rect key="frame" x="212" y="497" width="150" height="17"/>
<rect key="frame" x="212" y="527" width="150" height="20"/>
<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="label" size="11"/>
@@ -318,7 +318,7 @@
</connections>
</popUpButton>
<textField focusRingType="none" verticalHuggingPriority="750" allowsCharacterPickerTouchBarItem="YES" preferredMaxLayoutWidth="200" translatesAutoresizingMaskIntoConstraints="NO" id="73q-gi-fe2">
<rect key="frame" x="142" y="545" width="63" height="14"/>
<rect key="frame" x="142" y="584" 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"/>
@@ -329,7 +329,7 @@
</connections>
</textField>
<popUpButton verticalHuggingPriority="750" translatesAutoresizingMaskIntoConstraints="NO" id="5rh-cM-iOg">
<rect key="frame" x="212" y="543" width="150" height="17"/>
<rect key="frame" x="212" y="581" width="150" height="20"/>
<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="label" size="11"/>
@@ -358,7 +358,7 @@
</connections>
</popUpButton>
<button toolTip="Organize the audio fallbacks" verticalHuggingPriority="756" translatesAutoresizingMaskIntoConstraints="NO" id="TV6-Sk-Bqr">
<rect key="frame" x="111" y="420" width="118" height="16"/>
<rect key="frame" x="112" y="446" width="117" height="14"/>
<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="label" size="11"/>
@@ -375,7 +375,7 @@
</connections>
</button>
<button toolTip="Set tracks without a language to the selected one" verticalHuggingPriority="756" translatesAutoresizingMaskIntoConstraints="NO" id="slL-2h-MPl">
<rect key="frame" x="111" y="320" width="159" height="16"/>
<rect key="frame" x="112" y="346" width="156" height="14"/>
<buttonCell key="cell" type="check" title="Complete tracks language" bezelStyle="regularSquare" imagePosition="left" alignment="left" controlSize="small" state="on" inset="2" id="cxz-2q-RIP">
<behavior key="behavior" changeContents="YES" doesNotDimImage="YES" lightByContents="YES"/>
<font key="font" metaFont="label" size="11"/>
@@ -389,7 +389,7 @@
</connections>
</button>
<textField focusRingType="none" verticalHuggingPriority="750" allowsCharacterPickerTouchBarItem="YES" preferredMaxLayoutWidth="200" translatesAutoresizingMaskIntoConstraints="NO" id="swT-iM-shZ">
<rect key="frame" x="126" y="302" width="64" height="14"/>
<rect key="frame" x="126" y="325" width="64" height="14"/>
<constraints>
<constraint firstAttribute="width" constant="60" id="x6U-u1-ezQ"/>
</constraints>
@@ -403,7 +403,7 @@
</connections>
</textField>
<popUpButton verticalHuggingPriority="750" translatesAutoresizingMaskIntoConstraints="NO" id="ZZk-4j-Ji7">
<rect key="frame" x="197" y="300" width="111" height="17"/>
<rect key="frame" x="197" y="322" width="111" height="20"/>
<popUpButtonCell key="cell" type="roundRect" bezelStyle="roundedRect" alignment="left" controlSize="small" lineBreakMode="truncatingTail" borderStyle="border" imageScaling="proportionallyDown" inset="2" id="kEh-SN-iHZ">
<behavior key="behavior" pushIn="YES" lightByBackground="YES" lightByGray="YES"/>
<font key="font" metaFont="label" size="11"/>
@@ -431,7 +431,7 @@
</connections>
</popUpButton>
<textField focusRingType="none" verticalHuggingPriority="750" allowsCharacterPickerTouchBarItem="YES" preferredMaxLayoutWidth="200" translatesAutoresizingMaskIntoConstraints="NO" id="ntU-85-AaJ">
<rect key="frame" x="126" y="262" width="63" height="14"/>
<rect key="frame" x="126" y="283" width="63" height="14"/>
<textFieldCell key="cell" controlSize="small" scrollable="YES" lineBreakMode="clipping" sendsActionOnEndEditing="YES" alignment="right" title="Language:" id="963-dI-WCB">
<font key="font" metaFont="smallSystemBold"/>
<color key="textColor" name="controlTextColor" catalog="System" colorSpace="catalog"/>
@@ -442,7 +442,7 @@
</connections>
</textField>
<popUpButton verticalHuggingPriority="750" translatesAutoresizingMaskIntoConstraints="NO" id="ztL-LO-XhV">
<rect key="frame" x="196" y="260" width="111" height="17"/>
<rect key="frame" x="196" y="280" width="111" height="20"/>
<popUpButtonCell key="cell" type="roundRect" bezelStyle="roundedRect" alignment="left" controlSize="small" lineBreakMode="truncatingTail" borderStyle="border" imageScaling="proportionallyDown" inset="2" id="tj2-P4-OCU">
<behavior key="behavior" pushIn="YES" lightByBackground="YES" lightByGray="YES"/>
<font key="font" metaFont="label" size="11"/>
@@ -470,7 +470,7 @@
</connections>
</popUpButton>
<button horizontalHuggingPriority="248" verticalHuggingPriority="750" translatesAutoresizingMaskIntoConstraints="NO" id="3et-YT-WBR">
<rect key="frame" x="111" y="279" width="195" height="16"/>
<rect key="frame" x="112" y="303" width="192" height="14"/>
<string key="toolTip">In files with multiple audio tracks in different languages, this will enable the preferred langauge and disable all other tracks. For AppleTV and some other players, this allows the preferred language audio to play by default. An audio track labeled with the selected language and tagged as main program content must exist. </string>
<buttonCell key="cell" type="check" title="Enable audio track with language" bezelStyle="regularSquare" imagePosition="left" controlSize="small" state="on" inset="2" id="nC7-4d-Is1">
<behavior key="behavior" changeContents="YES" doesNotDimImage="YES" lightByContents="YES"/>
@@ -485,7 +485,7 @@
</connections>
</button>
<button verticalHuggingPriority="750" translatesAutoresizingMaskIntoConstraints="NO" id="LiA-V6-VEx" userLabel="Change Subtitle Language Track">
<rect key="frame" x="111" y="242" width="211" height="16"/>
<rect key="frame" x="112" y="262" width="208" height="14"/>
<string key="toolTip">In files with multiple subtitle tracks in different languages, this will enable the preferred langauge and disable all other tracks. For AppleTV and some other players, this allows the preferred language subtitles to play by default. A subtitle track labeled with the preferred language must exist in the file.</string>
<buttonCell key="cell" type="check" title="Enable subtitles track with language" bezelStyle="regularSquare" imagePosition="left" controlSize="small" state="on" inset="2" id="LD5-Kv-x0M" userLabel="Change Subtitle Language Track">
<behavior key="behavior" changeContents="YES" doesNotDimImage="YES" lightByContents="YES"/>
@@ -500,7 +500,7 @@
</connections>
</button>
<button verticalHuggingPriority="755" translatesAutoresizingMaskIntoConstraints="NO" id="yI9-2a-q2a">
<rect key="frame" x="112" y="19" width="178" height="16"/>
<rect key="frame" x="113" y="20" width="175" height="14"/>
<buttonCell key="cell" type="check" title="Show Notification When Done" bezelStyle="regularSquare" imagePosition="left" alignment="left" controlSize="small" state="on" inset="2" id="n6P-IC-SEp">
<behavior key="behavior" changeContents="YES" doesNotDimImage="YES" lightByContents="YES"/>
<font key="font" metaFont="label" size="11"/>
@@ -514,7 +514,7 @@
</connections>
</button>
<button toolTip="Delete all custom track names" verticalHuggingPriority="752" translatesAutoresizingMaskIntoConstraints="NO" id="22k-mA-HyA">
<rect key="frame" x="111" y="380" width="122" height="16"/>
<rect key="frame" x="112" y="406" width="119" height="14"/>
<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="label" size="11"/>
@@ -528,7 +528,7 @@
</connections>
</button>
<button toolTip="Rename audio tracks according to channel count (Mono, Stereo, Surround)" verticalHuggingPriority="753" translatesAutoresizingMaskIntoConstraints="NO" id="81E-pQ-vyQ">
<rect key="frame" x="111" y="360" width="159" height="16"/>
<rect key="frame" x="112" y="386" width="156" height="14"/>
<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="label" size="11"/>
@@ -542,7 +542,7 @@
</connections>
</button>
<button toolTip="Rename chapters titles to &quot;Chapter N&quot; format." verticalHuggingPriority="751" translatesAutoresizingMaskIntoConstraints="NO" id="0qr-Nt-Pan">
<rect key="frame" x="111" y="340" width="142" height="16"/>
<rect key="frame" x="112" y="366" width="139" height="14"/>
<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="label" size="11"/>
@@ -556,7 +556,7 @@
</connections>
</button>
<popUpButton horizontalHuggingPriority="251" verticalHuggingPriority="750" translatesAutoresizingMaskIntoConstraints="NO" id="08Q-2k-0Gb">
<rect key="frame" x="187" y="469" width="70" height="17"/>
<rect key="frame" x="187" y="495" width="90" height="20"/>
<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="label" size="11"/>
@@ -587,7 +587,7 @@
</connections>
</popUpButton>
<button toolTip="Set the color space of video tracks to the selected one" verticalHuggingPriority="755" translatesAutoresizingMaskIntoConstraints="NO" id="Pdq-s0-erT">
<rect key="frame" x="111" y="205" width="115" height="16"/>
<rect key="frame" x="112" y="221" width="112" height="14"/>
<buttonCell key="cell" type="check" title="Apply color space" bezelStyle="regularSquare" imagePosition="left" alignment="left" controlSize="small" state="on" inset="2" id="0By-RQ-4mS">
<behavior key="behavior" changeContents="YES" doesNotDimImage="YES" lightByContents="YES"/>
<font key="font" metaFont="label" size="11"/>
@@ -601,7 +601,7 @@
</connections>
</button>
<textField focusRingType="none" verticalHuggingPriority="750" allowsCharacterPickerTouchBarItem="YES" preferredMaxLayoutWidth="200" translatesAutoresizingMaskIntoConstraints="NO" id="2Hf-2V-95U">
<rect key="frame" x="126" y="187" width="76" height="14"/>
<rect key="frame" x="126" y="201" width="76" height="14"/>
<textFieldCell key="cell" controlSize="small" scrollable="YES" lineBreakMode="clipping" sendsActionOnEndEditing="YES" alignment="right" title="Color Space:" id="tMS-Tg-pPf">
<font key="font" metaFont="smallSystemBold"/>
<color key="textColor" name="controlTextColor" catalog="System" colorSpace="catalog"/>
@@ -612,7 +612,7 @@
</connections>
</textField>
<popUpButton verticalHuggingPriority="249" translatesAutoresizingMaskIntoConstraints="NO" id="s2g-Iz-52P">
<rect key="frame" x="209" y="185" width="150" height="18"/>
<rect key="frame" x="209" y="198" width="150" height="20"/>
<popUpButtonCell key="cell" type="roundRect" title="Implicit" bezelStyle="roundedRect" alignment="left" controlSize="small" lineBreakMode="truncatingTail" state="on" borderStyle="border" tag="1" imageScaling="proportionallyDown" inset="2" selectedItem="psY-0V-t0k" id="QT5-Bh-4Hc">
<behavior key="behavior" pushIn="YES" lightByBackground="YES" lightByGray="YES"/>
<font key="font" metaFont="label" size="11"/>
@@ -641,7 +641,7 @@
</connections>
</popUpButton>
<button toolTip="Search metadata online" verticalHuggingPriority="759" translatesAutoresizingMaskIntoConstraints="NO" id="s8r-Cf-VfB">
<rect key="frame" x="111" y="587" width="103" height="16"/>
<rect key="frame" x="112" y="633" width="100" height="14"/>
<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="label" size="11"/>
@@ -655,7 +655,7 @@
</connections>
</button>
<button translatesAutoresizingMaskIntoConstraints="NO" id="zVi-vU-sh2">
<rect key="frame" x="111" y="69" width="145" height="16"/>
<rect key="frame" x="112" y="70" width="142" height="14"/>
<buttonCell key="cell" type="check" title="Send to AppleTV/iTunes" bezelStyle="regularSquare" imagePosition="left" alignment="left" controlSize="small" state="on" inset="2" id="4an-VK-S2u">
<behavior key="behavior" changeContents="YES" doesNotDimImage="YES" lightByContents="YES"/>
<font key="font" metaFont="label" size="11"/>
@@ -669,7 +669,7 @@
</connections>
</button>
<popUpButton verticalHuggingPriority="750" translatesAutoresizingMaskIntoConstraints="NO" id="k33-Yf-DbF">
<rect key="frame" x="263" y="469" width="73" height="17"/>
<rect key="frame" x="283" y="495" width="92" height="20"/>
<popUpButtonCell key="cell" type="roundRect" title="Standard" bezelStyle="roundedRect" alignment="left" controlSize="small" lineBreakMode="truncatingTail" state="on" borderStyle="border" imageScaling="proportionallyDown" inset="2" selectedItem="goC-ck-how" id="obA-0k-yqE">
<behavior key="behavior" pushIn="YES" lightByBackground="YES" lightByGray="YES"/>
<font key="font" metaFont="label" size="11"/>
@@ -694,7 +694,7 @@
</connections>
</popUpButton>
<textField focusRingType="none" verticalHuggingPriority="750" allowsCharacterPickerTouchBarItem="YES" preferredMaxLayoutWidth="200" translatesAutoresizingMaskIntoConstraints="NO" id="FJc-Hc-zCR">
<rect key="frame" x="126" y="225" width="63" height="14"/>
<rect key="frame" x="126" y="242" width="63" height="14"/>
<textFieldCell key="cell" controlSize="small" scrollable="YES" lineBreakMode="clipping" sendsActionOnEndEditing="YES" alignment="right" title="Language:" id="E4E-3v-z24">
<font key="font" metaFont="smallSystemBold"/>
<color key="textColor" name="controlTextColor" catalog="System" colorSpace="catalog"/>
@@ -705,7 +705,7 @@
</connections>
</textField>
<popUpButton verticalHuggingPriority="750" translatesAutoresizingMaskIntoConstraints="NO" id="YJ5-of-VuU">
<rect key="frame" x="196" y="223" width="111" height="17"/>
<rect key="frame" x="196" y="239" width="111" height="20"/>
<popUpButtonCell key="cell" type="roundRect" bezelStyle="roundedRect" alignment="left" controlSize="small" lineBreakMode="truncatingTail" borderStyle="border" imageScaling="proportionallyDown" inset="2" id="muE-Km-mrP">
<behavior key="behavior" pushIn="YES" lightByBackground="YES" lightByGray="YES"/>
<font key="font" metaFont="label" size="11"/>
@@ -733,7 +733,7 @@
</connections>
</popUpButton>
<button verticalHuggingPriority="750" translatesAutoresizingMaskIntoConstraints="NO" id="Hjl-i0-gFW">
<rect key="frame" x="111" y="166" width="124" height="16"/>
<rect key="frame" x="112" y="179" width="121" height="14"/>
<buttonCell key="cell" type="check" title="Set output filename" bezelStyle="regularSquare" imagePosition="left" controlSize="small" state="on" inset="2" id="Qld-0F-DsX">
<behavior key="behavior" changeContents="YES" doesNotDimImage="YES" lightByContents="YES"/>
<font key="font" metaFont="label" size="11"/>
@@ -743,7 +743,7 @@
</connections>
</button>
<popUpButton verticalHuggingPriority="750" translatesAutoresizingMaskIntoConstraints="NO" id="KWg-Ak-bB6">
<rect key="frame" x="195" y="107" width="130" height="17"/>
<rect key="frame" x="195" y="108" width="130" height="20"/>
<popUpButtonCell key="cell" type="roundRect" title="mp4" bezelStyle="roundedRect" imagePosition="left" alignment="left" controlSize="small" lineBreakMode="truncatingTail" state="on" borderStyle="border" tag="10" imageScaling="proportionallyDown" inset="2" autoenablesItems="NO" selectedItem="iXb-rA-1f3" id="Tgc-fW-mN5">
<behavior key="behavior" pushIn="YES" lightByBackground="YES" lightByGray="YES"/>
<font key="font" metaFont="label" size="11"/>
@@ -763,7 +763,7 @@
</connections>
</popUpButton>
<textField focusRingType="none" verticalHuggingPriority="750" allowsCharacterPickerTouchBarItem="YES" preferredMaxLayoutWidth="200" translatesAutoresizingMaskIntoConstraints="NO" id="muY-E0-hVI">
<rect key="frame" x="129" y="109" width="59" height="14"/>
<rect key="frame" x="129" y="111" width="59" height="14"/>
<textFieldCell key="cell" controlSize="small" scrollable="YES" lineBreakMode="clipping" sendsActionOnEndEditing="YES" alignment="right" title="File Type:" id="UbR-KJ-8iR">
<font key="font" metaFont="smallSystemBold"/>
<color key="textColor" name="controlTextColor" catalog="System" colorSpace="catalog"/>
@@ -843,6 +843,7 @@
<constraint firstItem="08Q-2k-0Gb" firstAttribute="leading" secondItem="Ns9-7q-hsh" secondAttribute="trailing" constant="9" id="iQj-1h-1cO"/>
<constraint firstItem="2Hf-2V-95U" firstAttribute="baseline" secondItem="s2g-Iz-52P" secondAttribute="baseline" id="iuc-CH-gRQ"/>
<constraint firstItem="86l-GG-SpO" firstAttribute="leading" secondItem="vJ5-JB-k1m" secondAttribute="trailing" constant="9" id="jVT-Dw-cxd"/>
<constraint firstAttribute="trailing" relation="greaterThanOrEqual" secondItem="k33-Yf-DbF" secondAttribute="trailing" constant="20" symbolic="YES" id="kql-Sm-3Q6"/>
<constraint firstItem="S7L-mA-j3Y" firstAttribute="baseline" secondItem="9GN-f6-r2j" secondAttribute="baseline" id="lQw-5e-sOv"/>
<constraint firstItem="etc-K7-Atw" firstAttribute="leading" secondItem="S7L-mA-j3Y" secondAttribute="trailing" constant="7" id="lRh-Vo-1XH"/>
<constraint firstItem="KWg-Ak-bB6" firstAttribute="firstBaseline" secondItem="muY-E0-hVI" secondAttribute="firstBaseline" id="lu4-VE-F0x"/>
+12 -4
View File
@@ -10,7 +10,7 @@ import AVFoundation
final class ArtworkSelectorViewItemLabel : NSTextField {
@IBInspectable var highlightColor: NSColor = .alternateSelectedControlColor
@IBInspectable var highlightColor: NSColor = .selectedContentBackgroundColor
@IBInspectable var highlightTextColor: NSColor = .alternateSelectedControlTextColor
@IBInspectable var cornerRadius: CGFloat = 3
@@ -162,7 +162,7 @@ final class ArtworkSelectorViewItemView: NSView {
backgroundLayer.anchorPoint = CGPoint.zero
backgroundLayer.position = CGPoint(x: 0, y: paddingBottom)
backgroundLayer.backgroundColor = NSColor.controlHighlightColor.cgColor
backgroundLayer.backgroundColor = NSColor.unemphasizedSelectedContentBackgroundColor.cgColor
backgroundLayer.cornerRadius = 8
backgroundLayer.isHidden = true
backgroundLayer.isOpaque = true
@@ -171,7 +171,7 @@ final class ArtworkSelectorViewItemView: NSView {
emptyLayer.position = CGPoint(x: padding, y: padding + paddingBottom)
emptyLayer.lineWidth = 3.0
emptyLayer.lineDashPattern = [12,5]
emptyLayer.strokeColor = NSColor.secondarySelectedControlColor.cgColor
emptyLayer.strokeColor = NSColor.unemphasizedSelectedContentBackgroundColor.cgColor
emptyLayer.fillColor = NSColor.windowBackgroundColor.cgColor
emptyLayer.isOpaque = true
@@ -197,7 +197,14 @@ final class ArtworkSelectorViewItemView: NSView {
}
private func updateBackgroundColor() {
if #available(OSX 10.14, *) {
if #available(macOS 11, *) {
effectiveAppearance.performAsCurrentDrawingAppearance {
imageLayer.shadowColor = NSColor.labelColor.cgColor
backgroundLayer.backgroundColor = NSColor.unemphasizedSelectedContentBackgroundColor.cgColor
emptyLayer.strokeColor = NSColor.unemphasizedSelectedContentBackgroundColor.cgColor
emptyLayer.fillColor = NSColor.windowBackgroundColor.cgColor
}
} else {
let saved = NSAppearance.current
NSAppearance.current = effectiveAppearance
@@ -337,6 +344,7 @@ final class ArtworkSelectorViewItem: NSCollectionViewItem {
// MARK: Actions
// FIXME
override func mouseUp(with event: NSEvent) {
if event.clickCount > 1, let action = doubleAction {
target?.performSelector(onMainThread: action, with: nil, waitUntilDone: true)
+4 -5
View File
@@ -1,8 +1,8 @@
<?xml version="1.0" encoding="UTF-8"?>
<document type="com.apple.InterfaceBuilder3.Cocoa.XIB" version="3.0" toolsVersion="24127" targetRuntime="MacOSX.Cocoa" propertyAccessControl="none" useAutolayout="YES" customObjectInstantitationMethod="direct">
<document type="com.apple.InterfaceBuilder3.Cocoa.XIB" version="3.0" toolsVersion="25098" targetRuntime="MacOSX.Cocoa" propertyAccessControl="none" useAutolayout="YES" customObjectInstantitationMethod="direct">
<dependencies>
<deployment identifier="macosx"/>
<plugIn identifier="com.apple.InterfaceBuilder.CocoaPlugin" version="24127"/>
<plugIn identifier="com.apple.InterfaceBuilder.CocoaPlugin" version="25098"/>
<capability name="documents saved in the Xcode 8 format" minToolsVersion="8.0"/>
</dependencies>
<objects>
@@ -19,7 +19,7 @@
<rect key="frame" x="0.0" y="0.0" width="128" height="171"/>
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMinY="YES"/>
<subviews>
<textField wantsLayer="YES" horizontalHuggingPriority="251" verticalHuggingPriority="750" textCompletion="NO" translatesAutoresizingMaskIntoConstraints="NO" id="Wkh-6c-0tU" customClass="ArtworkSelectorViewItemLabel" customModule="Subler" customModuleProvider="target">
<textField wantsLayer="YES" focusRingType="none" horizontalHuggingPriority="251" verticalHuggingPriority="750" textCompletion="NO" translatesAutoresizingMaskIntoConstraints="NO" id="Wkh-6c-0tU" customClass="ArtworkSelectorViewItemLabel" customModule="Subler" customModuleProvider="target">
<rect key="frame" x="-4" y="17" width="136" height="15"/>
<textFieldCell key="cell" lineBreakMode="truncatingTail" allowsUndo="NO" alignment="center" title="Label" usesSingleLineMode="YES" id="TsL-Ak-xnf">
<font key="font" metaFont="cellTitle"/>
@@ -27,7 +27,7 @@
<color key="backgroundColor" name="textBackgroundColor" catalog="System" colorSpace="catalog"/>
</textFieldCell>
</textField>
<textField wantsLayer="YES" horizontalHuggingPriority="251" verticalHuggingPriority="750" textCompletion="NO" translatesAutoresizingMaskIntoConstraints="NO" id="fGU-Kh-WjD">
<textField wantsLayer="YES" focusRingType="none" horizontalHuggingPriority="251" verticalHuggingPriority="750" textCompletion="NO" translatesAutoresizingMaskIntoConstraints="NO" id="fGU-Kh-WjD">
<rect key="frame" x="-4" y="4" width="136" height="13"/>
<textFieldCell key="cell" lineBreakMode="truncatingTail" allowsUndo="NO" alignment="center" title="Label" usesSingleLineMode="YES" id="ggX-Q2-CZ0">
<font key="font" metaFont="system" size="10"/>
@@ -40,7 +40,6 @@
<constraint firstItem="fGU-Kh-WjD" firstAttribute="leading" secondItem="Hz6-mo-xeY" secondAttribute="leading" constant="-2" id="0Wf-6t-6Lg"/>
<constraint firstAttribute="trailing" secondItem="Wkh-6c-0tU" secondAttribute="trailing" constant="-2" id="9df-FA-2lX"/>
<constraint firstAttribute="bottom" secondItem="Wkh-6c-0tU" secondAttribute="bottom" constant="17" id="EOh-x3-ntT"/>
<constraint firstItem="Wkh-6c-0tU" firstAttribute="top" relation="greaterThanOrEqual" secondItem="Hz6-mo-xeY" secondAttribute="top" constant="20" id="HaR-VX-NRg"/>
<constraint firstAttribute="bottom" secondItem="fGU-Kh-WjD" secondAttribute="bottom" constant="4" id="Xx6-ak-lcw"/>
<constraint firstItem="Wkh-6c-0tU" firstAttribute="leading" secondItem="Hz6-mo-xeY" secondAttribute="leading" constant="-2" id="cPi-y8-nFz"/>
<constraint firstAttribute="trailing" secondItem="fGU-Kh-WjD" secondAttribute="trailing" constant="-2" id="fLm-DU-mGT"/>
+8 -1
View File
@@ -7,6 +7,7 @@
import Cocoa
import MP42Foundation
import UniformTypeIdentifiers
final class DocumentWindowController: NSWindowController, TracksViewControllerDelegate, MetadataSearchViewControllerDelegate, FileImportControllerDelegate, ProgressViewControllerDelegate, NSDraggingDestination, NSUserInterfaceValidations {
@@ -464,7 +465,13 @@ final class DocumentWindowController: NSWindowController, TracksViewControllerDe
panel.allowsMultipleSelection = false
panel.canChooseFiles = true
panel.canChooseDirectories = false
panel.allowedFileTypes = ["mp4", "m4v", "m4a", "xml", "nfo"]
if #available(macOS 12, *) {
panel.allowedContentTypes = [.mpeg4Movie, .mpeg4Audio,
.appleProtectedMPEG4Video,
.xml, UTType(filenameExtension: "nfo")!]
} else {
panel.allowedFileTypes = ["mp4", "m4v", "m4a", "xml", "nfo"]
}
panel.beginSheetModal(for: windowForSheet) { (response) in
if response == NSApplication.ModalResponse.OK, let url = panel.url {
+7 -9
View File
@@ -117,12 +117,12 @@ final class PresetManager {
let resourceValues = try fileURL.resourceValues(forKeys: [.isDirectoryKey])
if resourceValues.isDirectory == false, let version = version(of: fileURL) {
let data = try Data(contentsOf: fileURL)
let unarchiver = NSKeyedUnarchiver(forReadingWith: data)
unarchiver.requiresSecureCoding = true
defer { unarchiver.finishDecoding() }
if let unarchiver = try? NSKeyedUnarchiver(forReadingFrom: data) {
defer { unarchiver.finishDecoding() }
if version == 2, let preset = try? unarchiver.decodeTopLevelObject(of: [MetadataPreset.self], forKey: NSKeyedArchiveRootObjectKey) as? MetadataPreset {
return preset
if version == 2, let preset = try? unarchiver.decodeTopLevelObject(of: [MetadataPreset.self], forKey: NSKeyedArchiveRootObjectKey) as? MetadataPreset {
return preset
}
}
}
throw LoadError.unsupportedFile
@@ -148,13 +148,11 @@ final class PresetManager {
}
private func save(preset: Preset) throws {
let data = NSMutableData()
let archiver = NSKeyedArchiver(forWritingWith: data)
archiver.requiresSecureCoding = true
let archiver = NSKeyedArchiver(requiringSecureCoding: true)
archiver.encode(preset, forKey: NSKeyedArchiveRootObjectKey)
archiver.finishEncoding()
try data.write(to: preset.fileURL, options: [.atomic])
try archiver.encodedData.write(to: preset.fileURL, options: [.atomic])
preset.changed = false
}
+12 -11
View File
@@ -932,7 +932,11 @@ class MovieViewController: PropertyView, NSTableViewDataSource, ExpandedTableVie
panel.allowsMultipleSelection = true
panel.canChooseFiles = true
panel.canChooseDirectories = false
panel.allowedFileTypes = ["public.image"]
if #available(macOS 11, *) {
panel.allowedContentTypes = [.image]
} else {
panel.allowedFileTypes = ["public.image"]
}
guard let window = view.window else { return }
@@ -994,14 +998,11 @@ class MovieViewController: PropertyView, NSTableViewDataSource, ExpandedTableVie
func filePromiseProvider(_ filePromiseProvider: NSFilePromiseProvider, writePromiseTo url: URL, completionHandler: @escaping (Error?) -> Void) {
if let userInfo = filePromiseProvider.userInfo as? [String: AnyObject] {
do {
if let indexPathData = userInfo[FilePromiseProvider.UserInfoKeys.indexPathKey] as? Data {
if let indexPath = try NSKeyedUnarchiver.unarchiveTopLevelObjectWithData(indexPathData) as? IndexPath {
let item = artworks[indexPath.last!]
if let image = item.imageValue {
try image.data?.write(to: url)
completionHandler(nil)
}
}
if let indexPathData = userInfo[FilePromiseProvider.UserInfoKeys.indexPathKey] as? Data,
let indexPath = try NSKeyedUnarchiver.unarchivedObject(ofClasses: [NSIndexPath.classForCoder()], from: indexPathData) as? IndexPath,
let image = artworks[indexPath.last!].imageValue {
try image.data?.write(to: url)
completionHandler(nil)
}
} catch {
fatalError("failed to unarchive indexPath from promise provider.")
@@ -1114,7 +1115,7 @@ class MovieViewController: PropertyView, NSTableViewDataSource, ExpandedTableVie
if let pasteboardItem = draggingItem.item as? NSPasteboardItem {
do {
if let indexPathData = pasteboardItem.data(forType: .artworkDragType),
let itemIndexPath = try NSKeyedUnarchiver.unarchiveTopLevelObjectWithData(indexPathData) as? IndexPath {
let itemIndexPath = try NSKeyedUnarchiver.unarchivedObject(ofClasses: [NSIndexPath.classForCoder()], from:indexPathData) as? IndexPath {
indexes.insert(itemIndexPath)
}
} catch {
@@ -1246,7 +1247,7 @@ class MovieViewController: PropertyView, NSTableViewDataSource, ExpandedTableVie
for pasteboardItem in items {
do {
if let indexPathData = pasteboardItem.data(forType: .artworkDragType),
let itemIndexPath = try NSKeyedUnarchiver.unarchiveTopLevelObjectWithData(indexPathData) as? IndexPath {
let itemIndexPath = try NSKeyedUnarchiver.unarchivedObject(ofClasses: [NSIndexPath.classForCoder()], from:indexPathData) as? IndexPath {
indexes.insert(itemIndexPath)
}
} catch {
+3 -6
View File
@@ -46,8 +46,7 @@ final class Queue {
do {
let data = try Data(contentsOf: url)
let unarchiver = NSKeyedUnarchiver(forReadingWith: data)
unarchiver.requiresSecureCoding = true
let unarchiver = try NSKeyedUnarchiver(forReadingFrom: data)
if let decodedItems = try unarchiver.decodeTopLevelObject(of: [NSArray.classForCoder(), NSMutableArray.classForCoder(), QueueItem.classForCoder()], forKey: NSKeyedArchiveRootObjectKey) as? [QueueItem] {
items = decodedItems
} else {
@@ -63,13 +62,11 @@ final class Queue {
func saveToDisk() throws {
arrayQueue.sync {
let data = NSMutableData()
let archiver = NSKeyedArchiver(forWritingWith: data)
archiver.requiresSecureCoding = true
let archiver = NSKeyedArchiver(requiringSecureCoding: true)
archiver.encode(items, forKey: NSKeyedArchiveRootObjectKey)
archiver.finishEncoding()
data.write(to: url, atomically: true)
try? archiver.encodedData.write(to: url, options: [.atomic])
}
}
+37 -25
View File
@@ -19,10 +19,15 @@ final class QueueController : NSWindowController, NSWindowDelegate, NSPopoverDel
private var windowController: OptionsViewController?
private let toolbarDelegate = QueueToolbarDelegate()
private let tablePasteboardType = NSPasteboard.PasteboardType("SublerQueueTableViewDataType")
private lazy var docImg: NSImage = {
// Load a generic movie icon to display in the table view
let img = NSWorkspace.shared.icon(forFileType: "mov")
let img = {
if #available(macOS 12, *) {
return NSWorkspace.shared.icon(for: .quickTimeMovie)
} else {
return NSWorkspace.shared.icon(forFileType: "mov")
}
}()
img.size = NSSize(width: 16, height: 16)
return img
}()
@@ -74,7 +79,7 @@ final class QueueController : NSWindowController, NSWindowDelegate, NSPopoverDel
}
self.window?.toolbar = toolbar
table.registerForDraggedTypes([NSPasteboard.PasteboardType.fileURL, tablePasteboardType])
table.registerForDraggedTypes([NSPasteboard.PasteboardType.fileURL, .tableViewIndex])
progressBar.isHidden = true
let main = OperationQueue.main
@@ -771,41 +776,48 @@ final class QueueController : NSWindowController, NSWindowDelegate, NSPopoverDel
//MARK: Drag & Drop
func tableView(_ tableView: NSTableView, writeRowsWith rowIndexes: IndexSet, to pboard: NSPasteboard) -> Bool {
let data = try? NSKeyedArchiver.archivedData(withRootObject: rowIndexes, requiringSecureCoding: true)
pboard.declareTypes([tablePasteboardType], owner: self)
pboard.setData(data, forType: tablePasteboardType)
return true
func tableView(_ tableView: NSTableView,
pasteboardWriterForRow row: Int) -> (any NSPasteboardWriting)? {
let item = PasteboardItem(index: row, type: .tableViewIndex)
return item
}
func tableView(_ tableView: NSTableView, validateDrop info: NSDraggingInfo, proposedRow row: Int, proposedDropOperation dropOperation: NSTableView.DropOperation) -> NSDragOperation {
if info.draggingSource == nil {
tableView.setDropRow(row, dropOperation: .above)
func tableView(_ tableView: NSTableView,
validateDrop info: NSDraggingInfo,
proposedRow row: Int,
proposedDropOperation dropOperation: NSTableView.DropOperation) -> NSDragOperation {
guard dropOperation == .above else { return [] }
if let source = info.draggingSource as? NSTableView,
tableView == source
{
return .move
} else if info.draggingSource == nil {
return .copy
} else if let source = info.draggingSource as? NSTableView, tableView == source && dropOperation == .above {
return .every
} else {
return []
}
}
func tableView(_ tableView: NSTableView, acceptDrop info: NSDraggingInfo, row: Int, dropOperation: NSTableView.DropOperation) -> Bool {
let pboard = info.draggingPasteboard
if let source = info.draggingSource as? NSTableView, source == tableView, let rowData = pboard.data(forType: tablePasteboardType), let rowIndexes = NSKeyedUnarchiver.unarchiveObject(with: rowData) as? IndexSet {
func tableView(_ tableView: NSTableView,
acceptDrop info: NSDraggingInfo,
row: Int,
dropOperation: NSTableView.DropOperation) -> Bool {
guard let pasteboardItems = info.draggingPasteboard.pasteboardItems
else { return false }
if let source = info.draggingSource as? NSTableView,
source == tableView
{
let rowIndexes = IndexSet(pasteboardItems.compactMap { $0.integer(forType: .tableViewIndex) })
let items = queue.items(at: rowIndexes)
move(items: items, at: row)
return true
} else {
if pboard.types?.contains(NSPasteboard.PasteboardType.fileURL) ?? false {
if let items = pboard.readObjects(forClasses: [NSURL.classForCoder()], options: [:]) as? [URL] {
insert(contentOf: items, at: row)
}
return true
} else if info.draggingPasteboard.types?.contains(NSPasteboard.PasteboardType.fileURL) ?? false {
if let items = info.draggingPasteboard.readObjects(forClasses: [NSURL.classForCoder()], options: [:]) as? [URL] {
insert(contentOf: items, at: row)
}
return true
}
return false
+8 -3
View File
@@ -43,10 +43,15 @@ final class SaveOptions: NSViewController {
let types = doc.writableTypes(for: .saveAsOperation)
fileFormat.removeAllItems()
for type in types {
let name = UTTypeCopyDescription(type as CFString)?.takeRetainedValue() as String? ?? type
fileFormat.addItem(withTitle: name)
if #available(macOS 11, *) {
let name = UTType(type)?.localizedDescription ?? type
fileFormat.addItem(withTitle: name)
} else {
let name = UTTypeCopyDescription(type as CFString)?.takeRetainedValue() as String? ?? type
fileFormat.addItem(withTitle: name)
}
}
}
+1 -1
View File
@@ -18,7 +18,7 @@ final class TokenFieldCell : NSTokenFieldCell {
set (newBackgroundStyle) {
super.backgroundStyle = newBackgroundStyle
if newBackgroundStyle == NSView.BackgroundStyle.emphasized {
textColor = NSColor.controlHighlightColor
textColor = NSColor.highlightColor
} else {
textColor = NSColor.controlTextColor
}
+20 -24
View File
@@ -30,7 +30,6 @@ final class TracksViewController: NSViewController, NSTableViewDataSource, NSTab
}
@IBOutlet var tracksTable: ExpandedTableView!
private let pasteboardType = NSPasteboard.PasteboardType(rawValue: "SublerTableViewDataType")
private static let languagesMenu: NSMenu = {
let menu = NSMenu()
@@ -50,7 +49,7 @@ final class TracksViewController: NSViewController, NSTableViewDataSource, NSTab
override func viewDidLoad() {
super.viewDidLoad()
tracksTable.registerForDraggedTypes([pasteboardType])
tracksTable.registerForDraggedTypes([.tableViewIndex])
tracksTable.doubleAction = #selector(doubleClickAction)
tracksTable.scrollRowToVisible(0)
}
@@ -245,32 +244,26 @@ final class TracksViewController: NSViewController, NSTableViewDataSource, NSTab
// MARK: Drag & drop
func tableView(_ tableView: NSTableView,
writeRowsWith rowIndexes: IndexSet,
to pboard: NSPasteboard) -> Bool {
guard let firstRow = rowIndexes.first,
let track = track(at: firstRow), track.isMuxed == false
else { return false }
let data = try? NSKeyedArchiver.archivedData(withRootObject: rowIndexes, requiringSecureCoding: true)
pboard.declareTypes([pasteboardType], owner: self)
pboard.setData(data, forType: pasteboardType)
return true
pasteboardWriterForRow row: Int) -> (any NSPasteboardWriting)? {
return PasteboardItem(index: row, type: .tableViewIndex)
}
func tableView(_ tableView: NSTableView,
validateDrop info: NSDraggingInfo,
proposedRow row: Int,
proposedDropOperation: NSTableView.DropOperation) -> NSDragOperation {
let count = mp4.tracks.count + 1
proposedDropOperation dropOperation: NSTableView.DropOperation) -> NSDragOperation {
guard dropOperation == .above else { return [] }
if proposedDropOperation == .above {
if row < count && row != 0, let track = track(at: row), track.isMuxed == false {
return .every
}
else if row == count {
return .every
}
guard let source = info.draggingSource as? NSTableView,
tableView == source else { return [] }
let count = mp4.tracks.count + 1
if row < count && row != 0, let track = track(at: row), track.isMuxed == false {
return .move
} else if row == count {
return .move
}
return []
}
@@ -278,12 +271,15 @@ final class TracksViewController: NSViewController, NSTableViewDataSource, NSTab
acceptDrop info: NSDraggingInfo,
row: Int,
dropOperation: NSTableView.DropOperation) -> Bool {
let data: Data = info.draggingPasteboard.data(forType: pasteboardType)!
if let rowIndexes: IndexSet = NSKeyedUnarchiver.unarchiveObject(with: data) as? IndexSet, rowIndexes.isEmpty == false {
guard let pasteboardItems = info.draggingPasteboard.pasteboardItems
else { return false }
if let source = info.draggingSource as? NSTableView,
source == tableView
{
let rowIndexes = IndexSet(pasteboardItems.compactMap { $0.integer(forType: .tableViewIndex) })
let tracks = mp4.tracks.enumerated().filter { rowIndexes.contains($0.offset + 1)} .map { $0.element }
mp4.moveTracks(tracks, to: UInt(row - 1))
tableView.reloadData()
return true
}
+64
View File
@@ -0,0 +1,64 @@
//
// PasteboardItem.swift
// Subler
//
// Created by Damiano Galassi on 22/09/2026.
//
import Cocoa
extension NSPasteboard.PasteboardType {
static let tableViewIndex = NSPasteboard.PasteboardType("org.subler.tableViewIndex")
}
class PasteboardItem: NSObject, NSPasteboardWriting {
let index: Int
let type: NSPasteboard.PasteboardType
init(index: Int, type: NSPasteboard.PasteboardType) {
self.index = index
self.type = type
}
func writableTypes(for pasteboard: NSPasteboard) -> [NSPasteboard.PasteboardType] {
return [type]
}
func pasteboardPropertyList(forType type: NSPasteboard.PasteboardType) -> Any? {
switch type {
case self.type:
return index
default:
return nil
}
}
}
extension NSPasteboardItem {
func integer(forType type: NSPasteboard.PasteboardType) -> Int? {
guard let data = data(forType: type) else { return nil }
let plist = try? PropertyListSerialization.propertyList(
from: data,
options: .mutableContainers,
format: nil)
return plist as? Int
}
}
extension Array {
mutating func move(from start: Index, to end: Index) {
guard (0..<count) ~= start, (0...count) ~= end else { return }
if start == end { return }
let targetIndex = start < end ? end - 1 : end
insert(remove(at: start), at: targetIndex)
}
mutating func move(with indexes: IndexSet, to toIndex: Index) {
let movingData = indexes.map{ self[$0] }
let targetIndex = toIndex - indexes.filter{ $0 < toIndex }.count
for (i, e) in indexes.enumerated() {
remove(at: e - i)
}
insert(contentsOf: movingData, at: targetIndex)
}
}
+4
View File
@@ -35,6 +35,7 @@
A91B196C1F2B0DCB0008675F /* QueueAction.swift in Sources */ = {isa = PBXBuildFile; fileRef = A91B196B1F2B0DCB0008675F /* QueueAction.swift */; };
A91EB969205ABAF400392E1C /* NSWindowAdditions.swift in Sources */ = {isa = PBXBuildFile; fileRef = A91EB968205ABAF400392E1C /* NSWindowAdditions.swift */; };
A91F0FA023797F2800C9DCC9 /* PropertyView.swift in Sources */ = {isa = PBXBuildFile; fileRef = A91F0F9F23797F2800C9DCC9 /* PropertyView.swift */; };
A92395043062A588008061F3 /* PasteboardItem.swift in Sources */ = {isa = PBXBuildFile; fileRef = A92395023062A584008061F3 /* PasteboardItem.swift */; };
A924A51E1D4B9E93008301A7 /* MetadataPrefsViewController.xib in Resources */ = {isa = PBXBuildFile; fileRef = A924A5201D4B9E93008301A7 /* MetadataPrefsViewController.xib */; };
A925AA8518378D8A00BE84D4 /* MP42Foundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = A925AA8218378D7900BE84D4 /* MP42Foundation.framework */; };
A925AA8818378DD000BE84D4 /* MP42Foundation.framework in Copy Files */ = {isa = PBXBuildFile; fileRef = A925AA8218378D7900BE84D4 /* MP42Foundation.framework */; settings = {ATTRIBUTES = (CodeSignOnCopy, ); }; };
@@ -252,6 +253,7 @@
A91B196B1F2B0DCB0008675F /* QueueAction.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; name = QueueAction.swift; path = Classes/QueueAction.swift; sourceTree = "<group>"; };
A91EB968205ABAF400392E1C /* NSWindowAdditions.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; name = NSWindowAdditions.swift; path = Classes/NSWindowAdditions.swift; sourceTree = "<group>"; };
A91F0F9F23797F2800C9DCC9 /* PropertyView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; name = PropertyView.swift; path = Classes/PropertyView/PropertyView.swift; sourceTree = "<group>"; };
A92395023062A584008061F3 /* PasteboardItem.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = PasteboardItem.swift; sourceTree = "<group>"; };
A924A50D1D4B9E66008301A7 /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.xib; name = Base; path = Classes/PropertyView/Base.lproj/ChapterView.xib; sourceTree = "<group>"; };
A924A50E1D4B9E66008301A7 /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.xib; name = Base; path = Classes/PropertyView/Base.lproj/EmptyView.xib; sourceTree = "<group>"; };
A924A50F1D4B9E66008301A7 /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.xib; name = Base; path = Classes/PropertyView/Base.lproj/MovieView.xib; sourceTree = "<group>"; };
@@ -527,6 +529,7 @@
A9A77C4D1F306FA70018023B /* AttributedStyles.swift */,
A956CE681F99E93D00093992 /* ButtonToolbarItem.swift */,
A9E385772C316FBE000A050D /* CollectionView.swift */,
A92395023062A584008061F3 /* PasteboardItem.swift */,
A9E3857B2C317010000A050D /* FilePromiseProvider.swift */,
);
name = "Other Sources";
@@ -945,6 +948,7 @@
A98D44102036F661005CB092 /* AppDelegate.swift in Sources */,
A9C31E572029A75F00CEF474 /* GeneralPrefsViewController.swift in Sources */,
A9AE26C01F3B66470041A57D /* SquaredTVArt.swift in Sources */,
A92395043062A588008061F3 /* PasteboardItem.swift in Sources */,
A9B1056E2025D9B9009E91FC /* TracksViewController.swift in Sources */,
A9C51DF42E4B4548003E82E6 /* ScriptCommand.swift in Sources */,
A99B7FD82D53764F0027BCB5 /* AppleTVv3.swift in Sources */,