4 * Plugin definition for audio player control via MenuTunes
6 * Original Author : Matt Judy <mjudy@ithinksw.com>
7 * Responsibility : Matt Judy <mjudy@ithinksw.com>
9 * Copyright (c) 2002 - 2003 iThink Software.
12 * This header defines the Objective-C protocol which all MenuTunes Remote
13 * plugins must implement. To build a remote, create a subclass of this
14 * object, and implement each method in the @protocol below.
20 * @discussion This header defines the Objective-C protocol which all MenuTunes Remote plugins must implement. To build a remote, create a subclass of the ITMTRemote object, and implement each method in the ITMTRemote protocol.
22 #import <Cocoa/Cocoa.h>
25 @enum ITMTRemotePlayerRunningState
26 @abstract Possible running states for the remote's player.
27 @discussion Used in fuctions that report or take the running state of the remote's player application.
28 @constant ITMTRemotePlayerNotRunning The remote's player isn't running.
29 @constant ITMTRemotePlayerLaunching The remote's player is starting up, or is running, but not yet accepting remote commands.
30 @constant ITMTRemotePlayerRunning The remote's player is running, and as such, is accepting remote commands.
33 ITMTRemotePlayerNotRunning = -1,
34 ITMTRemotePlayerLaunching,
35 ITMTRemotePlayerRunning
36 } ITMTRemotePlayerRunningState;
39 @enum ITMTRemotePlayerPlayingState
40 @abstract Possible playing states for the remote's player.
41 @discussion Used in functions that report or take the playing state of the remote's player application.
42 @constant ITMTRemotePlayerStopped The remote's player is stopped.
43 @constant ITMTRemotePlayerPaused The remote's player is paused.
44 @constant ITMTRemotePlayerPlaying The remote's player is playing.
45 @constant ITMTRemotePlayerRewinding The remote's player is rewinding.
46 @constant ITMTRemotePlayerForwarding The remote's player is forwarding.
49 ITMTRemotePlayerStopped = -1,
50 ITMTRemotePlayerPaused,
51 ITMTRemotePlayerPlaying,
52 ITMTRemotePlayerRewinding,
53 ITMTRemotePlayerForwarding
54 } ITMTRemotePlayerPlayingState;
57 * @protocol ITMTRemote
58 * @discussion The Objective-C protocol which all MenuTunes remotes must implement.
64 * @abstract Returns an autoreleased instance of the remote.
65 * @discussion Should be very quick and compact.
70 * return [[[MyRemote alloc] init] autorelease];<br>
73 * @result An instance of the remote.
79 * @abstract Returns the remote's title/name.
80 * @discussion This title is shown while the user is selecting which remote to use. This is for informational purposes only.
81 * @result An NSString containing the title/name of the remote.
83 - (NSString *)remoteTitle;
86 * @method remoteInformation
87 * @abstract Returns the remote's information.
88 * @discussion Information on the remote that the user will see when selecting which remote to use. The information returned here has no bearing on how the remote works, it's simply here for informing the user.
89 * @result An NSString containing the information for the remote.
91 - (NSString *)remoteInformation;
95 * @abstract Returns the remote's icon.
96 * @discussion This icon is shown while the user is selecting which remote to use. Typically, this is the remote's player's application icon, however it can be anything you like.
97 * @result An NSImage containing the icon of the remote.
99 - (NSImage *)remoteIcon;
103 * @abstract Sent when the remote should begin operation.
104 * @result A result code signifying success.
110 * @abstract Sent when the remote should cease operation.
111 * @result A result code signifying success.
116 * @method playerFullName
117 * @abstract Returns the remote's player's application filename.
118 * @discussion This string should be the name typically used by the remote's player's application bundle/file. For example, Panic's Audion audio player is known simply as "Audion", however, the application bundle is called "Audion 3" for version 3 of their application. This should return "Audion 3", not simply "Audion". See playerSimpleName.
119 * @result An NSString containing the remote's player's application filename
121 - (NSString *)playerFullName;
124 * @method playerSimpleName
125 * @abstract Returns the simplified name of the remote's player.
126 * @discussion This is the name used in the User Interface for when referring to the remote's player. Continuing the example from the playerFullName method, this method would return simply "Audion", as that is how the player is known.
127 * @result An NSString containing the simplified name of the remote's player.
129 - (NSString *)playerSimpleName;
132 * @method capabilities
133 * @abstract Returns a dictionary defining the capabilities of the remote and it's player.
134 * @discussion Discussion Forthcoming.
135 * @result An NSDictionary defining the capabilities of the remote and it's player.
137 - (NSDictionary *)capabilities;
140 * @method playerRunningState
141 * @abstract Returns the running state of the remote's player.
142 * @discussion While most remotes will use only ITMTRemotePlayerNotRunning or ITMTRemotePlayerRunning, we have included support for ITMTRemotePlayerLaunching (see ITMTRemotePlayerRunningState) for remotes that want the most precise control over their player's process managment.
143 * @result An ITMTRemotePlayerRunningState defining the running state of the remote's player.
145 - (ITMTRemotePlayerRunningState)playerRunningState;
148 * @method playerPlayingState
150 - (ITMTRemotePlayerPlayingState)playerPlayingState;
155 - (NSArray *)playlists;
158 * @method numberOfSongsInPlaylistAtIndex:
160 - (int)numberOfSongsInPlaylistAtIndex:(int)index;
163 * @method classOfPlaylistAtIndex:
165 - (NSString *)classOfPlaylistAtIndex:(int)index;
168 * @method currentPlaylistIndex
170 - (int)currentPlaylistIndex;
173 * @method songTitleAtIndex:
175 - (NSString *)songTitleAtIndex:(int)index;
178 * @method currentSongIndex
180 - (int)currentSongIndex;
183 * @method currentSongTitle
185 - (NSString *)currentSongTitle;
188 * @method currentSongArtist
190 - (NSString *)currentSongArtist;
193 * @method currentSongAlbum
195 - (NSString *)currentSongAlbum;
198 * @method currentSongGenre
200 - (NSString *)currentSongGenre;
203 * @method currentSongLength
205 - (NSString *)currentSongLength;
208 * @method currentSongRemaining
210 - (NSString *)currentSongRemaining;
213 * @method currentSongRating
215 - (float)currentSongRating;
218 * @method setCurrentSongRating:
220 - (BOOL)setCurrentSongRating:(float)rating;
223 * @method equalizerEnabled
225 - (BOOL)equalizerEnabled;
228 * @method setEqualizerEnabled:
230 - (BOOL)setEqualizerEnabled:(BOOL)enabled;
235 - (NSArray *)eqPresets;
238 * @method currentEQPresetIndex
240 - (int)currentEQPresetIndex;
250 - (BOOL)setVolume:(float)volume;
263 * @method goToNextSong
265 - (BOOL)goToNextSong;
268 * @method goToPreviousSong
270 - (BOOL)goToPreviousSong;
283 * @method switchToPlaylistAtIndex:
285 - (BOOL)switchToPlaylistAtIndex:(int)index;
288 * @method switchToSongAtIndex:
290 - (BOOL)switchToSongAtIndex:(int)index;
293 * @method switchToEQAtIndex:
295 - (BOOL)switchToEQAtIndex:(int)index;
302 @interface ITMTRemote : NSObject <ITMTRemote>