Some Plugin API changes... Need to finish the API HeaderDocs sometime
[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  * TO DO:
20  *
21  * - Capability methods
22  *
23  */
24
25 /*! @header ITMTRemote
26  *  @abstract Declares the necessary protocol and class to implement a MenuTunes Remote.
27  */
28
29 #import <Cocoa/Cocoa.h>
30
31 typedef enum {
32     stopped = -1,
33     paused,
34     playing,
35     rewinding,
36     forwarding
37 } ITMTRemotePlayerState;
38
39 /*! @protocol ITMTRemote
40  *  @abstract Declares what a MenuTunes Remote must be able to do.
41  *  @discussion A MenuTunes Remote must be able to return and change state information.
42  */
43 @protocol ITMTRemote
44
45
46 /*! @method remote
47  *  @abstract Returns an autoreleased instance of the remote.
48  *  @discussion Should be very quick and compact.
49  *  EXAMPLE:
50  *    + (id)remote
51  *    {
52  *        return [[[MyRemote alloc] init] autorelease];
53  *    }
54  *  @result The instance.
55  */
56 + (id)remote;
57
58 /*! @method title:
59  *  @abstract Returns the title of the plugin, which should be player name.
60  *  @result An NSString containing the title.
61  */
62 - (NSString *)title;
63
64 /*! @method description:
65  *  @abstract Returns a description of the remote.
66  *  @result An NSString containing the description.
67  */
68 - (NSString *)information;
69
70 /*! @method icon:
71  *  @abstract Returns a icon for the remote.
72  *  @result An NSImage containing the icon.
73  */
74 - (NSImage *)icon;
75
76 /*! @method begin:
77  *  @abstract Sent when the plugin should begin operation.
78  *  @result A result code signifying success.
79  */
80 - (BOOL)begin;
81
82 /*! @method halt:
83  *  @abstract Sent when the plugin should cease operation.
84  *  @result A result code signifying success.
85  */
86 - (BOOL)halt;
87
88 /*! @method isAppRunning:
89  *  @abstract Returns controlled application's running status (is or isn't running).
90  *  @result BOOL of the controlled application's running status.
91  */
92 - (BOOL)isAppRunning;
93
94 /*! @method playerState:
95  *  @abstract Returns controlled application's playing state.
96  *  @result ITMTRemotePlayerState of the controlled application's playing state.
97  */
98 - (ITMTRemotePlayerState)playerState;
99
100 - (NSArray *)playlists;
101 - (int)numberOfSongsInPlaylistAtIndex:(int)index;
102 - (NSString *)classOfPlaylistAtIndex:(int)index;
103 - (int)currentPlaylistIndex;
104
105 - (NSString *)songTitleAtIndex:(int)index;
106 - (int)currentSongIndex;
107
108 - (NSString *)currentSongTitle;
109 - (NSString *)currentSongArtist;
110 - (NSString *)currentSongAlbum;
111 - (NSString *)currentSongGenre;
112 - (NSString *)currentSongLength;
113 - (NSString *)currentSongRemaining;
114
115 - (float)currentSongRating;
116 - (BOOL)setCurrentSongRating:(float)rating;
117
118 - (NSArray *)eqPresets;
119 - (int)currentEQPresetIndex;
120
121 - (float)volume;
122 - (BOOL)setVolume:(float)volume;
123
124 - (BOOL)play;
125 - (BOOL)pause;
126 - (BOOL)goToNextSong;
127 - (BOOL)goToPreviousSong;
128 - (BOOL)fastForward;
129 - (BOOL)rewind;
130
131 - (BOOL)switchToPlaylistAtIndex:(int)index;
132 - (BOOL)switchToSongAtIndex:(int)index;
133 - (BOOL)switchToEQAtIndex:(int)index;
134
135 @end
136
137
138 @interface ITMTRemote : NSObject <ITMTRemote>
139
140 @end