reverting
[MenuTunes.git] / ITMTRemote.h
1 /*
2     iThink Software
3     MenuTunes SDK BETA (SUBJECT TO CHANGE)
4     ITMTRemote.h
5     
6     Copyright 2003 by iThink Software, All Rights Reserved.
7     This is under Non-Disclosure
8 */
9
10 /* 
11     Remotes need to include an Info.plist in their
12     bundle/wrapper. It needs to have the following keys
13     (with string values):
14         
15         ITMTRemoteName
16         ITMTRemoteVersion
17         ITMTRemotePublisher
18         ITMTRemoteCopyright
19         ITMTRemoteDescription
20         ITMTRemoteIconFile
21         
22     It also needs to have an icon file who's filename (Relative)
23     is indicated in the ITMTRemoteIconFile value.
24 */
25
26
27 #import <Foundation/Foundation.h>
28
29 typedef enum {
30     ITMTRemoteName,
31     ITMTRemoteVersion,
32     ITMTRemotePublisher,
33     ITMTRemoteCopyright,
34     ITMTRemoteDescription
35 } ITMTRemoteInformationString;
36
37 typedef enum {
38     ITMTRemotePlayerStopped = -1,
39     ITMTRemotePlayerPaused,
40     ITMTRemotePlayerPlaying,
41     ITMTRemotePlayerRewinding,
42     ITMTRemotePlayerForwarding
43 } ITMTRemoteControlState;
44
45 typedef enum {
46     ITMTRemoteStop = -1,
47     ITMTRemotePause,
48     ITMTRemotePlay,
49     ITMTRemoteRewind,
50     ITMTRemoteFastForward,
51     ITMTRemotePreviousTrack,
52     ITMTRemoteNextTrack
53 } ITMTRemoteControlAction;
54
55 typedef enum {
56     ITMTRemoteSinglePlaylist,
57     ITMTRemoteLibraryAndPlaylists,
58     ITMTRemoteSeperatePlaylists
59 } ITMTRemotePlaylistMode;
60
61 typedef enum {
62     ITMTRemoteTrackName,
63     ITMTRemoteTrackArtist,
64     ITMTRemoteTrackAlbum,
65     ITMTRemoteTrackComposer,
66     ITMTRemoteTrackNumber,
67     ITMTRemoteTrackTotal,
68     ITMTRemoteTrackComment,
69     ITMTRemoteTrackGenre,
70     ITMTRemoteTrackYear,
71     ITMTRemoteTrackRating,
72     ITMTRemoteTrackArt
73 } ITMTRemoteTrackProperty;
74
75 typedef enum {
76     ITMTRemoteRepeatNone,
77     ITMTRemoteRepeatAll,
78     ITMTRemoteRepeatOne
79 } ITMTRemoteRepeatMode;
80
81 enum {
82     ITMTRemoteCustomPreset = -1;
83 }
84
85 @protocol ITMTRemote
86 + (id)remote;
87 - (NSString*)informationString:(ITMTRemoteInformationString)string;
88 - (NSImage*)icon;
89
90 - (BOOL)begin;
91 - (BOOL)halt;
92
93 - (BOOL)supportsControlAction:(ITMTRemoteControlAction)action;
94 - (BOOL)sendControlAction:(ITMTRemoteControlAction)action;
95 - (ITMTRemoteControlState)controlState;
96
97 - (ITMTRemotePlaylistMode)playlistMode;
98 - (NSArray*)playlistNames;
99 - (BOOL)switchToPlaylist:(int)playlistIndex;
100 - (BOOL)switchToTrackAtIndex:(int)index;
101 - (int)indexForTrack:(int)identifier inPlaylist:(int)playlistIndex;
102 - (int)identifierForTrackAtIndex:(int)index inPlaylist:(int)playlistIndex;
103
104 - (BOOL)supportsTrackProperty:(ITMTRemoteTrackProperty)property;
105 - (id)trackProperty:(ITMTRemoteTrackProperty)property atIndex:(int)index;
106 - (BOOL)setTrackProperty:(ITMTRemoteTrackProperty)property toValue:(id)property atIndex:(int)index; // currently only used to set Ratings... someday, we might provide a full frontend? well, it is possible that other apps could use MT remotes, as such, they might want to set other values. For Rating, send in an NSNumber from a float 0.0 - 1.0. For Art, send in an NSImage... this is also what you'll recieve when using the accessor
107
108 - (BOOL)supportsShuffle;
109 - (BOOL)setShuffle:(BOOL)toggle;
110 - (BOOL)shuffle;
111
112 - (BOOL)supportsRepeatMode:(ITMTRemoteRepeatMode)repeatMode;
113 - (BOOL)setRepeatMode:(ITMTRemoteRepeatMode)repeatMode;
114 - (BOOL)repeatMode;
115
116 - (BOOL)supportsVolume;
117 - (BOOL)setVolume:(float)volume;
118 - (float)volume;
119
120 - (BOOL)supportsCustomEqualizer;
121 - (BOOL)showEqualizerWindow;
122
123 - (BOOL)supportsEqualizerPresets;
124 - (NSArray*)equalizerPresetNames;
125 - (BOOL)switchToEqualizerPreset:(int)index; // ITMTRemoteCustomPreset = Custom
126
127 - (BOOL)supportsExternalWindow;
128 - (NSString*)externalWindowName;
129 - (BOOL)showExternalWindow;
130
131 @end
132
133 @interface ITMTRemote : NSObject <ITMTRemote>
134
135 @end