X-Git-Url: http://git.ithinksw.org/MenuTunes.git/blobdiff_plain/1460172a7ddc8caf0fb25a4c9bc2d4f32d65f021..fb67a5518acfe2abf1f426ec7cf7b9a80ff74dc3:/iTunesRemote.m diff --git a/iTunesRemote.m b/iTunesRemote.m index 0723d73..0f537fb 100755 --- a/iTunesRemote.m +++ b/iTunesRemote.m @@ -166,6 +166,16 @@ return [[ITAppleEventCenter sharedCenter] sendAEWithSendString:[NSString stringWithFormat:@"'----':obj { form:'prop', want:type('prop'), seld:type('pnam'), from:obj { form:'indx', want:type('cTrk'), seld:long(%lu), from:obj { form:'prop', want:type('prop'), seld:type('pPla'), from:'null'() } } }",index] eventClass:@"core" eventID:@"getd" appPSN:iTunesPSN]; } +- (int)currentAlbumTrackCount +{ + return [[ITAppleEventCenter sharedCenter] sendTwoTierAEWithRequestedKeyForNumber:@"pTrC" fromObjectByKey:@"pTrk" eventClass:@"core" eventID:@"getd" appPSN:iTunesPSN]; +} + +- (int)currentSongTrack +{ + return [[ITAppleEventCenter sharedCenter] sendTwoTierAEWithRequestedKeyForNumber:@"pTrN" fromObjectByKey:@"pTrk" eventClass:@"core" eventID:@"getd" appPSN:iTunesPSN]; +} + - (NSString *)currentSongUniqueIdentifier { return [NSString stringWithFormat:@"%i-%i", [self currentPlaylistIndex], [[ITAppleEventCenter sharedCenter] sendTwoTierAEWithRequestedKeyForNumber:@"pDID" fromObjectByKey:@"pTrk" eventClass:@"core" eventID:@"getd" appPSN:iTunesPSN]]; @@ -223,18 +233,18 @@ return YES; } -- (BOOL)equalizerEnabled +/* - (BOOL)equalizerEnabled { int thingy = [[ITAppleEventCenter sharedCenter] sendAEWithSendStringForNumber:@"'----':obj { form:type('prop'), want:type('prop'), seld:type('pEQ '), from:() }" eventClass:@"core" eventID:@"getd" appPSN:iTunesPSN]; NSLog(@"Debug equalizerEnabled: %i", thingy); - return thingy; + return thingy; } - (BOOL)setEqualizerEnabled:(BOOL)enabled { [[ITAppleEventCenter sharedCenter] sendAEWithSendString:[NSString stringWithFormat:@"data:long(%lu), '----':obj { form:'prop', want:type('prop'), seld:type('pEQ '), from:'null'() }",enabled] eventClass:@"core" eventID:@"setd" appPSN:iTunesPSN]; return YES; -} +} */ - (NSArray *)eqPresets { @@ -406,26 +416,4 @@ return number; } -- (void)applicationLaunched:(NSNotification *)note -{ - NSDictionary *info = [note userInfo]; - - if ([[info objectForKey:@"NSApplicationName"] isEqualToString:@"iTunes"]) { - iTunesPSN.highLongOfPSN = [[info objectForKey:@"NSApplicationProcessSerialNumberHigh"] longValue]; - iTunesPSN.lowLongOfPSN = [[info objectForKey:@"NSApplicationProcessSerialNumberLow"] longValue]; - - [[NSNotificationCenter defaultCenter] postNotificationName:@"ITMTRemoteAppDidLaunchNotification" object:nil]; - } -} - -- (void)applicationTerminated:(NSNotification *)note -{ - NSDictionary *info = [note userInfo]; - - if ([[info objectForKey:@"NSApplicationName"] isEqualToString:@"iTunes"]) { - iTunesPSN.highLongOfPSN = kNoProcess; - [[NSNotificationCenter defaultCenter] postNotificationName:@"ITMTRemoteAppDidTerminateNotification" object:nil]; - } -} - @end