Skip to content

Commit

Permalink
Tested and fixed playlist item removal code, updated and added UI ele…
Browse files Browse the repository at this point in the history
…ments related to playlists. Added taglib as framework

Added genre/playlist mapping, aka genre hack, found existing bugs, added more, then fixed a bunch of them.
All were related to unicode/accent chars in media and filenames, or were bad assumptions about what is an
error and what isn't during playlist cleanup or copy/conversion, usually race condition related with directory
creation or dir/file deletion.

Found several taglib crashes caused by such issues, and fixed
the original causes, but still would like to make the taglib code in particular fail more gracefully.

Added build config for using taglib as a framework in the app bundle.
Note had to fix the dir layout of the framework and do a
'install_name_tool -id @rpath/tag.framework/Versions/A/tag tag.framework/Versions/A/tag'
to get it to work properly.
  • Loading branch information
tattwamasi committed Apr 15, 2015
1 parent 944c9d6 commit f130f16
Show file tree
Hide file tree
Showing 7 changed files with 202 additions and 98 deletions.
21 changes: 17 additions & 4 deletions TeslaTunes.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,6 @@
E502D0C81A739D1500BE86E2 /* ViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = E502D0C71A739D1500BE86E2 /* ViewController.m */; };
E502D0CA1A739D1500BE86E2 /* Images.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = E502D0C91A739D1500BE86E2 /* Images.xcassets */; };
E502D0CD1A739D1500BE86E2 /* Main.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = E502D0CB1A739D1500BE86E2 /* Main.storyboard */; };
E52E87971ADD9AA900B08A74 /* tag.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = E52E87961ADD9AA900B08A74 /* tag.framework */; };
E52E87991ADD9F2E00B08A74 /* AVFoundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = E52E87981ADD9F2E00B08A74 /* AVFoundation.framework */; };
E52E879B1ADD9F8F00B08A74 /* AudioToolbox.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = E52E879A1ADD9F8F00B08A74 /* AudioToolbox.framework */; };
E5436D291AC3D44D0068E42E /* iTunesLibrary.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = E5436D281AC3D44D0068E42E /* iTunesLibrary.framework */; };
Expand All @@ -37,8 +36,9 @@
E59078A41AAAFE0E007A26D6 /* CopyConvertDirs.mm in Sources */ = {isa = PBXBuildFile; fileRef = E59078A31AAAFE0E007A26D6 /* CopyConvertDirs.mm */; };
E59078A71AAC1AD7007A26D6 /* flac_utils.mm in Sources */ = {isa = PBXBuildFile; fileRef = E59078A51AAC1AD7007A26D6 /* flac_utils.mm */; };
E59078AA1AAEC044007A26D6 /* Receptionist.m in Sources */ = {isa = PBXBuildFile; fileRef = E59078A91AAEC044007A26D6 /* Receptionist.m */; };
E59078AC1AAF9741007A26D6 /* todo and notes.txt in Resources */ = {isa = PBXBuildFile; fileRef = E59078AB1AAF9740007A26D6 /* todo and notes.txt */; };
E5CC88BF1AB6514E00C8951F /* Credits.html in Resources */ = {isa = PBXBuildFile; fileRef = E5CC88BE1AB6514E00C8951F /* Credits.html */; };
E5F8767F1ADE477000F9A362 /* tag.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = E52E87961ADD9AA900B08A74 /* tag.framework */; };
E5F876801ADE49D800F9A362 /* tag.framework in CopyFiles */ = {isa = PBXBuildFile; fileRef = E52E87961ADD9AA900B08A74 /* tag.framework */; settings = {ATTRIBUTES = (CodeSignOnCopy, RemoveHeadersOnCopy, ); }; };
/* End PBXBuildFile section */

/* Begin PBXContainerItemProxy section */
Expand All @@ -51,6 +51,19 @@
};
/* End PBXContainerItemProxy section */

/* Begin PBXCopyFilesBuildPhase section */
E5F8767A1ADE347300F9A362 /* CopyFiles */ = {
isa = PBXCopyFilesBuildPhase;
buildActionMask = 12;
dstPath = "";
dstSubfolderSpec = 10;
files = (
E5F876801ADE49D800F9A362 /* tag.framework in CopyFiles */,
);
runOnlyForDeploymentPostprocessing = 0;
};
/* End PBXCopyFilesBuildPhase section */

/* Begin PBXFileReference section */
E502814C1ACBA133006D996C /* TableCellViewCheckmark.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = TableCellViewCheckmark.h; sourceTree = "<group>"; };
E502814D1ACBA133006D996C /* TableCellViewCheckmark.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = TableCellViewCheckmark.m; sourceTree = "<group>"; };
Expand Down Expand Up @@ -88,9 +101,9 @@
isa = PBXFrameworksBuildPhase;
buildActionMask = 2147483647;
files = (
E5F8767F1ADE477000F9A362 /* tag.framework in Frameworks */,
E52E879B1ADD9F8F00B08A74 /* AudioToolbox.framework in Frameworks */,
E52E87991ADD9F2E00B08A74 /* AVFoundation.framework in Frameworks */,
E52E87971ADD9AA900B08A74 /* tag.framework in Frameworks */,
E58A24B91AC9282300E8DDE4 /* AppKit.framework in Frameworks */,
E5436D291AC3D44D0068E42E /* iTunesLibrary.framework in Frameworks */,
);
Expand Down Expand Up @@ -176,6 +189,7 @@
E502D0B81A739D1500BE86E2 /* Sources */,
E502D0B91A739D1500BE86E2 /* Frameworks */,
E502D0BA1A739D1500BE86E2 /* Resources */,
E5F8767A1ADE347300F9A362 /* CopyFiles */,
);
buildRules = (
);
Expand Down Expand Up @@ -237,7 +251,6 @@
E502D0CA1A739D1500BE86E2 /* Images.xcassets in Resources */,
E5CC88BF1AB6514E00C8951F /* Credits.html in Resources */,
E502D0CD1A739D1500BE86E2 /* Main.storyboard in Resources */,
E59078AC1AAF9741007A26D6 /* todo and notes.txt in Resources */,
);
runOnlyForDeploymentPostprocessing = 0;
};
Expand Down
23 changes: 22 additions & 1 deletion TeslaTunes/Base.lproj/Main.storyboard
Original file line number Diff line number Diff line change
Expand Up @@ -252,14 +252,14 @@
</buttonCell>
<connections>
<action selector="checkmarkClicked:" target="XfG-lQ-9wD" id="rBN-VO-Qk7"/>
<binding destination="XfG-lQ-9wD" name="enabled" keyPath="self.copyPlaylists" id="Gen-vl-QJR"/>
<binding destination="XfG-lQ-9wD" name="value" keyPath="self.ccDirs.hackGenre" id="zmv-g1-QwT">
<dictionary key="options">
<integer key="NSNoSelectionPlaceholder" value="0"/>
<integer key="NSNotApplicablePlaceholder" value="0"/>
<integer key="NSNullPlaceholder" value="0"/>
</dictionary>
</binding>
<binding destination="XfG-lQ-9wD" name="enabled" keyPath="self.copyPlaylists" id="Gen-vl-QJR"/>
</connections>
</button>
<popUpButton autoresizesSubviews="NO" verticalHuggingPriority="750" translatesAutoresizingMaskIntoConstraints="NO" id="GH1-1u-h2x" userLabel="Operation type popup">
Expand Down Expand Up @@ -314,6 +314,22 @@
<color key="backgroundColor" name="controlColor" catalog="System" colorSpace="catalog"/>
</textFieldCell>
</textField>
<textField horizontalHuggingPriority="251" verticalHuggingPriority="750" translatesAutoresizingMaskIntoConstraints="NO" id="pae-oz-aHU" userLabel="FilesMarkedForOrDeleted:">
<rect key="frame" x="16" y="366" width="110" height="14"/>
<textFieldCell key="cell" scrollable="YES" lineBreakMode="clipping" sendsActionOnEndEditing="YES" title="Marked for/Deleted:" id="Dkc-cC-slV">
<font key="font" metaFont="smallSystem"/>
<color key="textColor" name="labelColor" catalog="System" colorSpace="catalog"/>
<color key="backgroundColor" name="controlColor" catalog="System" colorSpace="catalog"/>
</textFieldCell>
</textField>
<textField horizontalHuggingPriority="251" verticalHuggingPriority="750" translatesAutoresizingMaskIntoConstraints="NO" id="5sN-qD-1ks" userLabel="NumberOfFilesMarkedOrDeleted">
<rect key="frame" x="130" y="366" width="4" height="14"/>
<textFieldCell key="cell" scrollable="YES" lineBreakMode="clipping" sendsActionOnEndEditing="YES" id="9Gg-Sm-XVt">
<font key="font" metaFont="smallSystem"/>
<color key="textColor" name="labelColor" catalog="System" colorSpace="catalog"/>
<color key="backgroundColor" name="controlColor" catalog="System" colorSpace="catalog"/>
</textFieldCell>
</textField>
<textField horizontalHuggingPriority="251" verticalHuggingPriority="750" translatesAutoresizingMaskIntoConstraints="NO" id="7Dp-8U-ga1">
<rect key="frame" x="217" y="388" width="133" height="14"/>
<textFieldCell key="cell" scrollable="YES" lineBreakMode="clipping" sendsActionOnEndEditing="YES" title="Files to copy or convert:" id="obf-Wq-bgv">
Expand Down Expand Up @@ -369,11 +385,15 @@
</view>
<constraints>
<constraint firstItem="1Oi-qv-bwK" firstAttribute="top" secondItem="p6W-b9-tqn" secondAttribute="bottom" constant="8" symbolic="YES" id="04A-BY-bEh"/>
<constraint firstItem="pae-oz-aHU" firstAttribute="leading" secondItem="Bmc-7B-QiY" secondAttribute="leading" id="Bmr-6z-Tyj"/>
<constraint firstItem="pae-oz-aHU" firstAttribute="top" secondItem="5sN-qD-1ks" secondAttribute="top" id="Bnm-K1-h6z"/>
<constraint firstAttribute="centerX" secondItem="7Dp-8U-ga1" secondAttribute="leading" id="CPL-h8-9Gb"/>
<constraint firstItem="p6W-b9-tqn" firstAttribute="leading" secondItem="7Dp-8U-ga1" secondAttribute="leading" id="Ca3-Nc-R9l"/>
<constraint firstItem="Bmc-7B-QiY" firstAttribute="leading" secondItem="2hX-ai-bcL" secondAttribute="leading" constant="16" id="Ggx-yF-EmM"/>
<constraint firstItem="5sN-qD-1ks" firstAttribute="leading" secondItem="pae-oz-aHU" secondAttribute="trailing" constant="8" symbolic="YES" id="ItF-Mt-a5M"/>
<constraint firstItem="9Uc-OL-ju2" firstAttribute="top" secondItem="7Dp-8U-ga1" secondAttribute="top" id="LJt-1L-gR5"/>
<constraint firstItem="Bmc-7B-QiY" firstAttribute="top" secondItem="7Dp-8U-ga1" secondAttribute="top" id="V5N-11-Ltl"/>
<constraint firstItem="pae-oz-aHU" firstAttribute="top" secondItem="Bmc-7B-QiY" secondAttribute="bottom" constant="8" symbolic="YES" id="cJD-1b-oFc"/>
<constraint firstItem="rXA-6K-o4C" firstAttribute="top" secondItem="1Oi-qv-bwK" secondAttribute="bottom" constant="8" symbolic="YES" id="chY-hn-ggm"/>
<constraint firstItem="1eU-II-ftW" firstAttribute="leading" secondItem="Bmc-7B-QiY" secondAttribute="trailing" constant="8" symbolic="YES" id="eLM-MN-Qko"/>
<constraint firstItem="p6W-b9-tqn" firstAttribute="top" secondItem="7Dp-8U-ga1" secondAttribute="bottom" constant="8" symbolic="YES" id="jhP-gJ-KCn"/>
Expand Down Expand Up @@ -424,6 +444,7 @@
<outlet property="destinationPath" destination="N8v-pA-fRa" id="7zb-Us-CGg"/>
<outlet property="doItButton" destination="k3G-E8-VKF" id="lhS-cS-tee"/>
<outlet property="numberOfFilesCopiedOrConvertedLabel" destination="xCN-9H-iZ9" id="oY8-eP-vgv"/>
<outlet property="numberOfFilesForDeletionLabel" destination="5sN-qD-1ks" id="vy9-pR-jQw"/>
<outlet property="numberOfFilesScannedLabel" destination="1eU-II-ftW" id="IvD-iw-Kyw"/>
<outlet property="numberOfFilesToCopyOrConvertLabel" destination="9Uc-OL-ju2" id="4NG-cX-Y7V"/>
<outlet property="opTypeButton" destination="GH1-1u-h2x" id="3Dv-iB-Su2"/>
Expand Down
2 changes: 2 additions & 0 deletions TeslaTunes/CopyConvertDirs.h
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ typedef NS_ENUM(NSUInteger, DirOperation) {
@public
const NSURL *sourceURL;
const NSURL *destinationURL;
const NSString *genre;
}
@end

Expand All @@ -34,6 +35,7 @@ typedef NS_ENUM(NSUInteger, DirOperation) {
@property (readonly) unsigned filesChecked;
@property (readonly) unsigned filesToCopyConvert;
@property (readonly) unsigned filesCopyConverted;
@property (readonly) unsigned filesMarkedForOrDeleted;
@property (readonly) BOOL isProcessing;
@property (readonly) BOOL scanReady;

Expand Down
Loading

0 comments on commit f130f16

Please sign in to comment.