Adding next/previous track methods to ITMTPlaylist
[MenuTunes.git] / ITMTRemote.h
1 /****************************************
2     ITMTRemote 1.0 (MenuTunes Remotes)
3     ITMTRemote.h
4     
5     Responsibility:
6         Joseph Spiros <joseph.spiros@ithinksw.com>
7     
8     Copyright (c) 2002 - 2003 by iThink Software.
9     All Rights Reserved.
10 ****************************************/
11
12 #import <Cocoa/Cocoa.h>
13
14 typedef enum {
15     ITMTNameProperty,
16     ITMTImageProperty
17 } ITMTGenericProperty;
18
19 typedef enum {
20     ITMTRemoteNameProperty,
21     ITMTRemoteImageProperty,
22     ITMTRemoteAuthorProperty,
23     ITMTRemoteDescriptionProperty,
24     ITMTRemoteURLProperty,
25     ITMTRemoteCopyrightProperty,
26     ITMTRemoteActivationStringProperty,
27     ITMTRemoteDeactivationStringProperty
28 } ITMTRemoteProperty;
29
30 typedef enum {
31     ITMTTrackTitle,
32     ITMTTrackArtist,
33     ITMTTrackComposer,
34     ITMTTrackYear,
35     ITMTTrackImage,
36     ITMTTrackAlbum,
37     ITMTTrackNumber,
38     ITMTTrackTotal,
39     ITMTDiscNumber,
40     ITMTDiscTotal,
41     ITMTTrackComments,
42     ITMTTrackGenre,
43     ITMTTrackRating
44 } ITMTTrackProperty;
45
46 /*!
47     @typedef ITMTPlayerStyle
48     @constant ITMTSinglePlayerStyle Like iTunes, One player controls all available songs.
49     @constant ITMTMultiplePlayerStyle Like Audion, Multiple players control multiple playlists.
50     @constant ITMTSinglePlayerSinglePlaylistStyle Like *Amp, XMMS. Not recommended, but instead, developers are urged to use ITMTSinglePlayerStyle with emulated support for multiple playlists.
51 */
52 typedef enum {
53     ITMTSinglePlayerStyle,
54     ITMTMultiplePlayerStyle,
55     ITMTSinglePlayerSinglePlaylistStyle
56 } ITMTPlayerStyle;
57
58 typedef enum {
59     ITMT32HzEqualizerBandLevel,
60     ITMT64HzEqualizerBandLevel,
61     ITMT125HzEqualizerBandLevel,
62     ITMT250HzEqualizerBandLevel,
63     ITMT500HzEqualizerBandLevel,
64     ITMT1kHzEqualizerBandLevel,
65     ITMT2kHzEqualizerBandLevel,
66     ITMT4kHzEqualizerBandLevel,
67     ITMT8kHzEqualizerBandLevel,
68     ITMT16kHzEqualizerBandLevel,
69     ITMTEqualizerPreampLevel
70 } ITMTEqualizerLevel;
71
72 typedef enum {
73     ITMTTrackStopped = -1,
74     ITMTTrackPaused,
75     ITMTTrackPlaying,
76     ITMTTrackForwarding,
77     ITMTTrackRewinding
78 } ITMTTrackState;
79
80 typedef enum {
81     ITMTRepeatNoneMode,
82     ITMTRepeatOneMode,
83     ITMTRepeatAllMode
84 } ITMTRepeatMode;
85
86 @class ITMTRemote, ITMTPlayer, ITMTPlaylist, ITMTTrack, ITMTEqualizer;
87
88 @protocol ITMTRemote
89 + (id)remote;
90
91 - (id)valueOfProperty:(ITMTRemoteProperty)property;
92
93 - (NSDictionary *)propertiesAndValues;
94
95 - (ITMTPlayerStyle)playerStyle;
96
97 - (BOOL)activate;
98 - (BOOL)deactivate;
99
100 - (ITMTPlayer *)currentPlayer;
101 - (BOOL)selectPlayer:(ITMTPlayer *)player;
102 - (NSArray *)players;
103 @end
104
105 @interface ITMTRemote : NSObject <ITMTRemote>
106 @end
107
108 /*!
109     @protocol ITMTPlayer
110     @abstract Object representation for a controlled player.
111     @discussion Object representation for a controlled player. Players can be defined as things that control playlist(s) objects, a pool of track objects, and possibly, equalizer objects.
112 */
113 @protocol ITMTPlayer
114 - (BOOL)writable;
115
116 - (BOOL)show;
117
118 - (BOOL)setValue:(id)value forProperty:(ITMTGenericProperty)property;
119 - (id)valueOfProperty:(ITMTGenericProperty)property;
120 - (NSDictionary *)propertiesAndValues;
121
122 - (ITMTRemote *)remote;
123
124 - (ITMTPlaylist *)currentPlaylist;
125 - (BOOL)selectPlaylist:(ITMTPlaylist *)playlist;
126 - (ITMTTrack *)currentTrack;
127 - (BOOL)selectTrack:(ITMTTrack *)track;
128 - (ITMTEqualizer *)currentEqualizer;
129 - (BOOL)selectEqualizer:(ITMTEqualizer *)equalizer;
130
131 - (NSArray *)playlists;
132
133 - (NSArray *)tracks;
134 - (ITMTPlaylist *)libraryPlaylist;
135
136 - (NSArray *)equalizers;
137
138 - (ITMTRepeatMode)repeatMode;
139 - (BOOL)setRepeatMode:(ITMTRepeatMode)repeatMode;
140
141 - (BOOL)shuffleEnabled;
142 - (BOOL)enableShuffle:(BOOL)shuffle;
143 @end
144
145 @interface ITMTPlayer : NSObject <ITMTPlayer>
146 @end
147
148 @protocol ITMTPlaylist
149 - (BOOL)isEqualToPlaylist:(ITMTPlaylist *)playlist;
150
151 - (BOOL)writable;
152
153 - (BOOL)show;
154
155 - (BOOL)setValue:(id)value forProperty:(ITMTGenericProperty)property;
156 - (id)valueOfProperty:(ITMTGenericProperty)property;
157 - (NSDictionary *)propertiesAndValues;
158
159 - (ITMTPlayer *)player;
160
161 - (BOOL)addTrack:(ITMTTrack *)track;
162 - (BOOL)insertTrack:(ITMTTrack *)track atIndex:(int)index;
163
164 - (BOOL)removeTrack:(ITMTTrack *)item;
165 - (BOOL)removeTrackAtIndex:(int)index;
166
167 - (ITMTTrack *)trackAtIndex:(int)index;
168
169 - (int)indexOfTrack:(ITMTTrack *)track;
170 - (ITMTTrack *)trackWithProperty:(ITMTTrackProperty)property ofValue:(id)value allowPartialMatch:(BOOL)partial;
171 - (NSArray *)tracksWithProperty:(ITMTTrackProperty)property ofValue:(id)value allowPartialMatches:(BOOL)partial;
172 - (int)indexOfTrackWithProperty:(ITMTTrackProperty)property ofValue:(id)value allowPartialMatch:(BOOL)partial;
173 - (NSArray *)indexesOfTracksWithProperty:(ITMTTrackProperty)property ofValue:(id)value allowPartialMatches:(BOOL)partial;
174
175 - (int)trackCount;
176 - (NSArray *)tracks;
177
178 - (ITMTTrack *)currentTrack;
179 - (int)indexOfCurrentTrack;
180
181 - (BOOL)selectTrack:(ITMTTrack *)track;
182 - (BOOL)selectTrackAtIndex:(int)index;
183
184 - (BOOL)selectNextTrack;
185 - (BOOL)selectPreviousTrack;
186 @end
187
188 @interface ITMTPlaylist : NSObject <ITMTPlaylist>
189 @end
190
191 @protocol ITMTTrack
192 - (BOOL)isEqualToTrack:(ITMTTrack *)track;
193
194 - (BOOL)writable;
195
196 - (BOOL)addToPlaylist:(ITMTPlaylist *)playlist;
197 - (BOOL)addToPlaylist:(ITMTPlaylist *)playlist atIndex:(int)index;
198
199 - (ITMTPlayer *)player;
200 - (NSArray *)playlists;
201 - (ITMTPlaylist *)currentPlaylist;
202 - (BOOL)setCurrentPlaylist:(ITMTPlaylist *)playlist;
203
204 - (BOOL)setValue:(id)value forProperty:(ITMTTrackProperty)property;
205 - (id)valueOfProperty:(ITMTTrackProperty)property;
206 - (NSDictionary *)propertiesAndValues;
207
208 - (BOOL)setState:(ITMTTrackState)state;
209 - (ITMTTrackState)state;
210 @end
211
212 @interface ITMTTrack : NSObject <ITMTTrack>
213 @end
214
215 @protocol ITMTEqualizer
216 - (BOOL)writable;
217
218 - (ITMTPlayer *)player;
219
220 - (float)dBForLevel:(ITMTEqualizerLevel)level;
221 - (BOOL)setdB:(float)dB forLevel:(ITMTEqualizerLevel)level;
222 @end
223
224 @interface ITMTEqualizer : NSObject <ITMTEqualizer>
225 @end