Adding a hash property to ITMTTrack
[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     ITMTTrackHash
45 } ITMTTrackProperty;
46
47 /*!
48     @typedef ITMTPlayerStyle
49     @constant ITMTSinglePlayerStyle Like iTunes, One player controls all available songs.
50     @constant ITMTMultiplePlayerStyle Like Audion, Multiple players control multiple playlists.
51     @constant ITMTSinglePlayerSinglePlaylistStyle Like *Amp, XMMS. Not recommended, but instead, developers are urged to use ITMTSinglePlayerStyle with emulated support for multiple playlists.
52 */
53 typedef enum {
54     ITMTSinglePlayerStyle,
55     ITMTMultiplePlayerStyle,
56     ITMTSinglePlayerSinglePlaylistStyle
57 } ITMTPlayerStyle;
58
59 typedef enum {
60     ITMT32HzEqualizerBandLevel,
61     ITMT64HzEqualizerBandLevel,
62     ITMT125HzEqualizerBandLevel,
63     ITMT250HzEqualizerBandLevel,
64     ITMT500HzEqualizerBandLevel,
65     ITMT1kHzEqualizerBandLevel,
66     ITMT2kHzEqualizerBandLevel,
67     ITMT4kHzEqualizerBandLevel,
68     ITMT8kHzEqualizerBandLevel,
69     ITMT16kHzEqualizerBandLevel,
70     ITMTEqualizerPreampLevel
71 } ITMTEqualizerLevel;
72
73 typedef enum {
74     ITMTTrackStopped = -1,
75     ITMTTrackPaused,
76     ITMTTrackPlaying,
77     ITMTTrackForwarding,
78     ITMTTrackRewinding
79 } ITMTTrackState;
80
81 typedef enum {
82     ITMTRepeatNoneMode,
83     ITMTRepeatOneMode,
84     ITMTRepeatAllMode
85 } ITMTRepeatMode;
86
87 @class ITMTRemote, ITMTPlayer, ITMTPlaylist, ITMTTrack, ITMTEqualizer;
88
89 @protocol ITMTRemote
90 + (id)remote;
91
92 - (id)valueOfProperty:(ITMTRemoteProperty)property;
93
94 - (NSDictionary *)propertiesAndValues;
95
96 - (ITMTPlayerStyle)playerStyle;
97
98 - (BOOL)activate;
99 - (BOOL)deactivate;
100
101 - (ITMTPlayer *)currentPlayer;
102 - (BOOL)selectPlayer:(ITMTPlayer *)player;
103 - (NSArray *)players;
104 @end
105
106 @interface ITMTRemote : NSObject <ITMTRemote>
107 @end
108
109 /*!
110     @protocol ITMTPlayer
111     @abstract Object representation for a controlled player.
112     @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.
113 */
114 @protocol ITMTPlayer
115 - (BOOL)writable;
116
117 - (BOOL)show;
118
119 - (BOOL)setValue:(id)value forProperty:(ITMTGenericProperty)property;
120 - (id)valueOfProperty:(ITMTGenericProperty)property;
121 - (NSDictionary *)propertiesAndValues;
122
123 - (ITMTRemote *)remote;
124
125 - (ITMTPlaylist *)currentPlaylist;
126 - (BOOL)selectPlaylist:(ITMTPlaylist *)playlist;
127 - (ITMTTrack *)currentTrack;
128 - (BOOL)selectTrack:(ITMTTrack *)track;
129 - (ITMTEqualizer *)currentEqualizer;
130 - (BOOL)selectEqualizer:(ITMTEqualizer *)equalizer;
131
132 - (NSArray *)playlists;
133
134 - (NSArray *)tracks;
135 - (ITMTPlaylist *)libraryPlaylist;
136
137 - (NSArray *)equalizers;
138
139 - (ITMTRepeatMode)repeatMode;
140 - (BOOL)setRepeatMode:(ITMTRepeatMode)repeatMode;
141
142 - (BOOL)shuffleEnabled;
143 - (BOOL)enableShuffle:(BOOL)shuffle;
144 @end
145
146 @interface ITMTPlayer : NSObject <ITMTPlayer>
147 @end
148
149 @protocol ITMTPlaylist
150 - (BOOL)isEqualToPlaylist:(ITMTPlaylist *)playlist;
151
152 - (BOOL)writable;
153
154 - (BOOL)show;
155
156 - (BOOL)setValue:(id)value forProperty:(ITMTGenericProperty)property;
157 - (id)valueOfProperty:(ITMTGenericProperty)property;
158 - (NSDictionary *)propertiesAndValues;
159
160 - (ITMTPlayer *)player;
161
162 - (BOOL)addTrack:(ITMTTrack *)track;
163 - (BOOL)insertTrack:(ITMTTrack *)track atIndex:(int)index;
164
165 - (BOOL)removeTrack:(ITMTTrack *)item;
166 - (BOOL)removeTrackAtIndex:(int)index;
167
168 - (ITMTTrack *)trackAtIndex:(int)index;
169
170 - (int)indexOfTrack:(ITMTTrack *)track;
171 - (ITMTTrack *)trackWithProperty:(ITMTTrackProperty)property ofValue:(id)value allowPartialMatch:(BOOL)partial;
172 - (NSArray *)tracksWithProperty:(ITMTTrackProperty)property ofValue:(id)value allowPartialMatches:(BOOL)partial;
173 - (int)indexOfTrackWithProperty:(ITMTTrackProperty)property ofValue:(id)value allowPartialMatch:(BOOL)partial;
174 - (NSArray *)indexesOfTracksWithProperty:(ITMTTrackProperty)property ofValue:(id)value allowPartialMatches:(BOOL)partial;
175
176 - (int)trackCount;
177 - (NSArray *)tracks;
178
179 - (ITMTTrack *)currentTrack;
180 - (int)indexOfCurrentTrack;
181
182 - (BOOL)selectTrack:(ITMTTrack *)track;
183 - (BOOL)selectTrackAtIndex:(int)index;
184
185 - (BOOL)selectNextTrack;
186 - (BOOL)selectPreviousTrack;
187 @end
188
189 @interface ITMTPlaylist : NSObject <ITMTPlaylist>
190 @end
191
192 @protocol ITMTTrack
193 - (BOOL)isEqualToTrack:(ITMTTrack *)track;
194
195 - (BOOL)writable;
196
197 - (BOOL)addToPlaylist:(ITMTPlaylist *)playlist;
198 - (BOOL)addToPlaylist:(ITMTPlaylist *)playlist atIndex:(int)index;
199
200 - (ITMTPlayer *)player;
201 - (NSArray *)playlists;
202 - (ITMTPlaylist *)currentPlaylist;
203 - (BOOL)setCurrentPlaylist:(ITMTPlaylist *)playlist;
204
205 - (BOOL)setValue:(id)value forProperty:(ITMTTrackProperty)property;
206 - (id)valueOfProperty:(ITMTTrackProperty)property;
207 - (NSDictionary *)propertiesAndValues;
208
209 - (BOOL)setState:(ITMTTrackState)state;
210 - (ITMTTrackState)state;
211 @end
212
213 @interface ITMTTrack : NSObject <ITMTTrack>
214 @end
215
216 @protocol ITMTEqualizer
217 - (BOOL)writable;
218
219 - (ITMTPlayer *)player;
220
221 - (float)dBForLevel:(ITMTEqualizerLevel)level;
222 - (BOOL)setdB:(float)dB forLevel:(ITMTEqualizerLevel)level;
223 @end
224
225 @interface ITMTEqualizer : NSObject <ITMTEqualizer>
226 @end