From 74d6135e4db4cf9a70994d5bc2062be30311d0f3 Mon Sep 17 00:00:00 2001 From: Joseph Spiros Date: Sun, 9 Mar 2003 07:26:45 +0000 Subject: [PATCH] Some Plugin API changes... Need to finish the API HeaderDocs sometime after MT 1.0 release... Also, volume and rating stuff needs to be implemented into the iTunesRemote --- ITMTRemote.h | 20 ++++++++++++++++---- ITMTRemote.m | 18 ++++++++++++++---- MenuTunes.m | 4 ++-- iTunesRemote.m | 20 +++++++++++++++----- 4 files changed, 47 insertions(+), 15 deletions(-) diff --git a/ITMTRemote.h b/ITMTRemote.h index b20eaee..693d908 100755 --- a/ITMTRemote.h +++ b/ITMTRemote.h @@ -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; diff --git a/ITMTRemote.m b/ITMTRemote.m index 7b6742c..78922f4 100755 --- a/ITMTRemote.m +++ b/ITMTRemote.m @@ -38,7 +38,7 @@ return NO; } -- (PlayerState)playerState +- (ITMTRemotePlayerState)playerState { return stopped; } @@ -103,12 +103,22 @@ 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; } diff --git a/MenuTunes.m b/MenuTunes.m index 7c5e543..7fa1d43 100755 --- a/MenuTunes.m +++ b/MenuTunes.m @@ -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]; diff --git a/iTunesRemote.m b/iTunesRemote.m index a66105f..e479c63 100755 --- a/iTunesRemote.m +++ b/iTunesRemote.m @@ -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]; @@ -166,12 +166,22 @@ 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; } -- 2.20.1