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 * @enum ITMTRemotePlayerPlaylistClass
58 * @abstract Possible playlist classes used by a remote's player
59 * @discussion Used in functions that report the class of a playlist to MenuTunes. While we borrow the terms/descriptions from iTunes, these should work fine with any other player. If your player doesn't support a given type of playlist, then just return
61 ITMTRemotePlayerPlaylist.
62 * @constant ITMTRemotePlayerLibraryPlaylist For players that have one playlist that contains all of a user's music, or for players that don't have the concept of multiple playlists, this is the class for that "Master" list.
63 * @constant ITMTRemotePlayerPlaylist The generic playlist. Created and maintained by the user.
64 * @constant ITMTRemotePlayerSmartPlaylist A smart playlist is a playlist who's contents are dynamic, based on a set of criteria or updated by a script. These are usually not edited directly by the user, but instead maintained by the player.
65 * @constant ITMTRemotePlayerRadioPlaylist This is for when playing tracks off of (online) radio stations.
68 ITMTRemotePlayerLibraryPlaylist = -1,
69 ITMTRemotePlayerPlaylist,
70 ITMTRemotePlayerSmartPlaylist,
71 ITMTRemotePlayerRadioPlaylist
72 } ITMTRemotePlayerPlaylistClass;
75 ITMTRemoteLibrarySource = -1,
77 ITMTRemoteRadioSource,
79 ITMTRemoteGenericDeviceSource,
80 ITMTRemoteSharedLibrarySource
81 } ITMTRemotePlayerSource;
84 * @enum ITMTRemotePlayerRepeatMode
85 * @abstract Possible repeat modes for the remote's player.
86 * @discussion Used in functions that report or set the remote's player's repeat mode.
87 * @constant ITMTRemotePlayerRepeatOff The player plays all of the songs in a playlist through to the end, and then stops.
88 * @constant ITMTRemotePlayerRepeatAll The player plays all of the songs in a playlist through to the end, and then starts over again from the beginning.
89 * @constant ITMTRemotePlayerRepeatOne The player loops playing the selected song.
92 ITMTRemotePlayerRepeatOff = -1,
93 ITMTRemotePlayerRepeatAll,
94 ITMTRemotePlayerRepeatOne
95 } ITMTRemotePlayerRepeatMode;
98 * @protocol ITMTRemote
99 * @discussion The Objective-C protocol which all MenuTunes remotes must implement.
105 * @abstract Returns an autoreleased instance of the remote.
106 * @discussion Should be very quick and compact.
111 * return [[[MyRemote alloc] init] autorelease];<br>
114 * @result An instance of the remote.
119 * @method remoteTitle
120 * @abstract Returns the remote's title/name.
121 * @discussion This title is shown while the user is selecting which remote to use. This is for informational purposes only.
122 * @result An NSString containing the title/name of the remote.
124 - (NSString *)remoteTitle;
127 * @method remoteInformation
128 * @abstract Returns the remote's information.
129 * @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.
130 * @result An NSString containing the information for the remote.
132 - (NSString *)remoteInformation;
136 * @abstract Returns the remote's icon.
137 * @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.
138 * @result An NSImage containing the icon of the remote.
140 - (NSImage *)remoteIcon;
144 * @abstract Sent when the remote should begin operation.
145 * @result A result code signifying success.
151 * @abstract Sent when the remote should cease operation.
152 * @result A result code signifying success.
157 * @method playerFullName
158 * @abstract Returns the remote's player's application filename.
159 * @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 thei
161 r application. This should return "Audion 3", not simply "Audion". See playerSimpleName.
162 * @result An NSString containing the remote's player's application filename
164 - (NSString *)playerFullName;
167 * @method playerSimpleName
168 * @abstract Returns the simplified name of the remote's player.
169 * @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.
170 * @result An NSString containing the simplified name of the remote's player.
172 - (NSString *)playerSimpleName;
175 * @method capabilities
176 * @abstract Returns a dictionary defining the capabilities of the remote and it's player.
177 * @discussion Discussion Forthcoming.
178 * @result An NSDictionary defining the capabilities of the remote and it's player.
180 - (NSDictionary *)capabilities;
183 * @method showPrimaryInterface
185 - (BOOL)showPrimaryInterface;
188 * @method playerRunningState
189 * @abstract Returns the running state of the remote's player.
190 * @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 play
192 er's process managment.
193 * @result An ITMTRemotePlayerRunningState defining the running state of the remote's player.
195 - (ITMTRemotePlayerRunningState)playerRunningState;
198 * @method playerPlayingState
200 - (ITMTRemotePlayerPlayingState)playerPlayingState;
205 - (NSArray *)playlists;
208 * @method numberOfSongsInPlaylistAtIndex:
210 - (int)numberOfSongsInPlaylistAtIndex:(int)index;
213 * @method currentSource
215 - (ITMTRemotePlayerSource)currentSource;
218 * @method currentPlaylistClass
220 - (ITMTRemotePlayerPlaylistClass)currentPlaylistClass;
223 * @method currentPlaylistIndex
225 - (int)currentPlaylistIndex;
228 * @method songTitleAtIndex:
230 - (NSString *)songTitleAtIndex:(int)index;
233 * @method currentAlbumTrackCount:
235 - (int)currentAlbumTrackCount;
238 * @method currentSongTrack:
240 - (int)currentSongTrack;
243 * @method playerStateUniqueIdentifier:
245 - (NSString *)playerStateUniqueIdentifier;
248 * @method currentSongIndex
250 - (int)currentSongIndex;
253 * @method currentSongTitle
255 - (NSString *)currentSongTitle;
258 * @method currentSongArtist
260 - (NSString *)currentSongArtist;
263 * @method currentSongAlbum
265 - (NSString *)currentSongAlbum;
268 * @method currentSongGenre
270 - (NSString *)currentSongGenre;
273 * @method currentSongLength
275 - (NSString *)currentSongLength;
278 * @method currentSongRemaining
280 - (NSString *)currentSongRemaining;
283 * @method currentSongElapsed
285 - (NSString *)currentSongElapsed;
288 * @method currentSongAlbumArt
290 - (NSImage *)currentSongAlbumArt;
293 * @method currentSongRating
295 - (float)currentSongRating;
298 * @method setCurrentSongRating:
300 - (BOOL)setCurrentSongRating:(float)rating;
305 - (NSArray *)eqPresets;
308 * @method currentEQPresetIndex
310 - (int)currentEQPresetIndex;
320 - (BOOL)setVolume:(float)volume;
323 * @method shuffleEnabled
325 - (BOOL)shuffleEnabled;
328 * @method setShuffleEnabled:
330 - (BOOL)setShuffleEnabled:(BOOL)enabled;
335 - (ITMTRemotePlayerRepeatMode)repeatMode;
338 * @method setRepeatMode:
340 - (BOOL)setRepeatMode:(ITMTRemotePlayerRepeatMode)repeatMode;
353 * @method goToNextSong
355 - (BOOL)goToNextSong;
358 * @method goToPreviousSong
360 - (BOOL)goToPreviousSong;
373 * @method switchToPlaylistAtIndex:
375 - (BOOL)switchToPlaylistAtIndex:(int)index;
378 * @method switchToSongAtIndex:
380 - (BOOL)switchToSongAtIndex:(int)index;
383 * @method switchToEQAtIndex:
385 - (BOOL)switchToEQAtIndex:(int)index;
392 @interface ITMTRemote : NSObject <ITMTRemote>