A couple more modifications, as well as some comments to ease others'
authorJoseph Spiros <joseph.spiros@ithinksw.com>
Sat, 6 Sep 2003 18:22:15 +0000 (18:22 +0000)
committerJoseph Spiros <joseph.spiros@ithinksw.com>
Sat, 6 Sep 2003 18:22:15 +0000 (18:22 +0000)
work on iTunes remote.

ITMTEqualizer.h
ITMTPlayer.h
ITMTPlaylist.h
ITMTTrack.h
iTunesPlayer.h
iTunesPlayer.m
iTunesPlaylist.h [new file with mode: 0755]
iTunesPlaylist.m [new file with mode: 0755]
iTunesRemote.m

index 664576c..909c61d 100755 (executable)
@@ -33,6 +33,7 @@ typedef enum {
 - (ITMTPlayer *)player;
 
 - (float)dBForLevel:(ITMTEqualizerLevel)level;
+- (BOOL)setdB:(float)dB forLevel:(ITMTEqualizerLevel)level;
 @end
 
 @interface ITMTEqualizer : NSObject 
index 3a94ace..8ae8343 100755 (executable)
     @discussion Object representation for a controlled player. Players can be defined as things that control playlist(s) objects, a pool of track objects, and possibly, equalizer objects.
 */
 @protocol ITMTPlayer
+/*!
+    @method writable
+*/
+- (BOOL)writable;
+
 /*!
     @method show
 */
index 9f2d61d..01a3f53 100755 (executable)
@@ -14,6 +14,8 @@
 #import <ITMTRemote/ITMTRemote.h>
 
 @protocol ITMTPlaylist
+- (BOOL)writable;
+
 - (BOOL)show; // graphical
 
 - (BOOL)setValue:(id)value forProperty:(ITMTGenericProperty)property;
index 2ddda6d..4f45307 100755 (executable)
@@ -14,6 +14,8 @@
 #import <ITMTRemote/ITMTRemote.h>
 
 @protocol ITMTTrack
+- (BOOL)writable;
+
 - (BOOL)addToPlaylist:(ITMTPlaylist *)playlist;
 - (BOOL)addToPlaylist:(ITMTPlaylist *)playlist atIndex:(int)index;
 
index 44f6e5e..59e0e54 100755 (executable)
@@ -10,5 +10,8 @@
 
 #import <ITMTRemote/ITMTRemote.h>
 
-@interface iTunesPlayer : ITMTPlayer <ITMTPlayer>
+@interface iTunesPlayer : ITMTPlayer <ITMTPlayer> {
+    iTunesRemote       *_remote;
+}
+
 @end
index 6a7b08b..cb6eb94 100755 (executable)
@@ -6,12 +6,73 @@
 
 static iTunesPlayer *_sharediTunesPlayer = nil;
 
-+ (id)sharedPlayer {
++ (id)sharedPlayerForRemote:(iTunesRemote *)remote {
     if ( _sharediTunesPlayer ) {
+        _remote = remote;
         return _sharediTunesPlayer;
     } else {
+        _remote = remote;
         return _sharediTunesPlayer = [[iTunesPlayer alloc] init];
     }
 }
 
+- (BOOL)writable {
+    return NO;
+}
+
+- (BOOL)show {
+    return NO;
+}
+
+- (BOOL)setValue:(id)value forProperty:(ITMTGenericProperty)property {
+    return NO;
+}
+
+- (id)valueOfProperty:(ITMTGenericProperty)property {
+    if ( ( property == ITMTNameProperty ) {
+        return @"iTunes";
+    } else if ( ( property == ITMTImageProperty ) {
+        return nil;
+    } else {
+        return nil;
+    }
+}
+
+- (NSDictionary *)propertiesAndValues {
+    return [NSDictionary dictionaryWithObjectsAndKeys:@"iTunes",@"ITMTNameProperty",nil,@"ITMTImageProperty"];
+}
+
+- (ITMTRemote *)remote {
+    return _remote;
+}
+
+- (ITMTPlaylist *)currentPlaylist {
+    // return dynamically from an AE
+    // (ie - [iTunesPlaylist playlistForIndex:<get index from an AE>]
+}
+
+- (ITMTTrack *)currentTrack {
+    // return dynamically from an AE
+}
+
+- (ITMTEqualizer *)currentEqualizer {
+    // return dynamically from an AE
+}
+
+- (NSArray *)playlists {
+    // return dynamically from an AE
+}
+
+- (NSArray *)tracks {
+    // return dynamically from an AE
+}
+
+- (ITMTPlaylist *)libraryPlaylist {
+    // return dynamically from an AE
+}
+
+- (NSArray *)equalizers {
+    // return dynamically from an AE
+}
+
 @end
diff --git a/iTunesPlaylist.h b/iTunesPlaylist.h
new file mode 100755 (executable)
index 0000000..0a0d515
--- /dev/null
@@ -0,0 +1,16 @@
+//
+//  iTunesPlaylist.h
+//  MenuTunes
+//
+//  Created by Joseph Spiros on Sat Sep 06 2003.
+//  Copyright (c) 2003 __MyCompanyName__. All rights reserved.
+//
+
+#import <Foundation/Foundation.h>
+
+
+@interface iTunesPlaylist : NSObject {
+
+}
+
+@end
diff --git a/iTunesPlaylist.m b/iTunesPlaylist.m
new file mode 100755 (executable)
index 0000000..f571ba7
--- /dev/null
@@ -0,0 +1,17 @@
+//
+//  iTunesPlaylist.m
+//  MenuTunes
+//
+//  Created by Joseph Spiros on Sat Sep 06 2003.
+//  Copyright (c) 2003 __MyCompanyName__. All rights reserved.
+//
+
+#import "iTunesPlaylist.h"
+
+
+@implementation iTunesPlaylist
+
++ (id)playlistForIndex:(int)index {
+}
+
+@end
index bb9e464..5781211 100755 (executable)
@@ -34,7 +34,7 @@
                 return NO;
             }
         }
-        if ( ( _player = [iTunesPlayer sharedPlayer] ) ) {
+        if ( ( _player = [iTunesPlayer sharedPlayerForRemote:self] ) ) {
             _activated = YES;
             return YES;
         }