Quick Changes
[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     ITMTRemotePlayerNotRunning = -1,
33     ITMTRemotePlayerLaunching,
34     ITMTRemotePlayerRunning
35 } ITMTRemotePlayerRunningStatus;
36
37 typedef enum {
38     ITMTRemotePlayerStopped = -1,
39     ITMTRemotePlayerPaused,
40     ITMTRemotePlayerPlaying,
41     ITMTRemotePlayerRewinding,
42     ITMTRemotePlayerForwarding
43 } ITMTRemotePlayerState;
44
45 /*! @protocol ITMTRemote
46  *  @abstract Declares what a MenuTunes Remote must be able to do.
47  *  @discussion A MenuTunes Remote must be able to return and change state information.
48  */
49 @protocol ITMTRemote
50
51
52 /*! @method remote
53  *  @abstract Returns an autoreleased instance of the remote.
54  *  @discussion Should be very quick and compact.
55  *  EXAMPLE:
56  *    + (id)remote
57  *    {
58  *        return [[[MyRemote alloc] init] autorelease];
59  *    }
60  *  @result The instance.
61  */
62 + (id)remote;
63
64 /*! @method pluginTitle:
65  *  @abstract Returns the title of the plugin, which should be player name.
66  *  @result An NSString containing the title.
67  */
68 - (NSString *)pluginTitle;
69
70 /*! @method pluginInformation:
71  *  @abstract Returns a description of the remote.
72  *  @result An NSString containing the description.
73  */
74 - (NSString *)pluginInformation;
75
76 /*! @method pluginIcon:
77  *  @abstract Returns a icon for the remote.
78  *  @result An NSImage containing the icon.
79  */
80 - (NSImage *)pluginIcon;
81
82 /*! @method begin:
83  *  @abstract Sent when the plugin should begin operation.
84  *  @result A result code signifying success.
85  */
86 - (BOOL)begin;
87
88 /*! @method halt:
89  *  @abstract Sent when the plugin should cease operation.
90  *  @result A result code signifying success.
91  */
92 - (BOOL)halt;
93
94 - (NSString *)playerFullName;
95
96 - (NSString *)playerSimpleName;
97
98 /*! @method playerRunningStatus:
99  *  @abstract Returns controlled application's running status (is or isn't running).
100  *  @result BOOL of the controlled application's running status.
101  */
102 - (ITMTRemotePlayerRunningStatus)playerRunningStatus;
103
104 /*! @method playerState:
105  *  @abstract Returns controlled application's playing state.
106  *  @result ITMTRemotePlayerState of the controlled application's playing state.
107  */
108 - (ITMTRemotePlayerState)playerState;
109
110 - (NSArray *)playlists;
111 - (int)numberOfSongsInPlaylistAtIndex:(int)index;
112 - (NSString *)classOfPlaylistAtIndex:(int)index;
113 - (int)currentPlaylistIndex;
114
115 - (NSString *)songTitleAtIndex:(int)index;
116 - (int)currentSongIndex;
117
118 - (NSString *)currentSongTitle;
119 - (NSString *)currentSongArtist;
120 - (NSString *)currentSongAlbum;
121 - (NSString *)currentSongGenre;
122 - (NSString *)currentSongLength;
123 - (NSString *)currentSongRemaining;
124
125 - (float)currentSongRating;
126 - (BOOL)setCurrentSongRating:(float)rating;
127
128 - (BOOL)equalizerEnabled;
129 - (BOOL)setEqualizerEnabled:(BOOL)enabled;
130
131 - (NSArray *)eqPresets;
132 - (int)currentEQPresetIndex;
133
134 - (float)volume;
135 - (BOOL)setVolume:(float)volume;
136
137 - (BOOL)play;
138 - (BOOL)pause;
139 - (BOOL)goToNextSong;
140 - (BOOL)goToPreviousSong;
141 - (BOOL)forward;
142 - (BOOL)rewind;
143
144 - (BOOL)switchToPlaylistAtIndex:(int)index;
145 - (BOOL)switchToSongAtIndex:(int)index;
146 - (BOOL)switchToEQAtIndex:(int)index;
147
148 @end
149
150
151 @interface ITMTRemote : NSObject <ITMTRemote>
152
153 @end