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 ITMTRemotePlayerPlaylist.
60 * @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.
61 * @constant ITMTRemotePlayerPlaylist The generic playlist. Created and maintained by the user.
62 * @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.
63 * @constant ITMTRemotePlayerRadioPlaylist This is for when playing tracks off of (online) radio stations.
66 ITMTRemotePlayerLibraryPlaylist = -1,
67 ITMTRemotePlayerPlaylist,
68 ITMTRemotePlayerSmartPlaylist,
69 ITMTRemotePlayerRadioPlaylist
70 } ITMTRemotePlayerPlaylistClass;
73 * @enum ITMTRemotePlayerRepeatMode
74 * @abstract Possible repeat modes for the remote's player.
75 * @discussion Used in functions that report or set the remote's player's repeat mode.
76 * @constant ITMTRemotePlayerRepeatOff The player plays all of the songs in a playlist through to the end, and then stops.
77 * @constant ITMTRemotePlayerRepeatAll The player plays all of the songs in a playlist through to the end, and then starts over again from the beginning.
78 * @constant ITMTRemotePlayerRepeatOne The player loops playing the selected song.
81 ITMTRemotePlayerRepeatOff = -1,
82 ITMTRemotePlayerRepeatAll,
83 ITMTRemotePlayerRepeatOne
84 } ITMTRemotePlayerRepeatMode;
87 * @protocol ITMTRemote
88 * @discussion The Objective-C protocol which all MenuTunes remotes must implement.
94 * @abstract Returns an autoreleased instance of the remote.
95 * @discussion Should be very quick and compact.
100 * return [[[MyRemote alloc] init] autorelease];<br>
103 * @result An instance of the remote.
108 * @method remoteTitle
109 * @abstract Returns the remote's title/name.
110 * @discussion This title is shown while the user is selecting which remote to use. This is for informational purposes only.
111 * @result An NSString containing the title/name of the remote.
113 - (NSString *)remoteTitle;
116 * @method remoteInformation
117 * @abstract Returns the remote's information.
118 * @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.
119 * @result An NSString containing the information for the remote.
121 - (NSString *)remoteInformation;
125 * @abstract Returns the remote's icon.
126 * @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.
127 * @result An NSImage containing the icon of the remote.
129 - (NSImage *)remoteIcon;
133 * @abstract Sent when the remote should begin operation.
134 * @result A result code signifying success.
140 * @abstract Sent when the remote should cease operation.
141 * @result A result code signifying success.
146 * @method playerFullName
147 * @abstract Returns the remote's player's application filename.
148 * @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.
149 * @result An NSString containing the remote's player's application filename
151 - (NSString *)playerFullName;
154 * @method playerSimpleName
155 * @abstract Returns the simplified name of the remote's player.
156 * @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.
157 * @result An NSString containing the simplified name of the remote's player.
159 - (NSString *)playerSimpleName;
162 * @method capabilities
163 * @abstract Returns a dictionary defining the capabilities of the remote and it's player.
164 * @discussion Discussion Forthcoming.
165 * @result An NSDictionary defining the capabilities of the remote and it's player.
167 - (NSDictionary *)capabilities;
170 * @method showPrimaryInterface
172 - (BOOL)showPrimaryInterface;
175 * @method playerRunningState
176 * @abstract Returns the running state of the remote's player.
177 * @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.
178 * @result An ITMTRemotePlayerRunningState defining the running state of the remote's player.
180 - (ITMTRemotePlayerRunningState)playerRunningState;
183 * @method playerPlayingState
185 - (ITMTRemotePlayerPlayingState)playerPlayingState;
190 - (NSArray *)playlists;
193 * @method numberOfSongsInPlaylistAtIndex:
195 - (int)numberOfSongsInPlaylistAtIndex:(int)index;
198 * @method currentPlaylistClass
200 - (ITMTRemotePlayerPlaylistClass)currentPlaylistClass;
203 * @method currentPlaylistIndex
205 - (int)currentPlaylistIndex;
208 * @method songTitleAtIndex:
210 - (NSString *)songTitleAtIndex:(int)index;
213 * @method currentAlbumTrackCount:
215 - (int)currentAlbumTrackCount;
218 * @method currentSongTrack:
220 - (int)currentSongTrack;
223 * @method playerStateUniqueIdentifier:
225 - (NSString *)playerStateUniqueIdentifier;
228 * @method currentSongIndex
230 - (int)currentSongIndex;
233 * @method currentSongTitle
235 - (NSString *)currentSongTitle;
238 * @method currentSongArtist
240 - (NSString *)currentSongArtist;
243 * @method currentSongAlbum
245 - (NSString *)currentSongAlbum;
248 * @method currentSongGenre
250 - (NSString *)currentSongGenre;
253 * @method currentSongLength
255 - (NSString *)currentSongLength;
258 * @method currentSongRemaining
260 - (NSString *)currentSongRemaining;
263 * @method currentSongRating
265 - (float)currentSongRating;
268 * @method setCurrentSongRating:
270 - (BOOL)setCurrentSongRating:(float)rating;
275 - (NSArray *)eqPresets;
278 * @method currentEQPresetIndex
280 - (int)currentEQPresetIndex;
290 - (BOOL)setVolume:(float)volume;
293 * @method shuffleEnabled
295 - (BOOL)shuffleEnabled;
298 * @method setShuffleEnabled:
300 - (BOOL)setShuffleEnabled:(BOOL)enabled;
305 - (ITMTRemotePlayerRepeatMode)repeatMode;
308 * @method setRepeatMode:
310 - (BOOL)setRepeatMode:(ITMTRemotePlayerRepeatMode)repeatMode;
323 * @method goToNextSong
325 - (BOOL)goToNextSong;
328 * @method goToPreviousSong
330 - (BOOL)goToPreviousSong;
343 * @method switchToPlaylistAtIndex:
345 - (BOOL)switchToPlaylistAtIndex:(int)index;
348 * @method switchToSongAtIndex:
350 - (BOOL)switchToSongAtIndex:(int)index;
353 * @method switchToEQAtIndex:
355 - (BOOL)switchToEQAtIndex:(int)index;
362 @interface ITMTRemote : NSObject <ITMTRemote>