Added stuff for current song rating. Right now in the submenu there are
[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 } PlayerState;
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 - (BOOL)isAppRunning;
89 - (PlayerState)playerState;
90
91 - (NSArray *)playlists;
92 - (int)numberOfSongsInPlaylistAtIndex:(int)index;
93 - (NSString *)classOfPlaylistAtIndex:(int)index;
94 - (int)currentPlaylistIndex;
95
96 - (NSString *)songTitleAtIndex:(int)index;
97 - (int)currentSongIndex;
98
99 - (NSString *)currentSongTitle;
100 - (NSString *)currentSongArtist;
101 - (NSString *)currentSongAlbum;
102 - (NSString *)currentSongGenre;
103 - (NSString *)currentSongLength;
104 - (NSString *)currentSongRemaining;
105
106 - (int)currentSongRating;
107 - (BOOL)setCurrentSongRating:(int)rating;
108
109 - (NSArray *)eqPresets;
110 - (int)currentEQPresetIndex;
111
112 - (BOOL)play;
113 - (BOOL)pause;
114 - (BOOL)goToNextSong;
115 - (BOOL)goToPreviousSong;
116 - (BOOL)fastForward;
117 - (BOOL)rewind;
118
119 - (BOOL)switchToPlaylistAtIndex:(int)index;
120 - (BOOL)switchToSongAtIndex:(int)index;
121 - (BOOL)switchToEQAtIndex:(int)index;
122
123 @end
124
125
126 @interface ITMTRemote : NSObject <ITMTRemote>
127
128 @end