[eyetunes commit] r260 - in EyeTunes/trunk: . EyeTunes.xcodeproj

0 views
Skip to first unread message

codesite...@google.com

unread,
Aug 2, 2008, 7:16:27 PM8/2/08
to eyet...@googlegroups.com
Author: alastairtse
Date: Sat Aug 2 16:15:59 2008
New Revision: 260

Modified:
EyeTunes/trunk/ChangeLog
EyeTunes/trunk/ETTrack.m
EyeTunes/trunk/EyeTunes.xcodeproj/project.pbxproj
EyeTunes/trunk/main.m

Log:
Add patch to workaround itunes 7.7.1 changed track format when using persistentId

Modified: EyeTunes/trunk/ChangeLog
==============================================================================
--- EyeTunes/trunk/ChangeLog (original)
+++ EyeTunes/trunk/ChangeLog Sat Aug 2 16:15:59 2008
@@ -1,3 +1,7 @@
+03 Aug 08; Alastair Tse <alas...@liquidx.net>
+ * Workaround changed track descriptor returned from iTunes 7.7.1.
+ Thanks to Simon Haertel for the patch.
+
06 Jul 07; EyeTunes-1.3.3; Alastair Tse <alas...@liquidx.net>
* Fix persistentID support AGAIN for iTunes 7.3 as they reverted their
previous changes. Patch thanks to Andy Kim of Potion Factory.

Modified: EyeTunes/trunk/ETTrack.m
==============================================================================
--- EyeTunes/trunk/ETTrack.m (original)
+++ EyeTunes/trunk/ETTrack.m Sat Aug 2 16:15:59 2008
@@ -47,6 +47,13 @@

- (id) initWithDescriptor:(AEDesc *)desc
{
+ // iTunes 7.7.1 returns a list with one track item rather than the
track directly.
+ if (desc->descriptorType == typeAEList) {
+ AEDesc trackDesc;
+ if (noErr == AEGetNthDesc((AEDescList*)desc, 1, typeWildCard, NULL,
&trackDesc)) {
+ desc = &trackDesc;
+ }
+ }
self = [super initWithDescriptor:desc applCode:ET_APPLE_EVENT_OBJECT_DEFAULT_APPL];
return self;
}
@@ -93,8 +100,8 @@
}

err = AEBuildDesc(&pictDesc, NULL, "'PICT'(@)",
- [pictData length],
- [pictData bytes]);
+ [pictData length],
+ [pictData bytes]);

if (err != noErr) {
ETLog(@"Error with constructing PICT: %d", err);
@@ -104,9 +111,9 @@
/* execute send command */
BOOL success = NO;
success = [self setProperty:ET_ARTWORK_PROP_DATA
- OfElementOfClass:ET_CLASS_ARTWORK
+ OfElementOfClass:ET_CLASS_ARTWORK
atIndex:index
- withValue:&pictDesc];
+ withValue:&pictDesc];
AEDisposeDesc(&pictDesc);

return success;
@@ -126,7 +133,7 @@
NSMutableArray *artworkArray = [NSMutableArray array];
int i;
DescType resultType;
- Size resultSize;
+ Size resultSize;

/* count the number of artworks */
int elementCount = [self getCountOfElementsOfClass:ET_CLASS_ARTWORK];
@@ -374,7 +381,7 @@

if ([[EyeTunes sharedInstance] versionGreaterThan:ITUNES_7_2_1] ||
[[EyeTunes sharedInstance] versionLessThan:ITUNES_7_2])
- return [self getPropertyAsLongIntegerForDesc:ET_ITEM_PROP_PERSISTENT_ID];
+ return [self getPropertyAsLongIntegerForDesc:ET_ITEM_PROP_PERSISTENT_ID];
else {
NSString *persistentId = [NSString stringWithFormat:@"0x%@",[self getPropertyAsStringForDesc:ET_ITEM_PROP_PERSISTENT_ID]];
return [persistentId longlongValue];
@@ -386,7 +393,7 @@
// Trying a different way of doing version comparison:
//
// - The newer versions are checked for first because it's most
likely that the user is running
- // the latest version of iTunes
+ // the latest version of iTunes
//
// - Direct integer comparison is used for efficiency and to make
reading the code easier
//

Modified: EyeTunes/trunk/EyeTunes.xcodeproj/project.pbxproj
==============================================================================
--- EyeTunes/trunk/EyeTunes.xcodeproj/project.pbxproj (original)
+++ EyeTunes/trunk/EyeTunes.xcodeproj/project.pbxproj Sat Aug 2
16:15:59 2008
@@ -97,7 +97,7 @@
035B70B70885537800D0B89E /* ETTrack.h */ = {isa = PBXFileReference;
fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ETTrack.h;
sourceTree = "<group>"; };
035B70B80885537800D0B89E /* ETTrack.m */ = {isa = PBXFileReference;
fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path =
ETTrack.m; sourceTree = "<group>"; };
03748E7A099D8AD4002F09C3 /* EyeTunesDebug.app */ = {isa =
PBXFileReference; explicitFileType = wrapper.application;
includeInIndex = 0; path = EyeTunesDebug.app; sourceTree =
BUILT_PRODUCTS_DIR; };
- 03748E7C099D8AD4002F09C3 /* EyeTunesDebug-Info.plist */ = {isa =
PBXFileReference; lastKnownFileType = text.xml; path
= "EyeTunesDebug-Info.plist"; sourceTree = "<group>"; };
+ 03748E7C099D8AD4002F09C3 /* EyeTunesDebug-Info.plist */ = {isa =
PBXFileReference; lastKnownFileType = text.plist.xml; path
= "EyeTunesDebug-Info.plist"; sourceTree = "<group>"; };
03749077099D8B48002F09C3 /* debug_main.m */ = {isa =
PBXFileReference; fileEncoding = 4; lastKnownFileType =
sourcecode.c.objc; path = debug_main.m; sourceTree = "<group>"; };
03749090099D8BEB002F09C3 /* MainMenu.nib */ = {isa =
PBXFileReference; lastKnownFileType = wrapper.nib; path = MainMenu.nib;
sourceTree = "<group>"; };
0374909A099D8CDE002F09C3 /* DebugController.h */ = {isa =
PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h;
path = DebugController.h; sourceTree = "<group>"; };
@@ -350,10 +350,12 @@
0867D690FE84028FC02AAC07 /* Project object */ = {
isa = PBXProject;
buildConfigurationList = 031B4820088429A70086F24B /* Build
configuration list for PBXProject "EyeTunes" */;
+ compatibilityVersion = "Xcode 2.4";
hasScannedForEncodings = 1;
mainGroup = 0867D691FE84028FC02AAC07 /* EyeTunes */;
productRefGroup = 034768DFFF38A50411DB9C8B /* Products */;
projectDirPath = "";
+ projectRoot = "";
targets = (
8DC2EF4F0486A6940098B216 /* EyeTunes */,
031B484508843C940086F24B /* TestEyeTunes */,
@@ -530,12 +532,12 @@
COPY_PHASE_STRIP = NO;
GCC_GENERATE_DEBUGGING_SYMBOLS = YES;
GCC_MODEL_TUNING = G5;
+ GCC_OPTIMIZATION_LEVEL = 0;
GCC_PRECOMPILE_PREFIX_HEADER = YES;
GCC_PREFIX_HEADER = "$(SYSTEM_LIBRARY_DIR)/Frameworks/AppKit.framework/Headers/AppKit.h";
GCC_PREPROCESSOR_DEFINITIONS = "";
INSTALL_PATH = /usr/local/bin;
KEEP_PRIVATE_EXTERNS = YES;
- OPTIMIZATION_CFLAGS = "-O0";
OTHER_CFLAGS = "";
OTHER_LDFLAGS = (
"-framework",
@@ -561,11 +563,11 @@
COPY_PHASE_STRIP = YES;
GCC_GENERATE_DEBUGGING_SYMBOLS = NO;
GCC_MODEL_TUNING = G5;
+ GCC_OPTIMIZATION_LEVEL = 0;
GCC_PRECOMPILE_PREFIX_HEADER = YES;
GCC_PREFIX_HEADER = "$(SYSTEM_LIBRARY_DIR)/Frameworks/AppKit.framework/Headers/AppKit.h";
GCC_PREPROCESSOR_DEFINITIONS = "";
INSTALL_PATH = /usr/local/bin;
- OPTIMIZATION_CFLAGS = "-O0";
OTHER_CFLAGS = "";
OTHER_LDFLAGS = (
"-framework",

Modified: EyeTunes/trunk/main.m
==============================================================================
--- EyeTunes/trunk/main.m (original)
+++ EyeTunes/trunk/main.m Sat Aug 2 16:15:59 2008
@@ -87,6 +87,8 @@
while (t = [iter nextObject]) {
long long int persistentId = [t persistentId];
NSLog(@"Track Persistent ID (%016llX): %@", persistentId, [t name]);
+ ETTrack *testTrack = [e trackWithPersistentId:persistentId];
+ NSLog(@"Track: %@", [testTrack name]);
}
}

@@ -158,15 +160,15 @@
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_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_playlist_persistent_id(e);
//test_select_playlist_by_persistent_id(e);
- //test_track_persistent_id(e);
+ test_track_persistent_id(e);

//rename_chinese_tracks(e);

Reply all
Reply to author
Forward
0 new messages