so less work will be done on the iTunes remote until the MT application
uses remotes that use the new API.
//
#import <Cocoa/Cocoa.h>
//
#import <Cocoa/Cocoa.h>
+#import <ITFoundation/ITFoundation.h>
#import <ITMTRemote/ITMTRemote.h>
@interface iTunesPlayer : ITMTPlayer <ITMTPlayer> {
#import <ITMTRemote/ITMTRemote.h>
@interface iTunesPlayer : ITMTPlayer <ITMTPlayer> {
}
- (ITMTPlaylist *)currentPlaylist {
}
- (ITMTPlaylist *)currentPlaylist {
- // return dynamically from an AE
- // (ie - [iTunesPlaylist playlistForIndex:<get index from an AE>]
+ int tIndex;
+ if ( ( tIndex = [[ITAppleEventCenter sharedCenter] sendTwoTierAEWithRequestedKeyForNumber:@"pidx" fromObjectByKey:@"pPla" eventClass:@"core" eventID:@"getd" appPSN:savedPSN] ) ) {
+ return [iTunesPlaylist playlistWithIndex:tIndex];
+ } else {
+ return nil;
+ }
}
- (ITMTTrack *)currentTrack {
}
- (ITMTTrack *)currentTrack {
- // return dynamically from an AE
+ int tDIndex;
+ if ( ( tDindex = [[ITAppleEventCenter sharedCenter] sendTwoTierAEWithRequestedKeyForNumber:@"pDID" fromObjectByKey:@"pTrk" eventClass:@"core" eventID:@"getd" appPSN:savedPSN] ) ) {
+ return [iTunesTrack trackWithDatabaseIndex:tDIndex];
+ } else {
+ return nil;
+ }
}
- (ITMTEqualizer *)currentEqualizer {
}
- (ITMTEqualizer *)currentEqualizer {
#import <Foundation/Foundation.h>
#import <Foundation/Foundation.h>
-@interface iTunesPlaylist : NSObject {
-
+@interface iTunesPlaylist : ITMTPlaylist <ITMTPlaylist> {
+ int _index;
++ (id)playlistWithIndex:(int)index;
+- (id)initWithIndex:(int)index;
@implementation iTunesPlaylist
@implementation iTunesPlaylist
-+ (id)playlistForIndex:(int)index {
++ (id)playlistWithIndex:(int)index {
+ return [[[iTunesPlaylist alloc] initWithIndex:index] autorelease];
+}
+
+- (id)initWithIndex:(int)index {
+ if ( ( self = [super init] ) ) {
+ _index = index;
+ }
+ return self;
--- /dev/null
+//
+// iTunesTrack.h
+// MenuTunes
+//
+// Created by Joseph Spiros on Sat Sep 06 2003.
+// Copyright (c) 2003 __MyCompanyName__. All rights reserved.
+//
+
+#import <Foundation/Foundation.h>
+
+
+@interface iTunesTrack : ITMTTrack <ITMTTrack> {
+ int _index;
+}
++ (id)trackWithDatabaseIndex:(int)index;
+- (id)initWithDatabaseIndex:(int)index;
+@end
--- /dev/null
+//
+// iTunesTrack.m
+// MenuTunes
+//
+// Created by Joseph Spiros on Sat Sep 06 2003.
+// Copyright (c) 2003 __MyCompanyName__. All rights reserved.
+//
+
+#import "iTunesTrack.h"
+
+@implementation iTunesTrack
+
++ (id)trackWithDatabaseIndex:(int)index {
+ return [[[iTunesTrack alloc] initWithIndex:index] autorelease];
+}
+
+- (id)initWithDatabaseIndex:(int)index {
+ if ( ( self = [super init] ) ) {
+ _index = index;
+ }
+ return self;
+}
+
+@end