Quick Remote API update for an enumeration of all supported playlist classes.
[MenuTunes.git] / ITMTRemote.h
1 /*
2  *  MenuTunes
3  *  ITMTRemote
4  *    Plugin definition for audio player control via MenuTunes
5  *
6  *  Original Author : Matt Judy <mjudy@ithinksw.com>
7  *   Responsibility : Matt Judy <mjudy@ithinksw.com>
8  *
9  *  Copyright (c) 2002 - 2003 iThink Software.
10  *  All Rights Reserved
11  *
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.
15  *
16  */
17
18 /*!
19  * @header ITMTRemote
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.
21  */
22 #import <Cocoa/Cocoa.h>
23
24 /*!
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.
31  */
32 typedef enum {
33     ITMTRemotePlayerNotRunning = -1,
34     ITMTRemotePlayerLaunching,
35     ITMTRemotePlayerRunning
36 } ITMTRemotePlayerRunningState;
37
38 /*!
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.
47  */
48 typedef enum {
49     ITMTRemotePlayerStopped = -1,
50     ITMTRemotePlayerPaused,
51     ITMTRemotePlayerPlaying,
52     ITMTRemotePlayerRewinding,
53     ITMTRemotePlayerForwarding
54 } ITMTRemotePlayerPlayingState;
55
56 /*!
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.
64  */
65 typedef enum {
66     ITMTRemotePlayerLibraryPlaylist = -1,
67     ITMTRemotePlayerPlaylist,
68     ITMTRemotePlayerSmartPlaylist,
69     ITMTRemotePlayerRadioPlaylist
70 } ITMTRemotePlayerPlaylistClass;
71
72 /*!
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.
79  */
80 typedef enum {
81     ITMTRemotePlayerRepeatOff = -1,
82     ITMTRemotePlayerRepeatAll,
83     ITMTRemotePlayerRepeatOne
84 } ITMTRemotePlayerRepeatMode;
85
86 /*!
87  * @protocol ITMTRemote
88  * @discussion The Objective-C protocol which all MenuTunes remotes must implement.
89  */
90 @protocol ITMTRemote
91
92 /*!
93  * @method remote
94  * @abstract Returns an autoreleased instance of the remote.
95  * @discussion Should be very quick and compact.
96  *
97  * EXAMPLE:<br>
98  * + (id)remote<br>
99  * {<br>
100  * &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;return [[[MyRemote alloc] init] autorelease];<br>
101  * }
102  *
103  * @result An instance of the remote.
104  */
105 + (id)remote;
106
107 /*!
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.
112  */
113 - (NSString *)remoteTitle;
114
115 /*!
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.
120  */
121 - (NSString *)remoteInformation;
122
123 /*!
124  * @method remoteIcon
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.
128  */
129 - (NSImage *)remoteIcon;
130
131 /*!
132  * @method begin
133  * @abstract Sent when the remote should begin operation.
134  * @result A result code signifying success.
135  */
136 - (BOOL)begin;
137
138 /*!
139  * @method halt
140  * @abstract Sent when the remote should cease operation.
141  * @result A result code signifying success.
142  */
143 - (BOOL)halt;
144
145 /*!
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
150  */
151 - (NSString *)playerFullName;
152
153 /*!
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.
158  */
159 - (NSString *)playerSimpleName;
160
161 /*!
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.
166  */
167 - (NSDictionary *)capabilities;
168
169 /*!
170  * @method playerRunningState
171  * @abstract Returns the running state of the remote's player.
172  * @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.
173  * @result An ITMTRemotePlayerRunningState defining the running state of the remote's player.
174  */
175 - (ITMTRemotePlayerRunningState)playerRunningState;
176
177 /*!
178  * @method playerPlayingState
179  */
180 - (ITMTRemotePlayerPlayingState)playerPlayingState;
181
182 /*!
183  * @method playlists
184  */
185 - (NSArray *)playlists;
186
187 /*!
188  * @method numberOfSongsInPlaylistAtIndex:
189  */
190 - (int)numberOfSongsInPlaylistAtIndex:(int)index;
191
192 /*!
193  * @method classOfPlaylistAtIndex:
194  */
195 - (ITMTRemotePlayerPlaylistClass)classOfPlaylistAtIndex:(int)index;
196
197 /*!
198  * @method currentPlaylistIndex
199  */
200 - (int)currentPlaylistIndex;
201
202 /*!
203  * @method songTitleAtIndex:
204  */
205 - (NSString *)songTitleAtIndex:(int)index;
206
207 /*!
208  * @method currentSongIndex
209  */
210 - (int)currentSongIndex;
211
212 /*!
213  * @method currentSongTitle
214  */
215 - (NSString *)currentSongTitle;
216
217 /*!
218  * @method currentSongArtist
219  */
220 - (NSString *)currentSongArtist;
221
222 /*!
223  * @method currentSongAlbum
224  */
225 - (NSString *)currentSongAlbum;
226
227 /*!
228  * @method currentSongGenre
229  */
230 - (NSString *)currentSongGenre;
231
232 /*!
233  * @method currentSongLength
234  */
235 - (NSString *)currentSongLength;
236
237 /*!
238  * @method currentSongRemaining
239  */
240 - (NSString *)currentSongRemaining;
241
242 /*!
243  * @method currentSongRating
244  */
245 - (float)currentSongRating;
246
247 /*!
248  * @method setCurrentSongRating:
249  */
250 - (BOOL)setCurrentSongRating:(float)rating;
251
252 /*!
253  * @method equalizerEnabled
254  */
255 - (BOOL)equalizerEnabled;
256
257 /*!
258  * @method setEqualizerEnabled:
259  */
260 - (BOOL)setEqualizerEnabled:(BOOL)enabled;
261
262 /*!
263  * @method eqPresets
264  */
265 - (NSArray *)eqPresets;
266
267 /*!
268  * @method currentEQPresetIndex
269  */
270 - (int)currentEQPresetIndex;
271
272 /*!
273  * @method volume
274  */
275 - (float)volume;
276
277 /*!
278  * @method setVolume:
279  */
280 - (BOOL)setVolume:(float)volume;
281
282 /*!
283  * @method shuffleEnabled
284  */
285 - (BOOL)shuffleEnabled;
286
287 /*!
288  * @method setShuffleEnabled:
289  */
290 - (BOOL)setShuffleEnabled:(BOOL)enabled;
291
292 /*!
293  * @method repeatMode
294  */
295 - (ITMTRemotePlayerRepeatMode)repeatMode;
296
297 /*!
298  * @method setRepeatMode:
299  */
300 - (BOOL)setRepeatMode:(ITMTRemotePlayerRepeatMode)repeatMode;
301
302 /*!
303  * @method play
304  */
305 - (BOOL)play;
306
307 /*!
308  * @method pause
309  */
310 - (BOOL)pause;
311
312 /*!
313  * @method goToNextSong
314  */
315 - (BOOL)goToNextSong;
316
317 /*!
318  * @method goToPreviousSong
319  */
320 - (BOOL)goToPreviousSong;
321
322 /*!
323  * @method forward
324  */
325 - (BOOL)forward;
326
327 /*!
328  * @method rewind
329  */
330 - (BOOL)rewind;
331
332 /*!
333  * @method switchToPlaylistAtIndex:
334  */
335 - (BOOL)switchToPlaylistAtIndex:(int)index;
336
337 /*!
338  * @method switchToSongAtIndex:
339  */
340 - (BOOL)switchToSongAtIndex:(int)index;
341
342 /*!
343  * @method switchToEQAtIndex:
344  */
345 - (BOOL)switchToEQAtIndex:(int)index;
346
347 @end
348
349 /*!
350  * @class ITMTRemote
351  */
352 @interface ITMTRemote : NSObject <ITMTRemote>
353
354 @end