Added fast forward and rewind. Player state. More key equivalents.
[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 {stopped = -1, paused, playing, rewinding, forwarding} PlayerState;
32
33 /*! @protocol ITMTRemote
34  *  @abstract Declares what a MenuTunes Remote must be able to do.
35  *  @discussion A MenuTunes Remote must be able to return and change state information.
36  */
37 @protocol ITMTRemote
38
39
40 /*! @method remote
41  *  @abstract Returns an autoreleased instance of the remote.
42  *  @discussion Should be very quick and compact.
43  *  EXAMPLE:
44  *    + (id)remote
45  *    {
46  *        return [[[MyRemote alloc] init] autorelease];
47  *    }
48  *  @result The instance.
49  */
50 + (id)remote;
51
52 /*! @method title:
53  *  @abstract Returns an autoreleased instance of the remote.
54  *  @result An NSString containing the title.
55  */
56 - (NSString *)title;
57
58 /*! @method description:
59  *  @abstract Returns a description of the remote.
60  *  @result An NSString containing the description.
61  */
62 - (NSString *)information;
63
64 /*! @method icon:
65  *  @abstract Returns a icon for the remote.
66  *  @result An NSImage containing the icon.
67  */
68 - (NSImage *)icon;
69
70 /*! @method begin:
71  *  @abstract Sent when the plugin should begin operation.
72  *  @result A result code signifying success.
73  */
74 - (BOOL)begin;
75
76 /*! @method halt:
77  *  @abstract Sent when the plugin should cease operation.
78  *  @result A result code signifying success.
79  */
80 - (BOOL)halt;
81
82 - (PlayerState)playerState;
83
84 - (NSArray *)playlists;
85 - (int)numberOfSongsInPlaylistAtIndex:(int)index;
86 - (NSString *)classOfPlaylistAtIndex:(int)index;
87 - (int)currentPlaylistIndex;
88
89 - (NSString *)songTitleAtIndex:(int)index;
90 - (int)currentSongIndex;
91
92 - (NSString *)currentSongTitle;
93 - (NSString *)currentSongArtist;
94 - (NSString *)currentSongAlbum;
95 - (NSString *)currentSongGenre;
96 - (NSString *)currentSongLength;
97 - (NSString *)currentSongRemaining;
98
99 - (NSArray *)eqPresets;
100 - (int)currentEQPresetIndex;
101
102 - (BOOL)play;
103 - (BOOL)pause;
104 - (BOOL)goToNextSong;
105 - (BOOL)goToPreviousSong;
106 - (BOOL)fastForward;
107 - (BOOL)rewind;
108
109 - (BOOL)switchToPlaylistAtIndex:(int)index;
110 - (BOOL)switchToSongAtIndex:(int)index;
111 - (BOOL)switchToEQAtIndex:(int)index;
112
113 @end
114
115
116 @interface ITMTRemote : NSObject <ITMTRemote>
117
118 @end