Adding ITMTRemoteSharedLibrarySource
[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 
60 ITMTRemotePlayerPlaylist.
61  * @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.
62  * @constant ITMTRemotePlayerPlaylist The generic playlist. Created and maintained by the user.
63  * @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.
64  * @constant ITMTRemotePlayerRadioPlaylist This is for when playing tracks off of (online) radio stations.
65  */
66 typedef enum {
67     ITMTRemotePlayerLibraryPlaylist = -1,
68     ITMTRemotePlayerPlaylist,
69     ITMTRemotePlayerSmartPlaylist,
70     ITMTRemotePlayerRadioPlaylist
71 } ITMTRemotePlayerPlaylistClass;
72
73 typedef enum {
74     ITMTRemoteLibrarySource = -1,
75     ITMTRemoteCDSource,
76     ITMTRemoteRadioSource,
77     ITMTRemoteiPodSource,
78     ITMTRemoteMP3PlayerSource,
79     ITMTRemoteSharedLibrarySource
80 } ITMTRemotePlayerSource;
81
82 /*!
83  * @enum ITMTRemotePlayerRepeatMode
84  * @abstract Possible repeat modes for the remote's player.
85  * @discussion Used in functions that report or set the remote's player's repeat mode.
86  * @constant ITMTRemotePlayerRepeatOff The player plays all of the songs in a playlist through to the end, and then stops.
87  * @constant ITMTRemotePlayerRepeatAll The player plays all of the songs in a playlist through to the end, and then starts over again from the beginning.
88  * @constant ITMTRemotePlayerRepeatOne The player loops playing the selected song.
89  */
90 typedef enum {
91     ITMTRemotePlayerRepeatOff = -1,
92     ITMTRemotePlayerRepeatAll,
93     ITMTRemotePlayerRepeatOne
94 } ITMTRemotePlayerRepeatMode;
95
96 /*!
97  * @protocol ITMTRemote
98  * @discussion The Objective-C protocol which all MenuTunes remotes must implement.
99  */
100 @protocol ITMTRemote
101
102 /*!
103  * @method remote
104  * @abstract Returns an autoreleased instance of the remote.
105  * @discussion Should be very quick and compact.
106  *
107  * EXAMPLE:<br>
108  * + (id)remote<br>
109  * {<br>
110  * &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;return [[[MyRemote alloc] init] autorelease];<br>
111  * }
112  *
113  * @result An instance of the remote.
114  */
115 + (id)remote;
116
117 /*!
118  * @method remoteTitle
119  * @abstract Returns the remote's title/name.
120  * @discussion This title is shown while the user is selecting which remote to use. This is for informational purposes only.
121  * @result An NSString containing the title/name of the remote.
122  */
123 - (NSString *)remoteTitle;
124
125 /*!
126  * @method remoteInformation
127  * @abstract Returns the remote's information.
128  * @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.
129  * @result An NSString containing the information for the remote.
130  */
131 - (NSString *)remoteInformation;
132
133 /*!
134  * @method remoteIcon
135  * @abstract Returns the remote's icon.
136  * @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.
137  * @result An NSImage containing the icon of the remote.
138  */
139 - (NSImage *)remoteIcon;
140
141 /*!
142  * @method begin
143  * @abstract Sent when the remote should begin operation.
144  * @result A result code signifying success.
145  */
146 - (BOOL)begin;
147
148 /*!
149  * @method halt
150  * @abstract Sent when the remote should cease operation.
151  * @result A result code signifying success.
152  */
153 - (BOOL)halt;
154
155 /*!
156  * @method playerFullName
157  * @abstract Returns the remote's player's application filename.
158  * @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
159 r application. This should return "Audion 3", not simply "Audion". See playerSimpleName.
160  * @result An NSString containing the remote's player's application filename
161  */
162 - (NSString *)playerFullName;
163
164 /*!
165  * @method playerSimpleName
166  * @abstract Returns the simplified name of the remote's player.
167  * @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.
168  * @result An NSString containing the simplified name of the remote's player.
169  */
170 - (NSString *)playerSimpleName;
171
172 /*!
173  * @method capabilities
174  * @abstract Returns a dictionary defining the capabilities of the remote and it's player.
175  * @discussion Discussion Forthcoming.
176  * @result An NSDictionary defining the capabilities of the remote and it's player.
177  */
178 - (NSDictionary *)capabilities;
179
180 /*!
181  * @method showPrimaryInterface
182  */
183 - (BOOL)showPrimaryInterface;
184
185 /*!
186  * @method playerRunningState
187  * @abstract Returns the running state of the remote's player.
188  * @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
189 er's process managment.
190  * @result An ITMTRemotePlayerRunningState defining the running state of the remote's player.
191  */
192 - (ITMTRemotePlayerRunningState)playerRunningState;
193
194 /*!
195  * @method playerPlayingState
196  */
197 - (ITMTRemotePlayerPlayingState)playerPlayingState;
198
199 /*!
200  * @method playlists
201  */
202 - (NSArray *)playlists;
203
204 /*!
205  * @method numberOfSongsInPlaylistAtIndex:
206  */
207 - (int)numberOfSongsInPlaylistAtIndex:(int)index;
208
209 /*!
210  * @method currentSource
211  */
212 - (ITMTRemotePlayerSource)currentSource;
213
214 /*!
215  * @method currentPlaylistClass
216  */
217 - (ITMTRemotePlayerPlaylistClass)currentPlaylistClass;
218
219 /*!
220  * @method currentPlaylistIndex
221  */
222 - (int)currentPlaylistIndex;
223
224 /*!
225  * @method songTitleAtIndex:
226  */
227 - (NSString *)songTitleAtIndex:(int)index;
228
229 /*!
230  * @method currentAlbumTrackCount:
231  */
232 - (int)currentAlbumTrackCount;
233
234 /*!
235  * @method currentSongTrack:
236  */
237 - (int)currentSongTrack;
238
239 /*!
240  * @method playerStateUniqueIdentifier:
241  */
242 - (NSString *)playerStateUniqueIdentifier;
243
244 /*!
245  * @method currentSongIndex
246  */
247 - (int)currentSongIndex;
248
249 /*!
250  * @method currentSongTitle
251  */
252 - (NSString *)currentSongTitle;
253
254 /*!
255  * @method currentSongArtist
256  */
257 - (NSString *)currentSongArtist;
258
259 /*!
260  * @method currentSongAlbum
261  */
262 - (NSString *)currentSongAlbum;
263
264 /*!
265  * @method currentSongGenre
266  */
267 - (NSString *)currentSongGenre;
268
269 /*!
270  * @method currentSongLength
271  */
272 - (NSString *)currentSongLength;
273
274 /*!
275  * @method currentSongRemaining
276  */
277 - (NSString *)currentSongRemaining;
278
279 /*!
280  * @method currentSongRating
281  */
282 - (float)currentSongRating;
283
284 /*!
285  * @method setCurrentSongRating:
286  */
287 - (BOOL)setCurrentSongRating:(float)rating;
288
289 /*!
290  * @method eqPresets
291  */
292 - (NSArray *)eqPresets;
293
294 /*!
295  * @method currentEQPresetIndex
296  */
297 - (int)currentEQPresetIndex;
298
299 /*!
300  * @method volume
301  */
302 - (float)volume;
303
304 /*!
305  * @method setVolume:
306  */
307 - (BOOL)setVolume:(float)volume;
308
309 /*!
310  * @method shuffleEnabled
311  */
312 - (BOOL)shuffleEnabled;
313
314 /*!
315  * @method setShuffleEnabled:
316  */
317 - (BOOL)setShuffleEnabled:(BOOL)enabled;
318
319 /*!
320  * @method repeatMode
321  */
322 - (ITMTRemotePlayerRepeatMode)repeatMode;
323
324 /*!
325  * @method setRepeatMode:
326  */
327 - (BOOL)setRepeatMode:(ITMTRemotePlayerRepeatMode)repeatMode;
328
329 /*!
330  * @method play
331  */
332 - (BOOL)play;
333
334 /*!
335  * @method pause
336  */
337 - (BOOL)pause;
338
339 /*!
340  * @method goToNextSong
341  */
342 - (BOOL)goToNextSong;
343
344 /*!
345  * @method goToPreviousSong
346  */
347 - (BOOL)goToPreviousSong;
348
349 /*!
350  * @method forward
351  */
352 - (BOOL)forward;
353
354 /*!
355  * @method rewind
356  */
357 - (BOOL)rewind;
358
359 /*!
360  * @method switchToPlaylistAtIndex:
361  */
362 - (BOOL)switchToPlaylistAtIndex:(int)index;
363
364 /*!
365  * @method switchToSongAtIndex:
366  */
367 - (BOOL)switchToSongAtIndex:(int)index;
368
369 /*!
370  * @method switchToEQAtIndex:
371  */
372 - (BOOL)switchToEQAtIndex:(int)index;
373
374 @end
375
376 /*!
377  * @class ITMTRemote
378  */
379 @interface ITMTRemote : NSObject <ITMTRemote>
380
381 @end