Some Plugin API changes... Need to finish the API HeaderDocs sometime
authorJoseph Spiros <joseph.spiros@ithinksw.com>
Sun, 9 Mar 2003 07:26:45 +0000 (07:26 +0000)
committerJoseph Spiros <joseph.spiros@ithinksw.com>
Sun, 9 Mar 2003 07:26:45 +0000 (07:26 +0000)
after MT 1.0 release... Also, volume and rating stuff needs to be
implemented into the iTunesRemote

ITMTRemote.h
ITMTRemote.m
MenuTunes.m
iTunesRemote.m

index b20eaee..693d908 100755 (executable)
@@ -34,7 +34,7 @@ typedef enum {
     playing,
     rewinding,
     forwarding
-} PlayerState;
+} ITMTRemotePlayerState;
 
 /*! @protocol ITMTRemote
  *  @abstract Declares what a MenuTunes Remote must be able to do.
@@ -85,8 +85,17 @@ typedef enum {
  */
 - (BOOL)halt;
 
+/*! @method isAppRunning:
+ *  @abstract Returns controlled application's running status (is or isn't running).
+ *  @result BOOL of the controlled application's running status.
+ */
 - (BOOL)isAppRunning;
-- (PlayerState)playerState;
+
+/*! @method playerState:
+ *  @abstract Returns controlled application's playing state.
+ *  @result ITMTRemotePlayerState of the controlled application's playing state.
+ */
+- (ITMTRemotePlayerState)playerState;
 
 - (NSArray *)playlists;
 - (int)numberOfSongsInPlaylistAtIndex:(int)index;
@@ -103,12 +112,15 @@ typedef enum {
 - (NSString *)currentSongLength;
 - (NSString *)currentSongRemaining;
 
-- (int)currentSongRating;
-- (BOOL)setCurrentSongRating:(int)rating;
+- (float)currentSongRating;
+- (BOOL)setCurrentSongRating:(float)rating;
 
 - (NSArray *)eqPresets;
 - (int)currentEQPresetIndex;
 
+- (float)volume;
+- (BOOL)setVolume:(float)volume;
+
 - (BOOL)play;
 - (BOOL)pause;
 - (BOOL)goToNextSong;
index 7b6742c..78922f4 100755 (executable)
@@ -38,7 +38,7 @@
     return NO;
 }
 
-- (PlayerState)playerState
+- (ITMTRemotePlayerState)playerState
 {
     return stopped;
 }
     return nil;
 }
 
-- (int)currentSongRating
+- (float)currentSongRating
 {
-    return 0;
+    return 0.00;
+}
+
+- (BOOL)setCurrentSongRating:(float)rating
+{
+    return NO;
+}
+
+- (float)volume
+{
+    return 1.00;
 }
 
-- (BOOL)setCurrentSongRating:(int)rating
+- (BOOL)setVolume:(float)volume
 {
     return NO;
 }
index 7c5e543..7fa1d43 100755 (executable)
@@ -594,7 +594,7 @@ Things to do:
 - (void)timerUpdate
 {
     int playlist = [currentRemote currentPlaylistIndex];
-    PlayerState playerState = [currentRemote playerState];
+    ITMTRemotePlayerState playerState = [currentRemote playerState];
     
     if ((playlist > 0) || playerState != stopped) {
         int trackPlayingIndex = [currentRemote currentSongIndex];
@@ -731,7 +731,7 @@ Things to do:
 
 - (void)playPause:(id)sender
 {
-    PlayerState state = [currentRemote playerState];
+    ITMTRemotePlayerState state = [currentRemote playerState];
     
     if (state == playing) {
         [currentRemote pause];
index a66105f..e479c63 100755 (executable)
@@ -9,7 +9,7 @@
 
 - (NSString *)title
 {
-    return @"iTunes Plug-in";
+    return @"iTunes";
 }
 
 - (NSString *)information;
@@ -58,7 +58,7 @@
     return NO;
 }
 
-- (PlayerState)playerState
+- (ITMTRemotePlayerState)playerState
 {
     long result = [[ITAppleEventCenter sharedCenter] sendAEWithSendStringForNumber:@"'----':obj { form:'prop', want:type('prop'), seld:type('pPlS'), from:'null'() }" eventClass:@"core" eventID:@"getd" appPSN:iTunesPSN];
     
     return [[NSNumber numberWithLong:duration - current] stringValue];
 }
 
-- (int)currentSongRating
+- (float)currentSongRating
 {
-    return 0;
+    return 0.00;
 }
 
-- (BOOL)setCurrentSongRating:(int)rating
+- (BOOL)setCurrentSongRating:(float)rating
+{
+    return NO;
+}
+
+- (float)volume
+{
+    return 1.00;
+}
+
+- (BOOL)setVolume:(float)volume
 {
     return NO;
 }