Permalink
Browse files

seems that we don't need a pict image, tiff is fine. Atleast for iTun…

…es10
  • Loading branch information...
1 parent be5bf6a commit 7a2529772ab8876b43c0e28a7b55072cf2f01fb0 @kgn committed Jun 24, 2011
Showing with 20 additions and 96 deletions.
  1. +16 −16 Examples/main.m
  2. +0 −12 EyeTunes.xcodeproj/project.pbxproj
  3. +4 −5 Source/ETTrack.m
  4. +0 −15 Source/NSImage+PICT.h
  5. +0 −48 Source/NSImage+PICT.m
View
@@ -164,22 +164,22 @@ void test_create_playlist(EyeTunes *e) {
int main (int argc, const char * argv[]) {
NSAutoreleasePool * pool = [[NSAutoreleasePool alloc] init];
- EyeTunes *e = [EyeTunes sharedInstance];
-
- test_get_playlists(e);
- test_get_track(e);
- test_get_tracks_by_search(e);
- test_get_selected(e);
- //test_dupe_selected_image(e);
- //test_set_track_details(e);
- test_playlist_persistent_id(e);
- //test_select_playlist_by_persistent_id(e);
- test_track_persistent_id(e);
-
- //rename_chinese_tracks(e);
- //test_create_playlist(e);
-
- [pool release];
+ EyeTunes *e = [EyeTunes sharedInstance];
+
+ test_get_playlists(e);
+ test_get_track(e);
+ test_get_tracks_by_search(e);
+ test_get_selected(e);
+ //test_dupe_selected_image(e);
+ //test_set_track_details(e);
+ test_playlist_persistent_id(e);
+ //test_select_playlist_by_persistent_id(e);
+ test_track_persistent_id(e);
+
+ //rename_chinese_tracks(e);
+ //test_create_playlist(e);
+
+ [pool release];
return 0;
}
@@ -51,9 +51,6 @@
638ADA3F1325160700B02DFB /* NSNumber+ETPlaylistNameSorting.m in Sources */ = {isa = PBXBuildFile; fileRef = DDEBCD330E8D245000219086 /* NSNumber+ETPlaylistNameSorting.m */; };
735028C813B339A700DD08C4 /* NSString+LongLongValue.h in Headers */ = {isa = PBXBuildFile; fileRef = 735028C613B339A700DD08C4 /* NSString+LongLongValue.h */; };
735028C913B339A700DD08C4 /* NSString+LongLongValue.m in Sources */ = {isa = PBXBuildFile; fileRef = 735028C713B339A700DD08C4 /* NSString+LongLongValue.m */; };
- 7395802513B3514C0015C726 /* NSImage+PICT.h in Headers */ = {isa = PBXBuildFile; fileRef = 7395802313B3514C0015C726 /* NSImage+PICT.h */; };
- 7395802613B3514C0015C726 /* NSImage+PICT.m in Sources */ = {isa = PBXBuildFile; fileRef = 7395802413B3514C0015C726 /* NSImage+PICT.m */; };
- 7395802813B351CD0015C726 /* QuickTime.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 7395802713B351CD0015C726 /* QuickTime.framework */; };
DD233EB70E66FD45004B210F /* ETUserPlaylistEnumerator.m in Sources */ = {isa = PBXBuildFile; fileRef = DD233EAB0E66FCC4004B210F /* ETUserPlaylistEnumerator.m */; };
DD233EB80E66FD45004B210F /* ETUserPlaylistEnumerator.h in Headers */ = {isa = PBXBuildFile; fileRef = DD233EAA0E66FCC4004B210F /* ETUserPlaylistEnumerator.h */; settings = {ATTRIBUTES = (Public, ); }; };
DDB3AF3D0EC4A147003C7FE6 /* ETRootUserPlaylist.m in Sources */ = {isa = PBXBuildFile; fileRef = DD2AB89A0E97A88800178457 /* ETRootUserPlaylist.m */; };
@@ -120,9 +117,6 @@
32DBCF5E0370ADEE00C91783 /* EyeTunes_Prefix.pch */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = EyeTunes_Prefix.pch; sourceTree = "<group>"; };
735028C613B339A700DD08C4 /* NSString+LongLongValue.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = "NSString+LongLongValue.h"; sourceTree = "<group>"; };
735028C713B339A700DD08C4 /* NSString+LongLongValue.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = "NSString+LongLongValue.m"; sourceTree = "<group>"; };
- 7395802313B3514C0015C726 /* NSImage+PICT.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = "NSImage+PICT.h"; sourceTree = "<group>"; };
- 7395802413B3514C0015C726 /* NSImage+PICT.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = "NSImage+PICT.m"; sourceTree = "<group>"; };
- 7395802713B351CD0015C726 /* QuickTime.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = QuickTime.framework; path = ../../../../../System/Library/Frameworks/QuickTime.framework; sourceTree = "<group>"; };
8DC2EF5A0486A6940098B216 /* Info.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist; path = Info.plist; sourceTree = "<group>"; };
8DC2EF5B0486A6940098B216 /* EyeTunes.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = EyeTunes.framework; sourceTree = BUILT_PRODUCTS_DIR; };
DD233EAA0E66FCC4004B210F /* ETUserPlaylistEnumerator.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ETUserPlaylistEnumerator.h; sourceTree = "<group>"; };
@@ -160,7 +154,6 @@
isa = PBXFrameworksBuildPhase;
buildActionMask = 2147483647;
files = (
- 7395802813B351CD0015C726 /* QuickTime.framework in Frameworks */,
030BFB0B098D01BE00D68616 /* Foundation.framework in Frameworks */,
031B48AB088444F60086F24B /* ApplicationServices.framework in Frameworks */,
030BFB92098D517A00D68616 /* AppKit.framework in Frameworks */,
@@ -212,7 +205,6 @@
0867D691FE84028FC02AAC07 /* EyeTunes */ = {
isa = PBXGroup;
children = (
- 7395802713B351CD0015C726 /* QuickTime.framework */,
039620900C0DE6E500786326 /* Examples */,
08FB77AEFE84172EC02AAC07 /* Classes */,
32C88DFF0371C24200C91783 /* Other Sources */,
@@ -271,8 +263,6 @@
735028C713B339A700DD08C4 /* NSString+LongLongValue.m */,
DDEBCD320E8D245000219086 /* NSNumber+ETPlaylistNameSorting.h */,
DDEBCD330E8D245000219086 /* NSNumber+ETPlaylistNameSorting.m */,
- 7395802313B3514C0015C726 /* NSImage+PICT.h */,
- 7395802413B3514C0015C726 /* NSImage+PICT.m */,
);
name = Classes;
path = Source;
@@ -308,7 +298,6 @@
DDEBCC910E8D1EF700219086 /* ETPlaylistCache.h in Headers */,
DDB3AF3E0EC4A148003C7FE6 /* ETRootUserPlaylist.h in Headers */,
735028C813B339A700DD08C4 /* NSString+LongLongValue.h in Headers */,
- 7395802513B3514C0015C726 /* NSImage+PICT.h in Headers */,
);
runOnlyForDeploymentPostprocessing = 0;
};
@@ -462,7 +451,6 @@
DD233EB70E66FD45004B210F /* ETUserPlaylistEnumerator.m in Sources */,
DDEBCD360E8D255600219086 /* NSNumber+ETPlaylistNameSorting.m in Sources */,
735028C913B339A700DD08C4 /* NSString+LongLongValue.m in Sources */,
- 7395802613B3514C0015C726 /* NSImage+PICT.m in Sources */,
);
runOnlyForDeploymentPostprocessing = 0;
};
View
@@ -40,7 +40,6 @@ CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
#import "ETTrack.h"
#import "NSString+LongLongValue.h"
-#import "NSImage+PICT.h"
#import "ETDebug.h"
@@ -79,16 +78,16 @@ - (BOOL)setArtwork:(NSImage *)artwork atIndex:(int)index
OSErr err;
if (artwork != nil) {
- NSData *pictData = [artwork pictRepresentation];
+ NSData *tiffData = [artwork TIFFRepresentation];
- if ([pictData length] < 512) {
+ if ([tiffData length] < 512) {
ETLog(@"Unable to convert to PICT");
return NO;
}
err = AEBuildDesc(&pictDesc, NULL, "'PICT'(@)",
- [pictData length],
- [pictData bytes]);
+ [tiffData length],
+ [tiffData bytes]);
if (err != noErr) {
ETLog(@"Error with constructing PICT: %d", err);
View
@@ -1,15 +0,0 @@
-//
-// NSImage+PICT.h
-// EyeTunes
-//
-// Created by David Keegan on 6/23/11.
-// Copyright 2011 InScopeApps {+}. All rights reserved.
-//
-
-#import <Foundation/Foundation.h>
-
-@interface NSImage (PICT)
-
-- (NSData*) pictRepresentation;
-
-@end
View
@@ -1,48 +0,0 @@
-//
-// NSImage+PICT.m
-// EyeTunes
-//
-// Created by David Keegan on 6/23/11.
-// Copyright 2011 InScopeApps {+}. All rights reserved.
-//
-// From: http://www.cocoabuilder.com/archive/cocoa/82390-nsimage-to-pict.html
-//
-
-#import <QuickTime/QuickTime.h>
-#import "NSImage+PICT.h"
-
-@implementation NSImage (PICT)
-
-- (NSData*) pictRepresentation
-{
- MovieImportComponent importer;
-
- if (OpenADefaultComponent(GraphicsImporterComponentType,
- kQTFileTypeTIFF, &importer) != noErr)
- {
- CloseComponent(importer);
- return nil;
- }
-
- Handle imageHandle;
- NSData *imageData = [self TIFFRepresentation];
- long int dataSize = [imageData length];
- (void)PtrToHand([imageData bytes], &imageHandle, dataSize);
-
- OSErr err = GraphicsImportSetDataHandle(importer, imageHandle);
- if (err != noErr)
- {
- return nil;
- }
-
- PicHandle resultPicHandle = (PicHandle)NewHandleClear(20);
- err = GraphicsImportGetAsPicture(importer, &resultPicHandle) ;
-
- NSData *returnValue = [NSData dataWithBytes:*resultPicHandle
- length:(int)GetHandleSize((Handle)resultPicHandle)];
- DisposeHandle((Handle)resultPicHandle);
-
- return returnValue;
-}
-
-@end

0 comments on commit 7a25297

Please sign in to comment.