Update
This commit is contained in:
9
CHANGELOG.md
Normal file
9
CHANGELOG.md
Normal file
@@ -0,0 +1,9 @@
|
||||
# Changelog
|
||||
All notable changes to this project will be documented in this file.
|
||||
|
||||
## [0.1.5]
|
||||
- Add version check
|
||||
- Fix bug reading Vorbis comments (support mixed case tagnames)
|
||||
|
||||
## [0.1.4]
|
||||
- Initial Release
|
||||
3
Console/tail.sh
Executable file
3
Console/tail.sh
Executable file
@@ -0,0 +1,3 @@
|
||||
#!/bin/bash
|
||||
|
||||
tail -F $1
|
||||
569
MainMenu.nib/designable.nib
generated
Normal file
569
MainMenu.nib/designable.nib
generated
Normal file
@@ -0,0 +1,569 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<document type="com.apple.InterfaceBuilder3.Cocoa.XIB" version="3.0" toolsVersion="14113" targetRuntime="MacOSX.Cocoa" propertyAccessControl="none">
|
||||
<dependencies>
|
||||
<plugIn identifier="com.apple.InterfaceBuilder.CocoaPlugin" version="14113"/>
|
||||
<plugIn identifier="com.apple.WebKitIBPlugin" version="14113"/>
|
||||
<capability name="box content view" minToolsVersion="7.0"/>
|
||||
<capability name="documents saved in the Xcode 8 format" minToolsVersion="8.0"/>
|
||||
</dependencies>
|
||||
<objects>
|
||||
<customObject id="-2" userLabel="File's Owner" customClass="NSApplication">
|
||||
<connections>
|
||||
<outlet property="delegate" destination="207" id="210"/>
|
||||
</connections>
|
||||
</customObject>
|
||||
<customObject id="-1" userLabel="First Responder" customClass="FirstResponder"/>
|
||||
<customObject id="-3" userLabel="Application" customClass="NSObject">
|
||||
<connections>
|
||||
<outlet property="delegate" destination="207" id="446"/>
|
||||
</connections>
|
||||
</customObject>
|
||||
<customObject id="207" userLabel="ScriptExecController" customClass="ScriptExecController">
|
||||
<connections>
|
||||
<outlet property="aboutMenuItem" destination="232" id="238"/>
|
||||
<outlet property="dropletBox" destination="494" id="502"/>
|
||||
<outlet property="dropletDropFilesLabel" destination="499" id="507"/>
|
||||
<outlet property="dropletMessageTextField" destination="505" id="508"/>
|
||||
<outlet property="dropletProgressIndicator" destination="496" id="504"/>
|
||||
<outlet property="dropletShaderView" destination="519" id="w2q-dA-smc"/>
|
||||
<outlet property="dropletWindow" destination="490" id="512"/>
|
||||
<outlet property="hideMenuItem" destination="134" id="239"/>
|
||||
<outlet property="openRecentMenuItem" destination="FvD-xH-BRz" id="V8D-h2-Uw1"/>
|
||||
<outlet property="progressBarCancelButton" destination="206" id="299"/>
|
||||
<outlet property="progressBarDetailsLabel" destination="290" id="300"/>
|
||||
<outlet property="progressBarDetailsTriangle" destination="288" id="301"/>
|
||||
<outlet property="progressBarIndicator" destination="204" id="298"/>
|
||||
<outlet property="progressBarMessageTextField" destination="205" id="297"/>
|
||||
<outlet property="progressBarTextView" destination="307" id="516"/>
|
||||
<outlet property="progressBarWindow" destination="21" id="296"/>
|
||||
<outlet property="quitMenuItem" destination="136" id="240"/>
|
||||
<outlet property="textWindow" destination="216" id="dD5-aT-ujC"/>
|
||||
<outlet property="textWindowCancelButton" destination="220" id="uuU-Xb-xDZ"/>
|
||||
<outlet property="textWindowMessageTextField" destination="366" id="bT3-oV-9zc"/>
|
||||
<outlet property="textWindowProgressIndicator" destination="230" id="AXd-F1-wQr"/>
|
||||
<outlet property="textWindowTextView" destination="225" id="FZy-wJ-th1"/>
|
||||
<outlet property="webView" destination="258" id="GEt-Hd-OFL"/>
|
||||
<outlet property="webViewCancelButton" destination="251" id="i5n-LY-nJs"/>
|
||||
<outlet property="webViewMessageTextField" destination="509" id="Unv-5h-E6P"/>
|
||||
<outlet property="webViewProgressIndicator" destination="277" id="Hun-a2-4wC"/>
|
||||
<outlet property="webViewWindow" destination="247" id="9lw-Pg-xRw"/>
|
||||
<outlet property="windowMenu" destination="24" id="328"/>
|
||||
</connections>
|
||||
</customObject>
|
||||
<window allowsToolTipsWhenApplicationIsInactive="NO" autorecalculatesKeyViewLoop="NO" releasedWhenClosed="NO" visibleAtLaunch="NO" frameAutosaveName="ProgressBarWindow" animationBehavior="default" id="21" userLabel="ProgressWindow">
|
||||
<windowStyleMask key="styleMask" titled="YES" miniaturizable="YES" resizable="YES"/>
|
||||
<windowPositionMask key="initialPositionMask" leftStrut="YES" rightStrut="YES" topStrut="YES" bottomStrut="YES"/>
|
||||
<rect key="contentRect" x="472" y="537" width="438" height="83"/>
|
||||
<rect key="screenRect" x="0.0" y="0.0" width="1440" height="878"/>
|
||||
<value key="minSize" type="size" width="438" height="83"/>
|
||||
<value key="maxSize" type="size" width="600" height="83"/>
|
||||
<view key="contentView" id="2">
|
||||
<rect key="frame" x="0.0" y="0.0" width="438" height="83"/>
|
||||
<autoresizingMask key="autoresizingMask"/>
|
||||
<subviews>
|
||||
<progressIndicator wantsLayer="YES" verticalHuggingPriority="750" maxValue="100" bezeled="NO" indeterminate="YES" style="bar" id="204">
|
||||
<rect key="frame" x="18" y="27" width="310" height="20"/>
|
||||
<autoresizingMask key="autoresizingMask" widthSizable="YES" flexibleMinY="YES"/>
|
||||
</progressIndicator>
|
||||
<textField verticalHuggingPriority="750" allowsCharacterPickerTouchBarItem="YES" id="205">
|
||||
<rect key="frame" x="18" y="55" width="403" height="17"/>
|
||||
<autoresizingMask key="autoresizingMask" widthSizable="YES" flexibleMinY="YES"/>
|
||||
<textFieldCell key="cell" lineBreakMode="clipping" sendsActionOnEndEditing="YES" baseWritingDirection="leftToRight" alignment="left" id="472">
|
||||
<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>
|
||||
<button verticalHuggingPriority="750" id="206">
|
||||
<rect key="frame" x="338" y="20" width="86" height="32"/>
|
||||
<autoresizingMask key="autoresizingMask" flexibleMinX="YES" flexibleMinY="YES"/>
|
||||
<buttonCell key="cell" type="push" title="Quit" bezelStyle="rounded" alignment="center" borderStyle="border" inset="2" id="473">
|
||||
<behavior key="behavior" pushIn="YES" lightByBackground="YES" lightByGray="YES"/>
|
||||
<font key="font" metaFont="system"/>
|
||||
<string key="keyEquivalent" base64-UTF8="YES">
|
||||
Gw
|
||||
</string>
|
||||
</buttonCell>
|
||||
<connections>
|
||||
<action selector="cancel:" target="207" id="215"/>
|
||||
</connections>
|
||||
</button>
|
||||
<button toolTip="Show details" horizontalHuggingPriority="750" verticalHuggingPriority="750" id="288">
|
||||
<rect key="frame" x="20" y="10" width="13" height="13"/>
|
||||
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMinY="YES"/>
|
||||
<buttonCell key="cell" type="disclosureTriangle" bezelStyle="disclosure" imagePosition="above" alignment="left" controlSize="small" borderStyle="border" inset="2" id="474">
|
||||
<behavior key="behavior" pushIn="YES" changeBackground="YES" changeGray="YES" lightByContents="YES"/>
|
||||
<font key="font" metaFont="smallSystem"/>
|
||||
</buttonCell>
|
||||
<connections>
|
||||
<action selector="toggleDetails:" target="207" id="303"/>
|
||||
</connections>
|
||||
</button>
|
||||
<textField verticalHuggingPriority="750" allowsCharacterPickerTouchBarItem="YES" id="290">
|
||||
<rect key="frame" x="33" y="7" width="41" height="17"/>
|
||||
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMinY="YES"/>
|
||||
<textFieldCell key="cell" controlSize="small" scrollable="YES" lineBreakMode="clipping" sendsActionOnEndEditing="YES" title="Details" id="475">
|
||||
<font key="font" metaFont="smallSystem"/>
|
||||
<color key="textColor" name="controlTextColor" catalog="System" colorSpace="catalog"/>
|
||||
<color key="backgroundColor" name="controlColor" catalog="System" colorSpace="catalog"/>
|
||||
</textFieldCell>
|
||||
</textField>
|
||||
<scrollView autohidesScrollers="YES" horizontalLineScroll="10" horizontalPageScroll="10" verticalLineScroll="10" verticalPageScroll="10" hasHorizontalScroller="NO" usesPredominantAxisScrolling="NO" id="304">
|
||||
<rect key="frame" x="20" y="-203" width="393" height="202"/>
|
||||
<autoresizingMask key="autoresizingMask" widthSizable="YES" flexibleMinY="YES"/>
|
||||
<clipView key="contentView" copiesOnScroll="NO" id="2mm-QF-kpX">
|
||||
<rect key="frame" x="1" y="1" width="391" height="200"/>
|
||||
<autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
|
||||
<subviews>
|
||||
<textView editable="NO" importsGraphics="NO" richText="NO" verticallyResizable="YES" findStyle="panel" allowsDocumentBackgroundColorChange="YES" linkDetection="YES" id="307">
|
||||
<rect key="frame" x="0.0" y="0.0" width="391" height="200"/>
|
||||
<autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
|
||||
<color key="backgroundColor" white="1" alpha="1" colorSpace="calibratedWhite"/>
|
||||
<size key="minSize" width="391" height="200"/>
|
||||
<size key="maxSize" width="463" height="10000000"/>
|
||||
<color key="insertionPointColor" white="0.0" alpha="1" colorSpace="calibratedWhite"/>
|
||||
<connections>
|
||||
<outlet property="delegate" destination="207" id="489"/>
|
||||
</connections>
|
||||
</textView>
|
||||
</subviews>
|
||||
<color key="backgroundColor" white="1" alpha="1" colorSpace="calibratedWhite"/>
|
||||
</clipView>
|
||||
<scroller key="horizontalScroller" hidden="YES" verticalHuggingPriority="750" doubleValue="1" horizontal="YES" id="481">
|
||||
<rect key="frame" x="-100" y="-100" width="87" height="18"/>
|
||||
<autoresizingMask key="autoresizingMask"/>
|
||||
</scroller>
|
||||
<scroller key="verticalScroller" hidden="YES" verticalHuggingPriority="750" doubleValue="0.39849624060150374" horizontal="NO" id="480">
|
||||
<rect key="frame" x="323" y="1" width="15" height="200"/>
|
||||
<autoresizingMask key="autoresizingMask"/>
|
||||
</scroller>
|
||||
</scrollView>
|
||||
</subviews>
|
||||
</view>
|
||||
<connections>
|
||||
<outlet property="delegate" destination="207" id="377"/>
|
||||
</connections>
|
||||
<point key="canvasLocation" x="67" y="301.5"/>
|
||||
</window>
|
||||
<menu title="MainMenu" systemMenu="main" id="29" userLabel="MainMenu">
|
||||
<items>
|
||||
<menuItem title="Application" id="56">
|
||||
<menu key="submenu" title="Application" systemMenu="apple" id="57">
|
||||
<items>
|
||||
<menuItem title="About" id="232">
|
||||
<modifierMask key="keyEquivalentModifierMask"/>
|
||||
<connections>
|
||||
<action selector="orderFrontStandardAboutPanel:" target="-2" id="237"/>
|
||||
</connections>
|
||||
</menuItem>
|
||||
<menuItem isSeparatorItem="YES" id="233">
|
||||
<modifierMask key="keyEquivalentModifierMask" command="YES"/>
|
||||
</menuItem>
|
||||
<menuItem title="Services" id="235">
|
||||
<menu key="submenu" title="Services" systemMenu="services" id="234"/>
|
||||
</menuItem>
|
||||
<menuItem isSeparatorItem="YES" id="236">
|
||||
<modifierMask key="keyEquivalentModifierMask" command="YES"/>
|
||||
</menuItem>
|
||||
<menuItem title="Hide" keyEquivalent="h" id="134">
|
||||
<connections>
|
||||
<action selector="hide:" target="-2" id="152"/>
|
||||
</connections>
|
||||
</menuItem>
|
||||
<menuItem title="Hide Others" keyEquivalent="h" id="145">
|
||||
<modifierMask key="keyEquivalentModifierMask" option="YES" command="YES"/>
|
||||
<connections>
|
||||
<action selector="hideOtherApplications:" target="-2" id="146"/>
|
||||
</connections>
|
||||
</menuItem>
|
||||
<menuItem title="Show All" id="150">
|
||||
<connections>
|
||||
<action selector="unhideAllApplications:" target="-2" id="153"/>
|
||||
</connections>
|
||||
</menuItem>
|
||||
<menuItem isSeparatorItem="YES" id="149">
|
||||
<modifierMask key="keyEquivalentModifierMask" command="YES"/>
|
||||
</menuItem>
|
||||
<menuItem title="Quit" keyEquivalent="q" id="136">
|
||||
<connections>
|
||||
<action selector="terminate:" target="-2" id="139"/>
|
||||
</connections>
|
||||
</menuItem>
|
||||
</items>
|
||||
</menu>
|
||||
</menuItem>
|
||||
<menuItem title="File" id="83">
|
||||
<menu key="submenu" title="File" id="81">
|
||||
<items>
|
||||
<menuItem title="Open…" keyEquivalent="o" id="72">
|
||||
<connections>
|
||||
<action selector="openFiles:" target="207" id="524"/>
|
||||
</connections>
|
||||
</menuItem>
|
||||
<menuItem title="Open Recent" id="FvD-xH-BRz">
|
||||
<modifierMask key="keyEquivalentModifierMask"/>
|
||||
<menu key="submenu" title="Open Recent" systemMenu="recentDocuments" id="QHk-NS-To3">
|
||||
<items>
|
||||
<menuItem title="Clear Menu" id="CWw-N0-5lz">
|
||||
<modifierMask key="keyEquivalentModifierMask"/>
|
||||
</menuItem>
|
||||
</items>
|
||||
</menu>
|
||||
</menuItem>
|
||||
<menuItem isSeparatorItem="YES" id="79">
|
||||
<modifierMask key="keyEquivalentModifierMask" command="YES"/>
|
||||
</menuItem>
|
||||
<menuItem title="Close" keyEquivalent="w" id="73">
|
||||
<connections>
|
||||
<action selector="performClose:" target="-1" id="193"/>
|
||||
</connections>
|
||||
</menuItem>
|
||||
<menuItem title="Save to File…" keyEquivalent="s" id="75">
|
||||
<connections>
|
||||
<action selector="saveToFile:" target="207" id="523"/>
|
||||
</connections>
|
||||
</menuItem>
|
||||
<menuItem isSeparatorItem="YES" id="74">
|
||||
<modifierMask key="keyEquivalentModifierMask" command="YES"/>
|
||||
</menuItem>
|
||||
<menuItem title="Page Setup…" keyEquivalent="P" id="77">
|
||||
<connections>
|
||||
<action selector="runPageLayout:" target="-1" id="87"/>
|
||||
</connections>
|
||||
</menuItem>
|
||||
<menuItem title="Print…" keyEquivalent="p" id="78">
|
||||
<connections>
|
||||
<action selector="print:" target="-1" id="86"/>
|
||||
</connections>
|
||||
</menuItem>
|
||||
</items>
|
||||
</menu>
|
||||
</menuItem>
|
||||
<menuItem title="Edit" id="163">
|
||||
<menu key="submenu" title="Edit" id="8AD-nO-Nv5">
|
||||
<items>
|
||||
<menuItem title="Undo" keyEquivalent="z" id="WsN-Bo-RAi">
|
||||
<connections>
|
||||
<action selector="undo:" target="-1" id="swp-Rd-xai"/>
|
||||
</connections>
|
||||
</menuItem>
|
||||
<menuItem title="Redo" keyEquivalent="z" id="lwR-9k-Jds">
|
||||
<modifierMask key="keyEquivalentModifierMask" option="YES" command="YES"/>
|
||||
<connections>
|
||||
<action selector="redo:" target="-1" id="t0d-JF-Jxf"/>
|
||||
</connections>
|
||||
</menuItem>
|
||||
<menuItem isSeparatorItem="YES" id="f7y-jW-w4a">
|
||||
<modifierMask key="keyEquivalentModifierMask" command="YES"/>
|
||||
</menuItem>
|
||||
<menuItem title="Cut" keyEquivalent="x" id="gYg-Fm-Vd0">
|
||||
<connections>
|
||||
<action selector="cut:" target="-1" id="uo1-1q-hcK"/>
|
||||
</connections>
|
||||
</menuItem>
|
||||
<menuItem title="Copy" keyEquivalent="c" id="gPx-QX-E5Y">
|
||||
<connections>
|
||||
<action selector="copy:" target="-1" id="dyg-Qh-MrF"/>
|
||||
</connections>
|
||||
</menuItem>
|
||||
<menuItem title="Paste" keyEquivalent="v" id="Onj-KJ-eWD">
|
||||
<connections>
|
||||
<action selector="paste:" target="-1" id="ZQo-9c-pWs"/>
|
||||
</connections>
|
||||
</menuItem>
|
||||
<menuItem title="Delete" id="NRV-Nu-dQo">
|
||||
<connections>
|
||||
<action selector="delete:" target="-1" id="PJy-am-8nR"/>
|
||||
</connections>
|
||||
</menuItem>
|
||||
<menuItem title="Select All" keyEquivalent="a" id="aZ7-KE-7Nh">
|
||||
<connections>
|
||||
<action selector="selectAll:" target="-1" id="gnq-iF-2hE"/>
|
||||
</connections>
|
||||
</menuItem>
|
||||
<menuItem isSeparatorItem="YES" id="ckZ-kQ-yF7">
|
||||
<modifierMask key="keyEquivalentModifierMask" command="YES"/>
|
||||
</menuItem>
|
||||
<menuItem title="Find" id="EgA-FB-eXQ">
|
||||
<menu key="submenu" title="Find" id="xIX-bE-bd8">
|
||||
<items>
|
||||
<menuItem title="Find…" tag="1" keyEquivalent="f" id="3k0-IU-cL5">
|
||||
<connections>
|
||||
<action selector="performFindPanelAction:" target="-1" id="wAh-50-CiI"/>
|
||||
</connections>
|
||||
</menuItem>
|
||||
<menuItem title="Find Next" tag="2" keyEquivalent="g" id="EAX-qd-XMX">
|
||||
<connections>
|
||||
<action selector="performFindPanelAction:" target="-1" id="LvO-Xz-du1"/>
|
||||
</connections>
|
||||
</menuItem>
|
||||
<menuItem title="Find Previous" tag="3" keyEquivalent="G" id="n5T-AH-BNm">
|
||||
<connections>
|
||||
<action selector="performFindPanelAction:" target="-1" id="FgQ-Gb-Qnu"/>
|
||||
</connections>
|
||||
</menuItem>
|
||||
<menuItem title="Use Selection for Find" tag="7" keyEquivalent="e" id="xKU-AA-Gj3">
|
||||
<connections>
|
||||
<action selector="performFindPanelAction:" target="-1" id="j7C-hb-eo3"/>
|
||||
</connections>
|
||||
</menuItem>
|
||||
<menuItem title="Jump to Selection" keyEquivalent="j" id="mpE-JG-s67">
|
||||
<connections>
|
||||
<action selector="centerSelectionInVisibleArea:" target="-1" id="H4Z-6R-SO2"/>
|
||||
</connections>
|
||||
</menuItem>
|
||||
</items>
|
||||
</menu>
|
||||
</menuItem>
|
||||
</items>
|
||||
</menu>
|
||||
</menuItem>
|
||||
<menuItem title="View" id="KUk-6o-tke">
|
||||
<menu key="submenu" title="View" id="ITS-DI-OJD">
|
||||
<items>
|
||||
<menuItem title="Make Text Bigger" keyEquivalent="+" id="Qae-cV-V7J">
|
||||
<connections>
|
||||
<action selector="makeTextBigger:" target="207" id="cHK-EO-JtV"/>
|
||||
</connections>
|
||||
</menuItem>
|
||||
<menuItem title="Make Text Smaller" keyEquivalent="-" id="Gv4-oc-1eL">
|
||||
<connections>
|
||||
<action selector="makeTextSmaller:" target="207" id="JTY-6k-ZKY"/>
|
||||
</connections>
|
||||
</menuItem>
|
||||
</items>
|
||||
</menu>
|
||||
</menuItem>
|
||||
<menuItem title="Window" id="19">
|
||||
<menu key="submenu" title="Window" systemMenu="window" id="24">
|
||||
<items>
|
||||
<menuItem title="Zoom" keyEquivalent="z" id="197">
|
||||
<modifierMask key="keyEquivalentModifierMask" shift="YES" command="YES"/>
|
||||
<connections>
|
||||
<action selector="performZoom:" target="-1" id="198"/>
|
||||
</connections>
|
||||
</menuItem>
|
||||
<menuItem title="Minimize" keyEquivalent="m" id="23">
|
||||
<connections>
|
||||
<action selector="performMiniaturize:" target="-1" id="37"/>
|
||||
</connections>
|
||||
</menuItem>
|
||||
<menuItem isSeparatorItem="YES" id="322">
|
||||
<modifierMask key="keyEquivalentModifierMask" command="YES"/>
|
||||
</menuItem>
|
||||
<menuItem title="Bring All to Front" id="5">
|
||||
<connections>
|
||||
<action selector="arrangeInFront:" target="-1" id="39"/>
|
||||
</connections>
|
||||
</menuItem>
|
||||
</items>
|
||||
</menu>
|
||||
</menuItem>
|
||||
</items>
|
||||
<connections>
|
||||
<outlet property="delegate" destination="207" id="525"/>
|
||||
</connections>
|
||||
<point key="canvasLocation" x="-21" y="164"/>
|
||||
</menu>
|
||||
<window allowsToolTipsWhenApplicationIsInactive="NO" autorecalculatesKeyViewLoop="NO" releasedWhenClosed="NO" showsToolbarButton="NO" visibleAtLaunch="NO" frameAutosaveName="TextWindow" animationBehavior="default" id="216" userLabel="TextOutputWindow">
|
||||
<windowStyleMask key="styleMask" titled="YES" miniaturizable="YES" resizable="YES"/>
|
||||
<windowPositionMask key="initialPositionMask" leftStrut="YES" rightStrut="YES" topStrut="YES" bottomStrut="YES"/>
|
||||
<rect key="contentRect" x="297" y="408" width="508" height="392"/>
|
||||
<rect key="screenRect" x="0.0" y="0.0" width="1440" height="878"/>
|
||||
<value key="minSize" type="size" width="400" height="200"/>
|
||||
<view key="contentView" id="217">
|
||||
<rect key="frame" x="0.0" y="0.0" width="508" height="392"/>
|
||||
<autoresizingMask key="autoresizingMask"/>
|
||||
<subviews>
|
||||
<button verticalHuggingPriority="750" id="220">
|
||||
<rect key="frame" x="416" y="7" width="86" height="32"/>
|
||||
<autoresizingMask key="autoresizingMask" flexibleMinX="YES" flexibleMaxY="YES"/>
|
||||
<buttonCell key="cell" type="push" title="Quit" bezelStyle="rounded" alignment="center" borderStyle="border" inset="2" id="476">
|
||||
<behavior key="behavior" pushIn="YES" lightByBackground="YES" lightByGray="YES"/>
|
||||
<font key="font" metaFont="system"/>
|
||||
<string key="keyEquivalent" base64-UTF8="YES">
|
||||
Gw
|
||||
</string>
|
||||
</buttonCell>
|
||||
<connections>
|
||||
<action selector="cancel:" target="207" id="223"/>
|
||||
</connections>
|
||||
</button>
|
||||
<scrollView autohidesScrollers="YES" horizontalLineScroll="10" horizontalPageScroll="10" verticalLineScroll="10" verticalPageScroll="10" hasHorizontalScroller="NO" usesPredominantAxisScrolling="NO" id="226">
|
||||
<rect key="frame" x="9" y="45" width="489" height="339"/>
|
||||
<autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
|
||||
<clipView key="contentView" drawsBackground="NO" copiesOnScroll="NO" id="Hk1-72-Owa">
|
||||
<rect key="frame" x="1" y="1" width="487" height="337"/>
|
||||
<autoresizingMask key="autoresizingMask"/>
|
||||
<subviews>
|
||||
<textView editable="NO" importsGraphics="NO" richText="NO" verticallyResizable="YES" usesFontPanel="YES" findStyle="panel" allowsDocumentBackgroundColorChange="YES" linkDetection="YES" id="225">
|
||||
<rect key="frame" x="0.0" y="0.0" width="487" height="337"/>
|
||||
<autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
|
||||
<color key="backgroundColor" white="1" alpha="1" colorSpace="calibratedWhite"/>
|
||||
<size key="minSize" width="487" height="337"/>
|
||||
<size key="maxSize" width="489" height="10000000"/>
|
||||
<color key="insertionPointColor" white="0.0" alpha="1" colorSpace="calibratedWhite"/>
|
||||
<connections>
|
||||
<outlet property="delegate" destination="207" id="488"/>
|
||||
</connections>
|
||||
</textView>
|
||||
</subviews>
|
||||
<color key="backgroundColor" white="1" alpha="1" colorSpace="calibratedWhite"/>
|
||||
</clipView>
|
||||
<scroller key="horizontalScroller" hidden="YES" verticalHuggingPriority="750" doubleValue="1" horizontal="YES" id="483">
|
||||
<rect key="frame" x="-100" y="-100" width="87" height="18"/>
|
||||
<autoresizingMask key="autoresizingMask"/>
|
||||
</scroller>
|
||||
<scroller key="verticalScroller" hidden="YES" verticalHuggingPriority="750" doubleValue="1" horizontal="NO" id="482">
|
||||
<rect key="frame" x="-30" y="1" width="15" height="340"/>
|
||||
<autoresizingMask key="autoresizingMask"/>
|
||||
</scroller>
|
||||
</scrollView>
|
||||
<progressIndicator horizontalHuggingPriority="750" verticalHuggingPriority="750" maxValue="100" displayedWhenStopped="NO" bezeled="NO" indeterminate="YES" controlSize="small" style="spinning" id="230">
|
||||
<rect key="frame" x="15" y="18" width="16" height="16"/>
|
||||
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMaxY="YES"/>
|
||||
</progressIndicator>
|
||||
<textField verticalHuggingPriority="750" allowsCharacterPickerTouchBarItem="YES" id="366">
|
||||
<rect key="frame" x="43" y="17" width="357" height="17"/>
|
||||
<autoresizingMask key="autoresizingMask" widthSizable="YES" flexibleMaxY="YES"/>
|
||||
<textFieldCell key="cell" scrollable="YES" lineBreakMode="clipping" sendsActionOnEndEditing="YES" id="477">
|
||||
<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>
|
||||
</subviews>
|
||||
</view>
|
||||
<connections>
|
||||
<outlet property="delegate" destination="207" id="376"/>
|
||||
</connections>
|
||||
<point key="canvasLocation" x="-478" y="370"/>
|
||||
</window>
|
||||
<window allowsToolTipsWhenApplicationIsInactive="NO" autorecalculatesKeyViewLoop="NO" releasedWhenClosed="NO" showsToolbarButton="NO" visibleAtLaunch="NO" frameAutosaveName="WebViewWindow" animationBehavior="default" id="247" userLabel="WebOutputWindow">
|
||||
<windowStyleMask key="styleMask" titled="YES" miniaturizable="YES" resizable="YES"/>
|
||||
<windowPositionMask key="initialPositionMask" leftStrut="YES" rightStrut="YES" topStrut="YES" bottomStrut="YES"/>
|
||||
<rect key="contentRect" x="297" y="408" width="508" height="392"/>
|
||||
<rect key="screenRect" x="0.0" y="0.0" width="1440" height="878"/>
|
||||
<value key="minSize" type="size" width="400" height="200"/>
|
||||
<view key="contentView" id="248">
|
||||
<rect key="frame" x="0.0" y="0.0" width="508" height="392"/>
|
||||
<autoresizingMask key="autoresizingMask"/>
|
||||
<subviews>
|
||||
<button verticalHuggingPriority="750" id="251">
|
||||
<rect key="frame" x="413" y="12" width="86" height="32"/>
|
||||
<autoresizingMask key="autoresizingMask" flexibleMinX="YES" flexibleMaxY="YES"/>
|
||||
<buttonCell key="cell" type="push" title="Quit" bezelStyle="rounded" alignment="center" state="on" borderStyle="border" inset="2" id="478">
|
||||
<behavior key="behavior" pushIn="YES" lightByBackground="YES" lightByGray="YES"/>
|
||||
<font key="font" metaFont="system"/>
|
||||
<string key="keyEquivalent" base64-UTF8="YES">
|
||||
Gw
|
||||
</string>
|
||||
</buttonCell>
|
||||
<connections>
|
||||
<action selector="cancel:" target="207" id="267"/>
|
||||
</connections>
|
||||
</button>
|
||||
<box boxType="oldStyle" borderType="line" titlePosition="noTitle" id="257">
|
||||
<rect key="frame" x="8" y="51" width="491" height="333"/>
|
||||
<autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
|
||||
<view key="contentView" id="X4z-hY-QR7">
|
||||
<rect key="frame" x="1" y="1" width="489" height="331"/>
|
||||
<autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
|
||||
<subviews>
|
||||
<webView maintainsBackForwardList="NO" id="258" customClass="STDragWebView">
|
||||
<rect key="frame" x="-1" y="0.0" width="490" height="331"/>
|
||||
<autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
|
||||
<webPreferences key="preferences" defaultFontSize="12" defaultFixedFontSize="12">
|
||||
<nil key="identifier"/>
|
||||
</webPreferences>
|
||||
<connections>
|
||||
<outlet property="UIDelegate" destination="207" id="378"/>
|
||||
<outlet property="downloadDelegate" destination="207" id="382"/>
|
||||
<outlet property="dragDelegate" destination="207" id="kaI-rz-1Ps"/>
|
||||
<outlet property="frameLoadDelegate" destination="207" id="381"/>
|
||||
<outlet property="policyDelegate" destination="207" id="380"/>
|
||||
<outlet property="resourceLoadDelegate" destination="207" id="379"/>
|
||||
</connections>
|
||||
</webView>
|
||||
</subviews>
|
||||
</view>
|
||||
</box>
|
||||
<progressIndicator horizontalHuggingPriority="750" verticalHuggingPriority="750" maxValue="100" displayedWhenStopped="NO" bezeled="NO" indeterminate="YES" controlSize="small" style="spinning" id="277">
|
||||
<rect key="frame" x="16" y="21" width="16" height="16"/>
|
||||
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMaxY="YES"/>
|
||||
</progressIndicator>
|
||||
<textField verticalHuggingPriority="750" allowsCharacterPickerTouchBarItem="YES" id="509">
|
||||
<rect key="frame" x="37" y="20" width="357" height="17"/>
|
||||
<autoresizingMask key="autoresizingMask" widthSizable="YES" flexibleMaxY="YES"/>
|
||||
<textFieldCell key="cell" scrollable="YES" lineBreakMode="clipping" sendsActionOnEndEditing="YES" id="510">
|
||||
<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>
|
||||
</subviews>
|
||||
</view>
|
||||
<connections>
|
||||
<outlet property="delegate" destination="207" id="375"/>
|
||||
</connections>
|
||||
</window>
|
||||
<window title="Droplet" allowsToolTipsWhenApplicationIsInactive="NO" autorecalculatesKeyViewLoop="NO" oneShot="NO" showsToolbarButton="NO" visibleAtLaunch="NO" frameAutosaveName="DropletWindow" animationBehavior="default" id="490" userLabel="DropletWindow">
|
||||
<windowStyleMask key="styleMask" titled="YES" closable="YES" miniaturizable="YES"/>
|
||||
<windowPositionMask key="initialPositionMask" leftStrut="YES" rightStrut="YES" topStrut="YES" bottomStrut="YES"/>
|
||||
<rect key="contentRect" x="157" y="273" width="188" height="188"/>
|
||||
<rect key="screenRect" x="0.0" y="0.0" width="1440" height="878"/>
|
||||
<view key="contentView" id="491">
|
||||
<rect key="frame" x="0.0" y="0.0" width="188" height="188"/>
|
||||
<autoresizingMask key="autoresizingMask"/>
|
||||
<subviews>
|
||||
<box autoresizesSubviews="NO" borderType="line" titlePosition="noTitle" id="494">
|
||||
<rect key="frame" x="17" y="16" width="154" height="154"/>
|
||||
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMinY="YES"/>
|
||||
<view key="contentView" id="q0i-G4-K1a">
|
||||
<rect key="frame" x="1" y="1" width="152" height="152"/>
|
||||
<autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
|
||||
<subviews>
|
||||
<progressIndicator wantsLayer="YES" horizontalHuggingPriority="750" verticalHuggingPriority="750" maxValue="100" displayedWhenStopped="NO" bezeled="NO" indeterminate="YES" style="spinning" id="496">
|
||||
<rect key="frame" x="59" y="75" width="32" height="32"/>
|
||||
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMinY="YES"/>
|
||||
</progressIndicator>
|
||||
<textField verticalHuggingPriority="750" allowsCharacterPickerTouchBarItem="YES" id="505">
|
||||
<rect key="frame" x="15" y="31" width="122" height="36"/>
|
||||
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMinY="YES"/>
|
||||
<textFieldCell key="cell" controlSize="small" sendsActionOnEndEditing="YES" alignment="center" id="506">
|
||||
<font key="font" metaFont="smallSystem"/>
|
||||
<color key="textColor" name="disabledControlTextColor" catalog="System" colorSpace="catalog"/>
|
||||
<color key="backgroundColor" name="controlColor" catalog="System" colorSpace="catalog"/>
|
||||
</textFieldCell>
|
||||
</textField>
|
||||
<textField verticalHuggingPriority="750" misplaced="YES" allowsCharacterPickerTouchBarItem="YES" id="499">
|
||||
<rect key="frame" x="33" y="59" width="85" height="34"/>
|
||||
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMinY="YES"/>
|
||||
<textFieldCell key="cell" controlSize="mini" sendsActionOnEndEditing="YES" alignment="center" title="Drop folders here" id="500">
|
||||
<font key="font" metaFont="system"/>
|
||||
<color key="textColor" name="disabledControlTextColor" catalog="System" colorSpace="catalog"/>
|
||||
<color key="backgroundColor" name="controlColor" catalog="System" colorSpace="catalog"/>
|
||||
</textFieldCell>
|
||||
</textField>
|
||||
</subviews>
|
||||
</view>
|
||||
</box>
|
||||
</subviews>
|
||||
</view>
|
||||
<connections>
|
||||
<outlet property="delegate" destination="207" id="RFt-L5-f73"/>
|
||||
</connections>
|
||||
<point key="canvasLocation" x="610" y="363"/>
|
||||
</window>
|
||||
<textField hidden="YES" verticalHuggingPriority="750" allowsCharacterPickerTouchBarItem="YES" id="519">
|
||||
<rect key="frame" x="0.0" y="0.0" width="188" height="188"/>
|
||||
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMinY="YES"/>
|
||||
<textFieldCell key="cell" enabled="NO" allowsUndo="NO" sendsActionOnEndEditing="YES" drawsBackground="YES" id="520">
|
||||
<font key="font" metaFont="system"/>
|
||||
<color key="textColor" name="controlTextColor" catalog="System" colorSpace="catalog"/>
|
||||
<color key="backgroundColor" name="disabledControlTextColor" catalog="System" colorSpace="catalog"/>
|
||||
</textFieldCell>
|
||||
<point key="canvasLocation" x="610" y="363"/>
|
||||
</textField>
|
||||
</objects>
|
||||
</document>
|
||||
BIN
MainMenu.nib/keyedobjects.nib
generated
Normal file
BIN
MainMenu.nib/keyedobjects.nib
generated
Normal file
Binary file not shown.
325
Minat.php
Executable file
325
Minat.php
Executable file
@@ -0,0 +1,325 @@
|
||||
<?php
|
||||
|
||||
// Minat
|
||||
// Minat Is Not a Transcoder
|
||||
|
||||
$version = file_get_contents(__DIR__."/version.txt");
|
||||
|
||||
// Includes
|
||||
|
||||
require (__DIR__."/functions.php");
|
||||
|
||||
// Check for translocation
|
||||
|
||||
if (!@touch(__DIR__."/test")) {
|
||||
alert("Minat cannot run from the Downloads folder");
|
||||
quitme();
|
||||
die;
|
||||
}
|
||||
|
||||
// Prefs
|
||||
|
||||
$prefs = __DIR__."/prefs.php";
|
||||
if (!file_exists($prefs)) {
|
||||
|
||||
alert("Can't read prefs file");
|
||||
die;
|
||||
|
||||
} else {
|
||||
|
||||
$p = unserialize(file_get_contents($prefs));
|
||||
|
||||
$p['phpbin'] = "/usr/bin/php";
|
||||
$p['flacbin'] = __DIR__."/bin/flac";
|
||||
$p['metaflacbin'] = __DIR__."/bin/metaflac";
|
||||
$p['lamebin'] = __DIR__."/bin/lame";
|
||||
$p['soxbin'] = __DIR__."/bin/sox";
|
||||
|
||||
$p['workdir'] = "/tmp/minat/";
|
||||
$p['logfile'] = getLogPath("minat.log");
|
||||
$p['disable_prefs'] = 0;
|
||||
$p['disable_tags'] = 0;
|
||||
$p['disable_artwork'] = 0;
|
||||
$p['premature'] = 0;
|
||||
$p['max_size'] = 1000;
|
||||
|
||||
}
|
||||
|
||||
// Version check
|
||||
|
||||
if (strpos(__FILE__,".app")) {
|
||||
|
||||
$checkfile = __DIR__."/vcheck";
|
||||
|
||||
if (!file_exists($checkfile) | time()-@filemtime($checkfile) > 86400) {
|
||||
$curr_version = file_get_contents("http://git.profiteroles.org/profiteroles/Minat/raw/branch/master/version.txt");
|
||||
addline("Version check, me=".$version." latest=".$curr_version);
|
||||
if ($curr_version > $version) {
|
||||
if(askMulti("A new version of Minat is available", array("Skip","Download")) == 1) {
|
||||
exec("open http://git.profiteroles.org/profiteroles/Minat");
|
||||
quitme();
|
||||
}
|
||||
}
|
||||
touch($checkfile);
|
||||
}
|
||||
}
|
||||
|
||||
if ($p['mode'] != 1) { $p['premature'] = 1; addline("MODE ".$p['mode']." NOT YET IMPLEMENTED."); }
|
||||
|
||||
// If SHIFT key is held down, open debug window
|
||||
|
||||
if(exec(__DIR__."/bin/keys") == 512) {
|
||||
exec("open -n Console.app --args ".$p['logfile']);
|
||||
}
|
||||
|
||||
// Make work dir
|
||||
|
||||
if (!is_dir($p['workdir'])) {
|
||||
addline("mkdir ".$p['workdir']);
|
||||
mkdir($p['workdir']);
|
||||
}
|
||||
|
||||
// Debug info
|
||||
|
||||
addline("---------------------------------------");
|
||||
addline("Init ".time());
|
||||
addline(var_export($argv, true));
|
||||
addline("---------------------------------------");
|
||||
addline(var_export($p, true));
|
||||
addline("---------------------------------------");
|
||||
addline("Minat: ".$version);
|
||||
addline("PHP: ".PHP_VERSION);
|
||||
addline(exec("sw_vers | grep ProductVersion"));
|
||||
|
||||
// Launch without argv (no files dragged)
|
||||
|
||||
array_shift($argv);
|
||||
|
||||
if(count($argv) == 0) {
|
||||
if (!$p['disable_prefs'] && strpos(__FILE__,".app")) {
|
||||
exec($p['phpbin']." ".__DIR__."/MinatPrefs.php");
|
||||
}
|
||||
addline("Launch without argv");
|
||||
die;
|
||||
}
|
||||
|
||||
$stamp = md5(serialize($argv))."_".time();
|
||||
$workdir = $p['workdir'].$stamp."/";
|
||||
$batchfile = $workdir.$stamp.".sh";
|
||||
$postfile = $workdir.$stamp.".post.sh";
|
||||
|
||||
addline("---------------------------------------");
|
||||
|
||||
// Loop over dragged directories
|
||||
|
||||
foreach ($argv as $target) {
|
||||
|
||||
// If a single .flac file is dragged, treat as if its parent dir was dragged
|
||||
//if (strtolower(pathinfo($target, PATHINFO_EXTENSION)) == "flac") {
|
||||
// $target = dirname($target);
|
||||
// }
|
||||
|
||||
$files = array();
|
||||
|
||||
foreach(new DirectoryIterator($target) as $file) {
|
||||
if (strtolower(@array_pop(explode('.', $file))) == "flac") {
|
||||
$files[] = $file->getpathname();
|
||||
}
|
||||
}
|
||||
|
||||
if (!$files) {
|
||||
addline("Dropped folder ".$target." does not contain any flac files");
|
||||
alert("Dropped folder ".$target." does not contain any flac files");
|
||||
continue;
|
||||
}
|
||||
|
||||
$label = basename($target);
|
||||
if (stripos($label,"[flac]") == false) {
|
||||
$newlabel = $label." [MP3]";
|
||||
} else {
|
||||
$newlabel = str_ireplace("[flac]","[MP3]",$label);
|
||||
}
|
||||
|
||||
switch ($p['dest']) {
|
||||
|
||||
case 0:
|
||||
$destdir = $p['workdir'].$stamp."/".$newlabel."/";
|
||||
break;
|
||||
|
||||
case 1:
|
||||
$destdir = dirname($target)."/".$newlabel."/";
|
||||
break;
|
||||
|
||||
case 2:
|
||||
$destdir = $p['destpath']."/".$newlabel."/";
|
||||
break;
|
||||
|
||||
}
|
||||
|
||||
addline("Dest dir is ".$destdir);
|
||||
|
||||
$postdirs[] = $destdir;
|
||||
|
||||
if (file_exists($destdir)) {
|
||||
alert("Destination directory ".$destdir." already exists!");
|
||||
die;
|
||||
}
|
||||
|
||||
if (!is_dir($workdir)) {
|
||||
addline("mkdir ".$workdir);
|
||||
mkdir($workdir);
|
||||
}
|
||||
|
||||
if (!is_dir($destdir) & !$p['premature']) {
|
||||
addline("mkdir ".$destdir);
|
||||
mkdir($destdir);
|
||||
}
|
||||
|
||||
if (!$p['disable_artwork']) {
|
||||
|
||||
$mimecmd = $p['metaflacbin']." --list --block-type=PICTURE ".escapeshellarg($files[0])." | head -10 | grep MIME | sed 's:.*/::'";
|
||||
addline($mimecmd);
|
||||
$mime = exec($mimecmd);
|
||||
|
||||
if (@$mime) {
|
||||
|
||||
addline("embedded cover found in ".$files[0]);
|
||||
|
||||
$coverdest = $workdir."cover.".$mime;
|
||||
exec($p['metaflacbin']." --export-picture-to=".escapeshellarg($coverdest)." ".escapeshellarg($files[0]));
|
||||
if (file_exists($coverdest)) { $usecover = $coverdest; } else { addline ("error extracting file"); }
|
||||
|
||||
} elseif ($extcover = findCover($target)) {
|
||||
|
||||
addline("external cover file found: ".$extcover);
|
||||
|
||||
$width = exec("sips -g pixelWidth ".escapeshellarg($extcover)." | tail -n1 | cut -f4 -d\" \"");
|
||||
$height = exec("sips -g pixelHeight ".escapeshellarg($extcover)." | tail -n1 | cut -f4 -d\" \"");
|
||||
|
||||
if ($width > $p['max_size'] | $height > $p['max_size']) {
|
||||
|
||||
addline("resizing ".$extcover);
|
||||
|
||||
$coverdest = $workdir."cover.".pathinfo($extcover, PATHINFO_EXTENSION);
|
||||
exec("sips --resampleHeightWidthMax ".$p['max_size']." ".escapeshellarg($extcover)." --out ".$coverdest." > /dev/null 2>&1");
|
||||
if (file_exists($coverdest)) { $usecover = $coverdest; } else { addline ("error resizing file"); }
|
||||
|
||||
} else {
|
||||
|
||||
$usecover = $extcover;
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
if ($usecover) {
|
||||
$covertags = "--ti ".escapeshellarg($usecover);
|
||||
} elseif ($p['warn_art']) {
|
||||
alert("No cover artwork was found");
|
||||
}
|
||||
}
|
||||
|
||||
// Handle one directory
|
||||
|
||||
foreach ($files as $file) {
|
||||
|
||||
// MODE: Transcode
|
||||
|
||||
addline("Processing ".$file);
|
||||
|
||||
if ($p['check']) {
|
||||
if (exec($p['flacbin']." -ts ".escapeshellarg($file)." 2>&1")) {
|
||||
addline("Skipping corrupted flac: ".$file);
|
||||
continue;
|
||||
}
|
||||
}
|
||||
|
||||
$tagcmd = $p['soxbin']." --i -a ".escapeshellarg($file);
|
||||
|
||||
if (!$p['disable_tags']) {
|
||||
|
||||
$rawtags = shell_exec($tagcmd);
|
||||
addline(var_export($rawtags, true));
|
||||
$tags = lameFlagBuilder($rawtags);
|
||||
|
||||
}
|
||||
|
||||
$dest = $destdir.basename($file,".flac").".mp3";
|
||||
$lockfile = $workdir.md5($target).".".basename($file,".flac").".lock";
|
||||
$cmd_flac = $p['flacbin']." -dcs -- ".escapeshellarg($file);
|
||||
$cmd_lame = $p['lamebin']." -S ".$p['lameopts']." ".$tags." ".$covertags." - ".escapeshellarg($dest);
|
||||
$cmd_lock = "touch ".escapeshellarg($lockfile);
|
||||
|
||||
$line[] = $cmd_flac." | ".$cmd_lame." ; ".$cmd_lock;
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
// No files were found -- nothing to do
|
||||
|
||||
if (!@count($line) | $p['premature']) {
|
||||
addline("No files were found in any dropped folder");
|
||||
die;
|
||||
}
|
||||
|
||||
// Write batch file for Parallel
|
||||
|
||||
addline("Writing to batchfile ".$batchfile);
|
||||
file_put_contents($batchfile,implode("\n", $line));
|
||||
|
||||
$pass[] = escapeshellarg($batchfile);
|
||||
|
||||
// Write postflight batch file for Parallel
|
||||
|
||||
if ($p['postflight']) {
|
||||
|
||||
foreach ($postdirs as $dir) {
|
||||
|
||||
switch ($p['postflight']) {
|
||||
|
||||
case 1:
|
||||
$postline[] = "qlmanage -p ".escapeshellarg($dir)."/* > /dev/null 2>&1";
|
||||
break;
|
||||
|
||||
case 2:
|
||||
$postline[] = "open ".escapeshellarg($dir);
|
||||
break;
|
||||
|
||||
case 3:
|
||||
$postline[] = "open ".escapeshellarg($dir)." -a ".escapeshellarg($p['handler']);
|
||||
break;
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
addline("Writing to postfile ".$postfile);
|
||||
file_put_contents($postfile,implode("\n", $postline));
|
||||
$pass[] = escapeshellarg($postfile);
|
||||
|
||||
} else {
|
||||
|
||||
$pass[] = 0;
|
||||
|
||||
}
|
||||
|
||||
$pass[] = escapeshellarg($p['logfile']);
|
||||
|
||||
if ($p['ding']) {
|
||||
$pass[] = 1;
|
||||
}
|
||||
|
||||
$cmd = "open -n ".__DIR__."/Parallel.app --args ".implode(" ",$pass);
|
||||
|
||||
addline($cmd);
|
||||
exec($cmd);
|
||||
|
||||
// We are done
|
||||
|
||||
addline("Completed\n");
|
||||
|
||||
if (!$p['stay_open']) {
|
||||
quitme();
|
||||
}
|
||||
|
||||
?>
|
||||
55
MinatPrefs.php
Executable file
55
MinatPrefs.php
Executable file
@@ -0,0 +1,55 @@
|
||||
<?php
|
||||
|
||||
// MinatPrefs 0.1.0
|
||||
//
|
||||
|
||||
// Includes
|
||||
|
||||
require (__DIR__."/functions.php");
|
||||
require (__DIR__."/functions.pashua.php");
|
||||
|
||||
// Read Prefs
|
||||
|
||||
$p = unserialize(file_get_contents(__DIR__."/prefs.php"));
|
||||
if(!$p['destpath']) {
|
||||
$p['destpath'] = "/Users/".get_current_user()."/Desktop";
|
||||
}
|
||||
|
||||
// Load strings
|
||||
|
||||
$strings[] = array("Temp","Inline","Custom");
|
||||
$strings[] = array("Do nothing","Quicklook","Show in Finder","Open with handler...");
|
||||
$strings[] = array("Rename","Transcode","Spectrogram");
|
||||
|
||||
$result = Pashua::showDialog(makeWindowString($p, $strings));
|
||||
|
||||
// User cancelled
|
||||
|
||||
if (@$result['cb']) {
|
||||
echo "0";
|
||||
die;
|
||||
}
|
||||
|
||||
// Fix strings
|
||||
|
||||
$result['dest'] = array_search($result['dest'],$strings[0]);
|
||||
$result['postflight'] = array_search($result['postflight'],$strings[1]);
|
||||
$result['mode'] = array_search($result['mode'],$strings[2]);
|
||||
$result['spec_dims'] = array($result['spec_dims_x'],$result['spec_dims_y']);
|
||||
|
||||
// If the user didn't specify a destpath, set to desktop
|
||||
|
||||
if(!$p['destpath']) {
|
||||
$p['destpath'] = "/Users/".get_current_user()."/Desktop";
|
||||
}
|
||||
|
||||
// Fix a fucking Pashua bug
|
||||
|
||||
$result['destpath'] = str_replace("Desktop/Desktop","Desktop",$result['destpath']);
|
||||
|
||||
// Write Prefs
|
||||
|
||||
file_put_contents("prefs.php",serialize($result));
|
||||
echo "1";
|
||||
|
||||
?>
|
||||
531
Parallel/MainMenu.nib/designable.nib
generated
Normal file
531
Parallel/MainMenu.nib/designable.nib
generated
Normal file
@@ -0,0 +1,531 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<document type="com.apple.InterfaceBuilder3.Cocoa.XIB" version="3.0" toolsVersion="14113" targetRuntime="MacOSX.Cocoa" propertyAccessControl="none">
|
||||
<dependencies>
|
||||
<plugIn identifier="com.apple.InterfaceBuilder.CocoaPlugin" version="14113"/>
|
||||
<plugIn identifier="com.apple.WebKitIBPlugin" version="14113"/>
|
||||
<capability name="box content view" minToolsVersion="7.0"/>
|
||||
<capability name="documents saved in the Xcode 8 format" minToolsVersion="8.0"/>
|
||||
</dependencies>
|
||||
<objects>
|
||||
<customObject id="-2" userLabel="File's Owner" customClass="NSApplication">
|
||||
<connections>
|
||||
<outlet property="delegate" destination="207" id="210"/>
|
||||
</connections>
|
||||
</customObject>
|
||||
<customObject id="-1" userLabel="First Responder" customClass="FirstResponder"/>
|
||||
<customObject id="-3" userLabel="Application" customClass="NSObject">
|
||||
<connections>
|
||||
<outlet property="delegate" destination="207" id="446"/>
|
||||
</connections>
|
||||
</customObject>
|
||||
<customObject id="207" userLabel="ScriptExecController" customClass="ScriptExecController">
|
||||
<connections>
|
||||
<outlet property="aboutMenuItem" destination="232" id="238"/>
|
||||
<outlet property="dropletBox" destination="494" id="502"/>
|
||||
<outlet property="dropletDropFilesLabel" destination="499" id="507"/>
|
||||
<outlet property="dropletMessageTextField" destination="505" id="508"/>
|
||||
<outlet property="dropletProgressIndicator" destination="496" id="504"/>
|
||||
<outlet property="dropletShaderView" destination="519" id="w2q-dA-smc"/>
|
||||
<outlet property="dropletWindow" destination="490" id="512"/>
|
||||
<outlet property="hideMenuItem" destination="134" id="239"/>
|
||||
<outlet property="openRecentMenuItem" destination="FvD-xH-BRz" id="V8D-h2-Uw1"/>
|
||||
<outlet property="progressBarIndicator" destination="204" id="298"/>
|
||||
<outlet property="progressBarMessageTextField" destination="205" id="297"/>
|
||||
<outlet property="progressBarTextView" destination="307" id="516"/>
|
||||
<outlet property="progressBarWindow" destination="21" id="296"/>
|
||||
<outlet property="quitMenuItem" destination="136" id="240"/>
|
||||
<outlet property="textWindow" destination="216" id="dD5-aT-ujC"/>
|
||||
<outlet property="textWindowCancelButton" destination="220" id="uuU-Xb-xDZ"/>
|
||||
<outlet property="textWindowMessageTextField" destination="366" id="bT3-oV-9zc"/>
|
||||
<outlet property="textWindowProgressIndicator" destination="230" id="AXd-F1-wQr"/>
|
||||
<outlet property="textWindowTextView" destination="225" id="FZy-wJ-th1"/>
|
||||
<outlet property="webView" destination="258" id="GEt-Hd-OFL"/>
|
||||
<outlet property="webViewCancelButton" destination="251" id="i5n-LY-nJs"/>
|
||||
<outlet property="webViewMessageTextField" destination="509" id="Unv-5h-E6P"/>
|
||||
<outlet property="webViewProgressIndicator" destination="277" id="Hun-a2-4wC"/>
|
||||
<outlet property="webViewWindow" destination="247" id="9lw-Pg-xRw"/>
|
||||
<outlet property="windowMenu" destination="24" id="328"/>
|
||||
</connections>
|
||||
</customObject>
|
||||
<window allowsToolTipsWhenApplicationIsInactive="NO" autorecalculatesKeyViewLoop="NO" releasedWhenClosed="NO" visibleAtLaunch="NO" frameAutosaveName="ProgressBarWindow" animationBehavior="default" id="21" userLabel="ProgressWindow">
|
||||
<windowStyleMask key="styleMask" titled="YES" miniaturizable="YES" resizable="YES"/>
|
||||
<windowPositionMask key="initialPositionMask" leftStrut="YES" rightStrut="YES" topStrut="YES" bottomStrut="YES"/>
|
||||
<rect key="contentRect" x="472" y="537" width="800" height="66"/>
|
||||
<rect key="screenRect" x="0.0" y="0.0" width="1440" height="878"/>
|
||||
<value key="minSize" type="size" width="400" height="66"/>
|
||||
<value key="maxSize" type="size" width="1200" height="66"/>
|
||||
<view key="contentView" misplaced="YES" id="2">
|
||||
<rect key="frame" x="0.0" y="0.0" width="800" height="66"/>
|
||||
<autoresizingMask key="autoresizingMask"/>
|
||||
<subviews>
|
||||
<progressIndicator wantsLayer="YES" verticalHuggingPriority="750" misplaced="YES" maxValue="100" bezeled="NO" indeterminate="YES" style="bar" id="204">
|
||||
<rect key="frame" x="18" y="10" width="763" height="20"/>
|
||||
<autoresizingMask key="autoresizingMask" widthSizable="YES" flexibleMinY="YES"/>
|
||||
</progressIndicator>
|
||||
<textField verticalHuggingPriority="750" allowsCharacterPickerTouchBarItem="YES" id="205">
|
||||
<rect key="frame" x="18" y="38" width="765" height="17"/>
|
||||
<autoresizingMask key="autoresizingMask" widthSizable="YES" flexibleMinY="YES"/>
|
||||
<textFieldCell key="cell" lineBreakMode="clipping" sendsActionOnEndEditing="YES" baseWritingDirection="leftToRight" alignment="left" id="472">
|
||||
<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>
|
||||
<scrollView autohidesScrollers="YES" horizontalLineScroll="10" horizontalPageScroll="10" verticalLineScroll="10" verticalPageScroll="10" hasHorizontalScroller="NO" usesPredominantAxisScrolling="NO" id="304">
|
||||
<rect key="frame" x="20" y="-220" width="755" height="202"/>
|
||||
<autoresizingMask key="autoresizingMask" widthSizable="YES" flexibleMinY="YES"/>
|
||||
<clipView key="contentView" copiesOnScroll="NO" id="2mm-QF-kpX">
|
||||
<rect key="frame" x="1" y="1" width="753" height="200"/>
|
||||
<autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
|
||||
<subviews>
|
||||
<textView editable="NO" importsGraphics="NO" richText="NO" verticallyResizable="YES" findStyle="panel" allowsDocumentBackgroundColorChange="YES" linkDetection="YES" id="307">
|
||||
<rect key="frame" x="0.0" y="0.0" width="753" height="200"/>
|
||||
<autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
|
||||
<color key="backgroundColor" white="1" alpha="1" colorSpace="calibratedWhite"/>
|
||||
<size key="minSize" width="753" height="200"/>
|
||||
<size key="maxSize" width="753" height="10000000"/>
|
||||
<color key="insertionPointColor" white="0.0" alpha="1" colorSpace="calibratedWhite"/>
|
||||
<connections>
|
||||
<outlet property="delegate" destination="207" id="489"/>
|
||||
</connections>
|
||||
</textView>
|
||||
</subviews>
|
||||
<color key="backgroundColor" white="1" alpha="1" colorSpace="calibratedWhite"/>
|
||||
</clipView>
|
||||
<scroller key="horizontalScroller" hidden="YES" verticalHuggingPriority="750" doubleValue="1" horizontal="YES" id="481">
|
||||
<rect key="frame" x="-100" y="-100" width="87" height="18"/>
|
||||
<autoresizingMask key="autoresizingMask"/>
|
||||
</scroller>
|
||||
<scroller key="verticalScroller" hidden="YES" verticalHuggingPriority="750" doubleValue="0.39849624060150374" horizontal="NO" id="480">
|
||||
<rect key="frame" x="323" y="1" width="15" height="200"/>
|
||||
<autoresizingMask key="autoresizingMask"/>
|
||||
</scroller>
|
||||
</scrollView>
|
||||
</subviews>
|
||||
</view>
|
||||
<connections>
|
||||
<outlet property="delegate" destination="207" id="377"/>
|
||||
</connections>
|
||||
<point key="canvasLocation" x="197" y="291.5"/>
|
||||
</window>
|
||||
<menu title="MainMenu" systemMenu="main" id="29" userLabel="MainMenu">
|
||||
<items>
|
||||
<menuItem title="Application" id="56">
|
||||
<menu key="submenu" title="Application" systemMenu="apple" id="57">
|
||||
<items>
|
||||
<menuItem title="About" id="232">
|
||||
<modifierMask key="keyEquivalentModifierMask"/>
|
||||
<connections>
|
||||
<action selector="orderFrontStandardAboutPanel:" target="-2" id="237"/>
|
||||
</connections>
|
||||
</menuItem>
|
||||
<menuItem isSeparatorItem="YES" id="233">
|
||||
<modifierMask key="keyEquivalentModifierMask" command="YES"/>
|
||||
</menuItem>
|
||||
<menuItem title="Services" id="235">
|
||||
<menu key="submenu" title="Services" systemMenu="services" id="234"/>
|
||||
</menuItem>
|
||||
<menuItem isSeparatorItem="YES" id="236">
|
||||
<modifierMask key="keyEquivalentModifierMask" command="YES"/>
|
||||
</menuItem>
|
||||
<menuItem title="Hide" keyEquivalent="h" id="134">
|
||||
<connections>
|
||||
<action selector="hide:" target="-2" id="152"/>
|
||||
</connections>
|
||||
</menuItem>
|
||||
<menuItem title="Hide Others" keyEquivalent="h" id="145">
|
||||
<modifierMask key="keyEquivalentModifierMask" option="YES" command="YES"/>
|
||||
<connections>
|
||||
<action selector="hideOtherApplications:" target="-2" id="146"/>
|
||||
</connections>
|
||||
</menuItem>
|
||||
<menuItem title="Show All" id="150">
|
||||
<connections>
|
||||
<action selector="unhideAllApplications:" target="-2" id="153"/>
|
||||
</connections>
|
||||
</menuItem>
|
||||
<menuItem isSeparatorItem="YES" id="149">
|
||||
<modifierMask key="keyEquivalentModifierMask" command="YES"/>
|
||||
</menuItem>
|
||||
<menuItem title="Quit" keyEquivalent="q" id="136">
|
||||
<connections>
|
||||
<action selector="terminate:" target="-2" id="139"/>
|
||||
</connections>
|
||||
</menuItem>
|
||||
</items>
|
||||
</menu>
|
||||
</menuItem>
|
||||
<menuItem title="File" id="83">
|
||||
<menu key="submenu" title="File" id="81">
|
||||
<items>
|
||||
<menuItem title="Open…" keyEquivalent="o" id="72">
|
||||
<connections>
|
||||
<action selector="openFiles:" target="207" id="524"/>
|
||||
</connections>
|
||||
</menuItem>
|
||||
<menuItem title="Open Recent" id="FvD-xH-BRz">
|
||||
<modifierMask key="keyEquivalentModifierMask"/>
|
||||
<menu key="submenu" title="Open Recent" systemMenu="recentDocuments" id="QHk-NS-To3">
|
||||
<items>
|
||||
<menuItem title="Clear Menu" id="CWw-N0-5lz">
|
||||
<modifierMask key="keyEquivalentModifierMask"/>
|
||||
</menuItem>
|
||||
</items>
|
||||
</menu>
|
||||
</menuItem>
|
||||
<menuItem isSeparatorItem="YES" id="79">
|
||||
<modifierMask key="keyEquivalentModifierMask" command="YES"/>
|
||||
</menuItem>
|
||||
<menuItem title="Close" keyEquivalent="w" id="73">
|
||||
<connections>
|
||||
<action selector="performClose:" target="-1" id="193"/>
|
||||
</connections>
|
||||
</menuItem>
|
||||
<menuItem title="Save to File…" keyEquivalent="s" id="75">
|
||||
<connections>
|
||||
<action selector="saveToFile:" target="207" id="523"/>
|
||||
</connections>
|
||||
</menuItem>
|
||||
<menuItem isSeparatorItem="YES" id="74">
|
||||
<modifierMask key="keyEquivalentModifierMask" command="YES"/>
|
||||
</menuItem>
|
||||
<menuItem title="Page Setup…" keyEquivalent="P" id="77">
|
||||
<connections>
|
||||
<action selector="runPageLayout:" target="-1" id="87"/>
|
||||
</connections>
|
||||
</menuItem>
|
||||
<menuItem title="Print…" keyEquivalent="p" id="78">
|
||||
<connections>
|
||||
<action selector="print:" target="-1" id="86"/>
|
||||
</connections>
|
||||
</menuItem>
|
||||
</items>
|
||||
</menu>
|
||||
</menuItem>
|
||||
<menuItem title="Edit" id="163">
|
||||
<menu key="submenu" title="Edit" id="8AD-nO-Nv5">
|
||||
<items>
|
||||
<menuItem title="Undo" keyEquivalent="z" id="WsN-Bo-RAi">
|
||||
<connections>
|
||||
<action selector="undo:" target="-1" id="swp-Rd-xai"/>
|
||||
</connections>
|
||||
</menuItem>
|
||||
<menuItem title="Redo" keyEquivalent="z" id="lwR-9k-Jds">
|
||||
<modifierMask key="keyEquivalentModifierMask" option="YES" command="YES"/>
|
||||
<connections>
|
||||
<action selector="redo:" target="-1" id="t0d-JF-Jxf"/>
|
||||
</connections>
|
||||
</menuItem>
|
||||
<menuItem isSeparatorItem="YES" id="f7y-jW-w4a">
|
||||
<modifierMask key="keyEquivalentModifierMask" command="YES"/>
|
||||
</menuItem>
|
||||
<menuItem title="Cut" keyEquivalent="x" id="gYg-Fm-Vd0">
|
||||
<connections>
|
||||
<action selector="cut:" target="-1" id="uo1-1q-hcK"/>
|
||||
</connections>
|
||||
</menuItem>
|
||||
<menuItem title="Copy" keyEquivalent="c" id="gPx-QX-E5Y">
|
||||
<connections>
|
||||
<action selector="copy:" target="-1" id="dyg-Qh-MrF"/>
|
||||
</connections>
|
||||
</menuItem>
|
||||
<menuItem title="Paste" keyEquivalent="v" id="Onj-KJ-eWD">
|
||||
<connections>
|
||||
<action selector="paste:" target="-1" id="ZQo-9c-pWs"/>
|
||||
</connections>
|
||||
</menuItem>
|
||||
<menuItem title="Delete" id="NRV-Nu-dQo">
|
||||
<connections>
|
||||
<action selector="delete:" target="-1" id="PJy-am-8nR"/>
|
||||
</connections>
|
||||
</menuItem>
|
||||
<menuItem title="Select All" keyEquivalent="a" id="aZ7-KE-7Nh">
|
||||
<connections>
|
||||
<action selector="selectAll:" target="-1" id="gnq-iF-2hE"/>
|
||||
</connections>
|
||||
</menuItem>
|
||||
<menuItem isSeparatorItem="YES" id="ckZ-kQ-yF7">
|
||||
<modifierMask key="keyEquivalentModifierMask" command="YES"/>
|
||||
</menuItem>
|
||||
<menuItem title="Find" id="EgA-FB-eXQ">
|
||||
<menu key="submenu" title="Find" id="xIX-bE-bd8">
|
||||
<items>
|
||||
<menuItem title="Find…" tag="1" keyEquivalent="f" id="3k0-IU-cL5">
|
||||
<connections>
|
||||
<action selector="performFindPanelAction:" target="-1" id="wAh-50-CiI"/>
|
||||
</connections>
|
||||
</menuItem>
|
||||
<menuItem title="Find Next" tag="2" keyEquivalent="g" id="EAX-qd-XMX">
|
||||
<connections>
|
||||
<action selector="performFindPanelAction:" target="-1" id="LvO-Xz-du1"/>
|
||||
</connections>
|
||||
</menuItem>
|
||||
<menuItem title="Find Previous" tag="3" keyEquivalent="G" id="n5T-AH-BNm">
|
||||
<connections>
|
||||
<action selector="performFindPanelAction:" target="-1" id="FgQ-Gb-Qnu"/>
|
||||
</connections>
|
||||
</menuItem>
|
||||
<menuItem title="Use Selection for Find" tag="7" keyEquivalent="e" id="xKU-AA-Gj3">
|
||||
<connections>
|
||||
<action selector="performFindPanelAction:" target="-1" id="j7C-hb-eo3"/>
|
||||
</connections>
|
||||
</menuItem>
|
||||
<menuItem title="Jump to Selection" keyEquivalent="j" id="mpE-JG-s67">
|
||||
<connections>
|
||||
<action selector="centerSelectionInVisibleArea:" target="-1" id="H4Z-6R-SO2"/>
|
||||
</connections>
|
||||
</menuItem>
|
||||
</items>
|
||||
</menu>
|
||||
</menuItem>
|
||||
</items>
|
||||
</menu>
|
||||
</menuItem>
|
||||
<menuItem title="View" id="KUk-6o-tke">
|
||||
<menu key="submenu" title="View" id="ITS-DI-OJD">
|
||||
<items>
|
||||
<menuItem title="Make Text Bigger" keyEquivalent="+" id="Qae-cV-V7J">
|
||||
<connections>
|
||||
<action selector="makeTextBigger:" target="207" id="cHK-EO-JtV"/>
|
||||
</connections>
|
||||
</menuItem>
|
||||
<menuItem title="Make Text Smaller" keyEquivalent="-" id="Gv4-oc-1eL">
|
||||
<connections>
|
||||
<action selector="makeTextSmaller:" target="207" id="JTY-6k-ZKY"/>
|
||||
</connections>
|
||||
</menuItem>
|
||||
</items>
|
||||
</menu>
|
||||
</menuItem>
|
||||
<menuItem title="Window" id="19">
|
||||
<menu key="submenu" title="Window" systemMenu="window" id="24">
|
||||
<items>
|
||||
<menuItem title="Zoom" keyEquivalent="z" id="197">
|
||||
<modifierMask key="keyEquivalentModifierMask" shift="YES" command="YES"/>
|
||||
<connections>
|
||||
<action selector="performZoom:" target="-1" id="198"/>
|
||||
</connections>
|
||||
</menuItem>
|
||||
<menuItem title="Minimize" keyEquivalent="m" id="23">
|
||||
<connections>
|
||||
<action selector="performMiniaturize:" target="-1" id="37"/>
|
||||
</connections>
|
||||
</menuItem>
|
||||
<menuItem isSeparatorItem="YES" id="322">
|
||||
<modifierMask key="keyEquivalentModifierMask" command="YES"/>
|
||||
</menuItem>
|
||||
<menuItem title="Bring All to Front" id="5">
|
||||
<connections>
|
||||
<action selector="arrangeInFront:" target="-1" id="39"/>
|
||||
</connections>
|
||||
</menuItem>
|
||||
</items>
|
||||
</menu>
|
||||
</menuItem>
|
||||
</items>
|
||||
<connections>
|
||||
<outlet property="delegate" destination="207" id="525"/>
|
||||
</connections>
|
||||
<point key="canvasLocation" x="-21" y="164"/>
|
||||
</menu>
|
||||
<window allowsToolTipsWhenApplicationIsInactive="NO" autorecalculatesKeyViewLoop="NO" releasedWhenClosed="NO" showsToolbarButton="NO" visibleAtLaunch="NO" frameAutosaveName="TextWindow" animationBehavior="default" id="216" userLabel="TextOutputWindow">
|
||||
<windowStyleMask key="styleMask" titled="YES" miniaturizable="YES" resizable="YES"/>
|
||||
<windowPositionMask key="initialPositionMask" leftStrut="YES" rightStrut="YES" topStrut="YES" bottomStrut="YES"/>
|
||||
<rect key="contentRect" x="297" y="408" width="508" height="392"/>
|
||||
<rect key="screenRect" x="0.0" y="0.0" width="1440" height="878"/>
|
||||
<value key="minSize" type="size" width="400" height="200"/>
|
||||
<view key="contentView" id="217">
|
||||
<rect key="frame" x="0.0" y="0.0" width="508" height="392"/>
|
||||
<autoresizingMask key="autoresizingMask"/>
|
||||
<subviews>
|
||||
<button verticalHuggingPriority="750" id="220">
|
||||
<rect key="frame" x="416" y="7" width="86" height="32"/>
|
||||
<autoresizingMask key="autoresizingMask" flexibleMinX="YES" flexibleMaxY="YES"/>
|
||||
<buttonCell key="cell" type="push" title="Quit" bezelStyle="rounded" alignment="center" borderStyle="border" inset="2" id="476">
|
||||
<behavior key="behavior" pushIn="YES" lightByBackground="YES" lightByGray="YES"/>
|
||||
<font key="font" metaFont="system"/>
|
||||
<string key="keyEquivalent" base64-UTF8="YES">
|
||||
Gw
|
||||
</string>
|
||||
</buttonCell>
|
||||
<connections>
|
||||
<action selector="cancel:" target="207" id="223"/>
|
||||
</connections>
|
||||
</button>
|
||||
<scrollView autohidesScrollers="YES" horizontalLineScroll="10" horizontalPageScroll="10" verticalLineScroll="10" verticalPageScroll="10" hasHorizontalScroller="NO" usesPredominantAxisScrolling="NO" id="226">
|
||||
<rect key="frame" x="9" y="45" width="489" height="339"/>
|
||||
<autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
|
||||
<clipView key="contentView" drawsBackground="NO" copiesOnScroll="NO" id="Hk1-72-Owa">
|
||||
<rect key="frame" x="1" y="1" width="487" height="337"/>
|
||||
<autoresizingMask key="autoresizingMask"/>
|
||||
<subviews>
|
||||
<textView editable="NO" importsGraphics="NO" richText="NO" verticallyResizable="YES" usesFontPanel="YES" findStyle="panel" allowsDocumentBackgroundColorChange="YES" linkDetection="YES" id="225">
|
||||
<rect key="frame" x="0.0" y="0.0" width="487" height="337"/>
|
||||
<autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
|
||||
<color key="backgroundColor" white="1" alpha="1" colorSpace="calibratedWhite"/>
|
||||
<size key="minSize" width="487" height="337"/>
|
||||
<size key="maxSize" width="489" height="10000000"/>
|
||||
<color key="insertionPointColor" white="0.0" alpha="1" colorSpace="calibratedWhite"/>
|
||||
<connections>
|
||||
<outlet property="delegate" destination="207" id="488"/>
|
||||
</connections>
|
||||
</textView>
|
||||
</subviews>
|
||||
<color key="backgroundColor" white="1" alpha="1" colorSpace="calibratedWhite"/>
|
||||
</clipView>
|
||||
<scroller key="horizontalScroller" hidden="YES" verticalHuggingPriority="750" doubleValue="1" horizontal="YES" id="483">
|
||||
<rect key="frame" x="-100" y="-100" width="87" height="18"/>
|
||||
<autoresizingMask key="autoresizingMask"/>
|
||||
</scroller>
|
||||
<scroller key="verticalScroller" hidden="YES" verticalHuggingPriority="750" doubleValue="1" horizontal="NO" id="482">
|
||||
<rect key="frame" x="-30" y="1" width="15" height="340"/>
|
||||
<autoresizingMask key="autoresizingMask"/>
|
||||
</scroller>
|
||||
</scrollView>
|
||||
<progressIndicator horizontalHuggingPriority="750" verticalHuggingPriority="750" maxValue="100" displayedWhenStopped="NO" bezeled="NO" indeterminate="YES" controlSize="small" style="spinning" id="230">
|
||||
<rect key="frame" x="15" y="18" width="16" height="16"/>
|
||||
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMaxY="YES"/>
|
||||
</progressIndicator>
|
||||
<textField verticalHuggingPriority="750" allowsCharacterPickerTouchBarItem="YES" id="366">
|
||||
<rect key="frame" x="43" y="17" width="357" height="17"/>
|
||||
<autoresizingMask key="autoresizingMask" widthSizable="YES" flexibleMaxY="YES"/>
|
||||
<textFieldCell key="cell" scrollable="YES" lineBreakMode="clipping" sendsActionOnEndEditing="YES" id="477">
|
||||
<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>
|
||||
</subviews>
|
||||
</view>
|
||||
<connections>
|
||||
<outlet property="delegate" destination="207" id="376"/>
|
||||
</connections>
|
||||
<point key="canvasLocation" x="-478" y="370"/>
|
||||
</window>
|
||||
<window allowsToolTipsWhenApplicationIsInactive="NO" autorecalculatesKeyViewLoop="NO" releasedWhenClosed="NO" showsToolbarButton="NO" visibleAtLaunch="NO" frameAutosaveName="WebViewWindow" animationBehavior="default" id="247" userLabel="WebOutputWindow">
|
||||
<windowStyleMask key="styleMask" titled="YES" miniaturizable="YES" resizable="YES"/>
|
||||
<windowPositionMask key="initialPositionMask" leftStrut="YES" rightStrut="YES" topStrut="YES" bottomStrut="YES"/>
|
||||
<rect key="contentRect" x="297" y="408" width="508" height="392"/>
|
||||
<rect key="screenRect" x="0.0" y="0.0" width="1440" height="878"/>
|
||||
<value key="minSize" type="size" width="400" height="200"/>
|
||||
<view key="contentView" id="248">
|
||||
<rect key="frame" x="0.0" y="0.0" width="508" height="392"/>
|
||||
<autoresizingMask key="autoresizingMask"/>
|
||||
<subviews>
|
||||
<button verticalHuggingPriority="750" id="251">
|
||||
<rect key="frame" x="413" y="12" width="86" height="32"/>
|
||||
<autoresizingMask key="autoresizingMask" flexibleMinX="YES" flexibleMaxY="YES"/>
|
||||
<buttonCell key="cell" type="push" title="Quit" bezelStyle="rounded" alignment="center" state="on" borderStyle="border" inset="2" id="478">
|
||||
<behavior key="behavior" pushIn="YES" lightByBackground="YES" lightByGray="YES"/>
|
||||
<font key="font" metaFont="system"/>
|
||||
<string key="keyEquivalent" base64-UTF8="YES">
|
||||
Gw
|
||||
</string>
|
||||
</buttonCell>
|
||||
<connections>
|
||||
<action selector="cancel:" target="207" id="267"/>
|
||||
</connections>
|
||||
</button>
|
||||
<box boxType="oldStyle" borderType="line" titlePosition="noTitle" id="257">
|
||||
<rect key="frame" x="8" y="51" width="491" height="333"/>
|
||||
<autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
|
||||
<view key="contentView" id="X4z-hY-QR7">
|
||||
<rect key="frame" x="1" y="1" width="489" height="331"/>
|
||||
<autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
|
||||
<subviews>
|
||||
<webView maintainsBackForwardList="NO" id="258" customClass="STDragWebView">
|
||||
<rect key="frame" x="-1" y="0.0" width="490" height="331"/>
|
||||
<autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
|
||||
<webPreferences key="preferences" defaultFontSize="12" defaultFixedFontSize="12">
|
||||
<nil key="identifier"/>
|
||||
</webPreferences>
|
||||
<connections>
|
||||
<outlet property="UIDelegate" destination="207" id="378"/>
|
||||
<outlet property="downloadDelegate" destination="207" id="382"/>
|
||||
<outlet property="dragDelegate" destination="207" id="kaI-rz-1Ps"/>
|
||||
<outlet property="frameLoadDelegate" destination="207" id="381"/>
|
||||
<outlet property="policyDelegate" destination="207" id="380"/>
|
||||
<outlet property="resourceLoadDelegate" destination="207" id="379"/>
|
||||
</connections>
|
||||
</webView>
|
||||
</subviews>
|
||||
</view>
|
||||
</box>
|
||||
<progressIndicator horizontalHuggingPriority="750" verticalHuggingPriority="750" maxValue="100" displayedWhenStopped="NO" bezeled="NO" indeterminate="YES" controlSize="small" style="spinning" id="277">
|
||||
<rect key="frame" x="16" y="21" width="16" height="16"/>
|
||||
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMaxY="YES"/>
|
||||
</progressIndicator>
|
||||
<textField verticalHuggingPriority="750" allowsCharacterPickerTouchBarItem="YES" id="509">
|
||||
<rect key="frame" x="37" y="20" width="357" height="17"/>
|
||||
<autoresizingMask key="autoresizingMask" widthSizable="YES" flexibleMaxY="YES"/>
|
||||
<textFieldCell key="cell" scrollable="YES" lineBreakMode="clipping" sendsActionOnEndEditing="YES" id="510">
|
||||
<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>
|
||||
</subviews>
|
||||
</view>
|
||||
<connections>
|
||||
<outlet property="delegate" destination="207" id="375"/>
|
||||
</connections>
|
||||
</window>
|
||||
<window title="Droplet" allowsToolTipsWhenApplicationIsInactive="NO" autorecalculatesKeyViewLoop="NO" oneShot="NO" showsToolbarButton="NO" visibleAtLaunch="NO" frameAutosaveName="DropletWindow" animationBehavior="default" id="490" userLabel="DropletWindow">
|
||||
<windowStyleMask key="styleMask" titled="YES" closable="YES" miniaturizable="YES"/>
|
||||
<windowPositionMask key="initialPositionMask" leftStrut="YES" rightStrut="YES" topStrut="YES" bottomStrut="YES"/>
|
||||
<rect key="contentRect" x="157" y="273" width="188" height="188"/>
|
||||
<rect key="screenRect" x="0.0" y="0.0" width="1440" height="878"/>
|
||||
<view key="contentView" id="491">
|
||||
<rect key="frame" x="0.0" y="0.0" width="188" height="188"/>
|
||||
<autoresizingMask key="autoresizingMask"/>
|
||||
<subviews>
|
||||
<box autoresizesSubviews="NO" borderType="line" titlePosition="noTitle" id="494">
|
||||
<rect key="frame" x="17" y="16" width="154" height="154"/>
|
||||
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMinY="YES"/>
|
||||
<view key="contentView" id="q0i-G4-K1a">
|
||||
<rect key="frame" x="1" y="1" width="152" height="152"/>
|
||||
<autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
|
||||
<subviews>
|
||||
<progressIndicator wantsLayer="YES" horizontalHuggingPriority="750" verticalHuggingPriority="750" maxValue="100" displayedWhenStopped="NO" bezeled="NO" indeterminate="YES" style="spinning" id="496">
|
||||
<rect key="frame" x="59" y="75" width="32" height="32"/>
|
||||
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMinY="YES"/>
|
||||
</progressIndicator>
|
||||
<textField verticalHuggingPriority="750" allowsCharacterPickerTouchBarItem="YES" id="499">
|
||||
<rect key="frame" x="39" y="59" width="71" height="34"/>
|
||||
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMinY="YES"/>
|
||||
<textFieldCell key="cell" controlSize="mini" sendsActionOnEndEditing="YES" alignment="center" title="Drop files here" id="500">
|
||||
<font key="font" metaFont="system"/>
|
||||
<color key="textColor" name="disabledControlTextColor" catalog="System" colorSpace="catalog"/>
|
||||
<color key="backgroundColor" name="controlColor" catalog="System" colorSpace="catalog"/>
|
||||
</textFieldCell>
|
||||
</textField>
|
||||
<textField verticalHuggingPriority="750" allowsCharacterPickerTouchBarItem="YES" id="505">
|
||||
<rect key="frame" x="15" y="31" width="122" height="36"/>
|
||||
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMinY="YES"/>
|
||||
<textFieldCell key="cell" controlSize="small" sendsActionOnEndEditing="YES" alignment="center" id="506">
|
||||
<font key="font" metaFont="smallSystem"/>
|
||||
<color key="textColor" name="disabledControlTextColor" catalog="System" colorSpace="catalog"/>
|
||||
<color key="backgroundColor" name="controlColor" catalog="System" colorSpace="catalog"/>
|
||||
</textFieldCell>
|
||||
</textField>
|
||||
</subviews>
|
||||
</view>
|
||||
</box>
|
||||
<textField hidden="YES" verticalHuggingPriority="750" allowsCharacterPickerTouchBarItem="YES" id="519">
|
||||
<rect key="frame" x="0.0" y="0.0" width="188" height="188"/>
|
||||
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMinY="YES"/>
|
||||
<textFieldCell key="cell" enabled="NO" allowsUndo="NO" sendsActionOnEndEditing="YES" drawsBackground="YES" id="520">
|
||||
<font key="font" metaFont="system"/>
|
||||
<color key="textColor" name="controlTextColor" catalog="System" colorSpace="catalog"/>
|
||||
<color key="backgroundColor" name="disabledControlTextColor" catalog="System" colorSpace="catalog"/>
|
||||
</textFieldCell>
|
||||
</textField>
|
||||
</subviews>
|
||||
</view>
|
||||
<connections>
|
||||
<outlet property="delegate" destination="207" id="RFt-L5-f73"/>
|
||||
</connections>
|
||||
<point key="canvasLocation" x="610" y="363"/>
|
||||
</window>
|
||||
</objects>
|
||||
</document>
|
||||
BIN
Parallel/MainMenu.nib/keyedobjects.nib
generated
Normal file
BIN
Parallel/MainMenu.nib/keyedobjects.nib
generated
Normal file
Binary file not shown.
43
Parallel/Parallel.php
Executable file
43
Parallel/Parallel.php
Executable file
@@ -0,0 +1,43 @@
|
||||
<?
|
||||
|
||||
// Parallel Runner 0.1.0
|
||||
// Execute bash script with GNU parallel and monitor results
|
||||
|
||||
$lines = count(file($argv[1]));
|
||||
$glob_string = dirname($argv[1])."/*.lock";
|
||||
if ($argv[3]) { $log = $argv[3]; } else { $log = "/dev/null"; }
|
||||
|
||||
echo "Starting ".$lines." threads...";
|
||||
|
||||
exec(__DIR__."/parallel < ".escapeshellarg($argv[1])." >> ".$log." 2>&1 &");
|
||||
|
||||
echo "\nPROGRESS:0\n";
|
||||
|
||||
while (count(glob($glob_string)) < $lines) {
|
||||
|
||||
if (count(glob($glob_string))) {
|
||||
|
||||
// Terrible hack to detect files added to the destination and update the status with the last completed filename
|
||||
|
||||
$inotify_hack = exec("find ".dirname($argv[1])."/*.lock -type f -print0 | xargs -0 stat -f \"%m %N\" | sort -rn | head -1 | cut -f2- -d\" \"");
|
||||
echo substr(basename($inotify_hack,".lock"),33);
|
||||
}
|
||||
|
||||
echo "\nPROGRESS:".floor((count(glob($glob_string))/$lines)*100)."\n";
|
||||
usleep(10000);
|
||||
|
||||
}
|
||||
|
||||
echo "\nPROGRESS:100\n";
|
||||
|
||||
// Postflight script
|
||||
|
||||
if ($argv[2]) {
|
||||
exec("/bin/bash ".$argv[2]);
|
||||
}
|
||||
|
||||
if ($argv[4]) {
|
||||
exec("afplay -v .5 ".__DIR__."/ding.mp3");
|
||||
}
|
||||
|
||||
?>
|
||||
BIN
Parallel/ding.mp3
Normal file
BIN
Parallel/ding.mp3
Normal file
Binary file not shown.
11892
Parallel/parallel
Executable file
11892
Parallel/parallel
Executable file
File diff suppressed because it is too large
Load Diff
29
README.md
29
README.md
@@ -1,2 +1,31 @@
|
||||
<img align="left" src="http://www.profiteroles.org/assets/minat.png" style="float: left; margin-right: 30px;" width="120">
|
||||
|
||||
# Minat
|
||||
|
||||
**Minat** is a simple multithreaded audio transcoder for Mac OS. Minat supports one operation: transcoding flac to mp3, preserving tags and album artwork. Written in PHP, Minat is lightweight and easy to modify.
|
||||
|
||||
Support is planned for two other operations:
|
||||
|
||||
* Generate specs from audio files supported by sox
|
||||
* Rename folders based on the tags of the audio files inside
|
||||
|
||||
* **⇩ [Download Minat 0.1.5](http://www.profiteroles.org/downloads/Minat_0.1.5.zip)**
|
||||
|
||||
## Screenshot
|
||||
|
||||
<img src="http://www.profiteroles.org/assets/minat_prefs.png" width="400">
|
||||
|
||||
## Notes
|
||||
|
||||
Running Minat requires disabling Gatekeeper by running `sudo spctl --master-disable` in the Terminal.
|
||||
|
||||
## Changelog
|
||||
|
||||
http://git.profiteroles.org/profiteroles/Minat/src/branch/master/CHANGELOG.md
|
||||
|
||||
## Building from source
|
||||
|
||||
Building Minat requires Platypus and Pashua
|
||||
|
||||
* https://github.com/sveinbjornt/Platypus
|
||||
* https://github.com/BlueM/Pashua
|
||||
BIN
bin/metaflac
Executable file
BIN
bin/metaflac
Executable file
Binary file not shown.
165
functions.pashua.php
Executable file
165
functions.pashua.php
Executable file
@@ -0,0 +1,165 @@
|
||||
<?php
|
||||
|
||||
// Pashua Stuff
|
||||
|
||||
/**
|
||||
* Static class which wraps the two simple methods used for communicating with Pashua
|
||||
*/
|
||||
class Pashua
|
||||
{
|
||||
/**
|
||||
* Invokes a Pashua dialog window with the given window configuration
|
||||
*
|
||||
* @param string $conf Configuration string to pass to Pashua
|
||||
* @param string $customLocation Filesystem path to directory containing Pashua
|
||||
*
|
||||
* @throws \RuntimeException
|
||||
* @return array Associative array of values returned by Pashua
|
||||
*/
|
||||
public static function showDialog($conf, $customLocation = null)
|
||||
{
|
||||
if (ini_get('safe_mode')) {
|
||||
$msg = "To use Pashua you will have to disable safe mode or " .
|
||||
"change " . __FUNCTION__ . "() to fit your environment.\n";
|
||||
fwrite(STDERR, $msg);
|
||||
exit(1);
|
||||
}
|
||||
|
||||
// Write configuration string to temporary config file
|
||||
$configfile = tempnam('/tmp', 'Pashua_');
|
||||
if (false === $fp = @fopen($configfile, 'w')) {
|
||||
throw new \RuntimeException("Error trying to open $configfile");
|
||||
}
|
||||
fwrite($fp, $conf);
|
||||
fclose($fp);
|
||||
|
||||
$path = __DIR__."/Pashua.app/Contents/MacOS/Pashua";
|
||||
|
||||
// Call pashua binary with config file as argument and read result
|
||||
$result = shell_exec(escapeshellarg($path) . ' ' . escapeshellarg($configfile));
|
||||
|
||||
@unlink($configfile);
|
||||
|
||||
// Parse result
|
||||
$parsed = array();
|
||||
foreach (explode("\n", $result) as $line) {
|
||||
preg_match('/^(\w+)=(.*)$/', $line, $matches);
|
||||
if (empty($matches) or empty($matches[1])) {
|
||||
continue;
|
||||
}
|
||||
$parsed[$matches[1]] = $matches[2];
|
||||
}
|
||||
|
||||
return $parsed;
|
||||
}
|
||||
}
|
||||
|
||||
function makeWindowString($p, $strings) {
|
||||
|
||||
$conf = "
|
||||
# Set window title
|
||||
*.title = Preferences
|
||||
*.floating = 1
|
||||
|
||||
hr.type = image
|
||||
hr.path = ".__DIR__."/hr.png"."
|
||||
hr.width = 320
|
||||
hr.height = 2
|
||||
hr.x = 0
|
||||
hr.y = 564
|
||||
|
||||
mode.type = popup
|
||||
mode.label = Minat Operation
|
||||
mode.option = ".$strings[2][0]."
|
||||
mode.option = ".$strings[2][1]."
|
||||
mode.option = ".$strings[2][2]."
|
||||
mode.default = ".$strings[2][$p['mode']]."
|
||||
mode.width = 320
|
||||
mode.rely = 20
|
||||
mode.disabled = 1
|
||||
|
||||
dest.type = popup
|
||||
dest.label = Destination
|
||||
dest.option = ".$strings[0][0]."
|
||||
dest.option = ".$strings[0][1]."
|
||||
dest.option = ".$strings[0][2]."
|
||||
dest.default = ".$strings[0][$p['dest']]."
|
||||
dest.width = 160
|
||||
|
||||
destpath.type = openbrowser
|
||||
destpath.filetype = directory
|
||||
destpath.label = Custom destination
|
||||
destpath.default = ".$p['destpath']."
|
||||
destpath.width = 320
|
||||
|
||||
lameopts.type = textfield
|
||||
lameopts.label = LAME flags
|
||||
lameopts.default = ".$p['lameopts']."
|
||||
lameopts.placeholder = -h -b 320 --ignore-tag-errors
|
||||
lameopts.width = 320
|
||||
|
||||
check.type = checkbox
|
||||
check.label = Check flacs
|
||||
check.default = ".$p['check']."
|
||||
|
||||
warn_art.type = checkbox
|
||||
warn_art.label = Warn for missing art
|
||||
warn_art.default = ".$p['warn_art']."
|
||||
warn_art.x = 120
|
||||
warn_art.y = 338
|
||||
|
||||
template.type = textfield
|
||||
template.label = Rename template
|
||||
template.default = ".$p['template']."
|
||||
template.placeholder = ^ARTIST^ - ^YEAR^ - ^ALBUM^ {LABEL CAT} [FORMAT]
|
||||
template.width = 320
|
||||
template.disabled = 1
|
||||
|
||||
spec_dims_x.type = textfield
|
||||
spec_dims_x.label = Spec dimensions
|
||||
spec_dims_x.default = ".$p['spec_dims'][0]."
|
||||
spec_dims_x.width = 60
|
||||
spec_dims_x.disabled = 1
|
||||
|
||||
spec_dims_y.type = textfield
|
||||
spec_dims_y.default = ".$p['spec_dims'][1]."
|
||||
spec_dims_y.width = 60
|
||||
spec_dims_y.x = 80
|
||||
spec_dims_y.y = 214
|
||||
spec_dims_y.disabled = 1
|
||||
|
||||
postflight.type = popup
|
||||
postflight.label = When finished
|
||||
postflight.option = ".$strings[1][0]."
|
||||
postflight.option = ".$strings[1][1]."
|
||||
postflight.option = ".$strings[1][2]."
|
||||
postflight.option = ".$strings[1][3]."
|
||||
postflight.default = ".$strings[1][$p['postflight']]."
|
||||
postflight.width = 160
|
||||
|
||||
handler.type = openbrowser
|
||||
handler.filetype = app
|
||||
handler.label = Handler application
|
||||
handler.default = ".$p['handler']."
|
||||
handler.width = 320
|
||||
|
||||
stay_open.type = checkbox
|
||||
stay_open.label = Stay open
|
||||
stay_open.default = ".$p['stay_open']."
|
||||
|
||||
ding.type = checkbox
|
||||
ding.label = Ding
|
||||
ding.default = ".$p['ding']."
|
||||
ding.x = 100
|
||||
ding.y = 48
|
||||
|
||||
cb.type = cancelbutton
|
||||
db.type = defaultbutton
|
||||
db.label = Save
|
||||
";
|
||||
|
||||
return $conf;
|
||||
|
||||
}
|
||||
|
||||
?>
|
||||
202
functions.php
Executable file
202
functions.php
Executable file
@@ -0,0 +1,202 @@
|
||||
<?php
|
||||
|
||||
// Functions
|
||||
|
||||
function findCover($target) {
|
||||
|
||||
// Try to find properly named files (prefer newest)
|
||||
|
||||
$covers = array("Folder","Cover","Front","FOLDER","COVER","FRONT","folder","cover","front","AlbumArt");
|
||||
$exts = array("Jpg","Jpeg","JPG","JPEG","PNG","jpg","jpeg","png");
|
||||
|
||||
$found = array();
|
||||
|
||||
foreach ($covers as $cover) {
|
||||
foreach ($exts as $ext) {
|
||||
$try = $target."/".$cover.".".$ext;
|
||||
$tryparent = dirname($target)."/".$cover.".".$ext;
|
||||
if (file_exists($try)) {
|
||||
$found[filemtime($try)] = $try;
|
||||
}
|
||||
if (file_exists($tryparent)) {
|
||||
$found[filemtime($tryparent)] = $tryparent;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// If no properly named file, find a single image
|
||||
|
||||
if (!count($found)) {
|
||||
$result = glob($target."/*.{".implode(",",$exts)."}",GLOB_BRACE);
|
||||
if (@count($result) == 1) {
|
||||
$out = $result[0];
|
||||
}
|
||||
} else {
|
||||
ksort($found);
|
||||
$out = end($found);
|
||||
}
|
||||
|
||||
if ($out) {
|
||||
return $out;
|
||||
} else {
|
||||
return null;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
function parseBindings($v, $tags) {
|
||||
foreach ($v as $flag => $value) {
|
||||
$out = null;
|
||||
if (is_array($value)) {
|
||||
foreach ($value as $item) {
|
||||
if (isset($tags[$item])) {
|
||||
$parts[] = $tags[$item];
|
||||
}
|
||||
}
|
||||
if (@count($parts)) {
|
||||
$out = implode("/",$parts);
|
||||
}
|
||||
} elseif (isset($tags[$value])) {
|
||||
$out = $tags[$value];
|
||||
}
|
||||
if ($out) {
|
||||
$line[] = array($flag,$out);
|
||||
}
|
||||
}
|
||||
if (@$line) {
|
||||
return $line;
|
||||
} else {
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
function lameFlagBuilder($string) {
|
||||
|
||||
if (!$tags = parseVorbis($string)) {
|
||||
return "";
|
||||
}
|
||||
|
||||
// LAME tag <--=--> VORBIS tag
|
||||
|
||||
$v1["tt"] = "title";
|
||||
$v1["ta"] = "artist";
|
||||
$v1["tl"] = "album";
|
||||
$v1["ty"] = "date";
|
||||
$v1["tc"] = "comment";
|
||||
$v1["tn"] = array("tracknumber","tracktotal");
|
||||
|
||||
$v2["tpe2"] = "albumartist";
|
||||
$v2["tpub"] = "label";
|
||||
$v2["tpos"] = array("discnumber","disctotal");
|
||||
$v2["tcmp"] = "compilation";
|
||||
$v2["tpe2"] = "album artist";
|
||||
$v2["tenc"] = "Minat";
|
||||
|
||||
// Custom fields
|
||||
|
||||
$v2b["catalognumber"] = "catalognumber";
|
||||
$v2b["original_encoded_by"] = "encoded_by";
|
||||
$v2b["original_encoder"] = "encoder";
|
||||
$v2b["original_encoding"] = "encoding";
|
||||
|
||||
// V1 Bindings
|
||||
|
||||
if ($v1parsed = parseBindings($v1,$tags)) {
|
||||
foreach ($v1parsed as $part) {
|
||||
$line[] = "--".$part[0]." ".escapeshellarg($part[1]);
|
||||
}
|
||||
}
|
||||
|
||||
// V2 Bindings
|
||||
|
||||
if ($v2parsed = parseBindings($v2,$tags)) {
|
||||
foreach ($v2parsed as $part) {
|
||||
$line[] = "--tv ".escapeshellarg(strtoupper($part[0])."=".$part[1]);
|
||||
}
|
||||
}
|
||||
|
||||
// V2 Chained Bindings (TXXX)
|
||||
|
||||
foreach ($v2b as $flag => $value) {
|
||||
if (isset($tags[$value])) {
|
||||
$line[] = "--tv ".escapeshellarg("TXXX=".strtoupper($flag)."=".$tags[$value]);
|
||||
}
|
||||
}
|
||||
|
||||
// backup original vorbis comment
|
||||
|
||||
$line[] = "--tv ".escapeshellarg("TXXX=VORBIS_B64_ENCODED=".base64_encode(serialize($tags)));
|
||||
|
||||
// String for lame
|
||||
|
||||
return @implode(" ", $line);
|
||||
}
|
||||
|
||||
function parseVorbis($string) {
|
||||
preg_match_all("/(.*?)\s*=\s*(.*)/", $string, $matches);
|
||||
if (count($matches)) {
|
||||
foreach ($matches[1] as $key => $label) {
|
||||
$out[strtolower($label)] = $matches[2][$key];
|
||||
}
|
||||
return $out;
|
||||
} else {
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
|
||||
function dirLabel($tags) {
|
||||
}
|
||||
|
||||
function getLogPath($tail = null) {
|
||||
return "/Users/".get_current_user()."/Library/Logs/".$tail;
|
||||
}
|
||||
|
||||
function addline($line, $file = null) {
|
||||
global $p;
|
||||
if (!$file) {
|
||||
$file = $p['logfile'];
|
||||
}
|
||||
file_put_contents($file, $line."\n", FILE_APPEND);
|
||||
}
|
||||
|
||||
function updateProgress($num = 0, $total = 100) {
|
||||
$percent = floor(($num/$total)*100);
|
||||
echo "\nPROGRESS:".$percent."\n";
|
||||
}
|
||||
|
||||
function updateStatus($string) {
|
||||
echo "\n".$string."\n";
|
||||
}
|
||||
|
||||
function alert($string, $title = "Warning") {
|
||||
echo "\nALERT:".$title."|".$string."\n";
|
||||
}
|
||||
|
||||
function ncenter($string, $title = "Minat") {
|
||||
exec("osascript -e 'display notification \"".$string."\" with title \"".$title."\"'");
|
||||
}
|
||||
|
||||
function getString($question) {
|
||||
return exec("osascript -e 'display dialog \"".$question."\" default answer \"\"' | cut -f3 -d\":\"");
|
||||
}
|
||||
|
||||
function ask($string) {
|
||||
$result = exec("osascript -e \"display dialog \\\"".$string."\\\"\" 2>&1");
|
||||
if (strpos($result,"canceled") !== false) {
|
||||
return 0;
|
||||
} else {
|
||||
return 1;
|
||||
}
|
||||
}
|
||||
|
||||
function askMulti($string, $buttons) {
|
||||
$buttonstring = "buttons {\\\"".implode("\\\", \\\"",$buttons)."\\\"} default button ".count($buttons);
|
||||
$result = exec("osascript -e \"display dialog \\\"".$string."\\\" ".$buttonstring."\" | cut -f2 -d':'");
|
||||
return array_search($result,$buttons);
|
||||
}
|
||||
|
||||
function quitme() {
|
||||
echo "\nQUITAPP\n";
|
||||
}
|
||||
|
||||
?>
|
||||
BIN
minat.icns
Normal file
BIN
minat.icns
Normal file
Binary file not shown.
1
prefs.php
Normal file
1
prefs.php
Normal file
@@ -0,0 +1 @@
|
||||
a:12:{s:4:"mode";i:1;s:8:"lameopts";s:29:"-h -b 320 --ignore-tag-errors";s:5:"check";i:0;s:10:"postflight";i:0;s:7:"handler";s:24:"/Applications/iTunes.app";s:4:"dest";i:1;s:8:"destpath";s:0:"";s:9:"stay_open";i:1;s:4:"ding";i:1;s:8:"warn_art";i:0;s:9:"spec_dims";a:2:{i:0;s:3:"900";i:1;s:4:"1400";}s:8:"template";s:48:"^ARTIST^ - ^YEAR^ - ^ALBUM^ {LABEL CAT} [FORMAT]";}
|
||||
1
version.txt
Executable file
1
version.txt
Executable file
@@ -0,0 +1 @@
|
||||
0.1.5.2
|
||||
Reference in New Issue
Block a user