itunes_com/sys/
com_enums.rs

1// Inferred from https://www.joshkunz.com/iTunesControl/main.html
2
3#![allow(non_camel_case_types)]
4
5#[cfg(feature = "num_enum")]
6use num_derive::FromPrimitive;
7
8/// Specifies the artwork format.
9#[repr(C)]
10#[derive(Debug, Eq, PartialEq)]
11#[cfg_attr(feature = "num_enum", derive(FromPrimitive))]
12pub enum ITArtworkFormat {
13    /// Unknown artwork format.
14    ITArtworkFormatUnknown = 0,
15    /// JPEG image.
16    ITArtworkFormatJPEG = 1,
17    /// PNG image.
18    ITArtworkFormatPNG = 2,
19    /// BMP image.
20    ITArtworkFormatBMP = 3,
21}
22
23/// iTunes-specific HRESULT error codes.
24#[repr(C)]
25#[derive(Debug, Eq, PartialEq)]
26#[cfg_attr(feature = "num_enum", derive(FromPrimitive))]
27pub enum ITErrors {
28    /// user canceled the operation
29    /// Note that Microsoft defines ERROR_CANCELLED, but this is a positive value. We need to use a negative value to force this to be treated as an exception.
30    ITUNES_E_USERCANCEL = 0xA0040201,
31    /// the entity referenced by this COM object has been deleted
32    ITUNES_E_OBJECTDELETED = 0xA0040202,
33    /// attempt to modify a locked property
34    ITUNES_E_OBJECTLOCKED = 0xA0040203,
35    /// attempt to start a conversion while a previous conversion is still in progress
36    ITUNES_E_CONVERSIONINPROGRESS = 0xA0040204,
37    /// access to the iTunes Store is disabled in the preferences
38    ITUNES_E_MUSICSTOREDISABLED = 0xA0040205,
39    /// an object with the same name already exists (added in iTunes type library 1.2)
40    ITUNES_E_OBJECTEXISTS = 0xA0040206,
41    /// access to podcasts is disabled in the preferences (added in iTunes type library 1.5)
42    ITUNES_E_PODCASTSDISABLED = 0xA0040207,
43}
44
45/// The major and minor version of the iTunes type library. Use these constants with CheckVersion().
46#[repr(C)]
47#[derive(Debug, Eq, PartialEq)]
48#[cfg_attr(feature = "num_enum", derive(FromPrimitive))]
49pub enum ITVersion {
50    /// iTunes type library major version
51    kITTypeLibrary_MajorVersion = 1,
52    /// iTunes type library minor version (0 for iTunes 4.5, 1 for iTunes 4.6, 2 for iTunes 4.7 and 4.7.1, 3 for iTunes 4.8 and 4.8.1, 4 for iTunes 4.9, 5 for iTunes 5.0, 6 for iTunes 6.0, 7 for iTunes 6.0.2, 8 for iTunes 7.0, 9 for iTunes 7.1, 10 for iTunes 7.4, 11 for iTunes 7.7, 12 for iTunes 8.1)
53    kITTypeLibrary_MinorVersion = 4,
54}
55
56/// Specifies the reason the COM interface is being disabled.
57#[repr(C)]
58#[derive(Debug, Eq, PartialEq)]
59#[cfg_attr(feature = "num_enum", derive(FromPrimitive))]
60pub enum ITCOMDisabledReason {
61    /// COM interface is being disabled for some other reason.
62    ITCOMDisabledReasonOther = 0,
63    /// COM interface is being disabled because a modal dialog is being displayed.
64    ITCOMDisabledReasonDialog = 1,
65    /// COM interface is being disabled because iTunes is quitting.
66    ITCOMDisabledReasonQuitting = 2,
67}
68
69/// Events generated by IITConvertOperationStatus.
70#[repr(C)]
71#[derive(Debug, Eq, PartialEq)]
72#[cfg_attr(feature = "num_enum", derive(FromPrimitive))]
73pub enum ITConvertOperationStatusEvent {
74    /// status about the conversion operation has changed
75    ITConvertOperationStatusChanged = 1,
76    /// the conversion operation has completed
77    ITConvertOperationComplete = 2,
78}
79
80/// Events generated by IiTunes.
81#[repr(C)]
82#[derive(Debug, Eq, PartialEq)]
83#[cfg_attr(feature = "num_enum", derive(FromPrimitive))]
84pub enum ITEvent {
85    /// iTunes database has changed
86    ITEventDatabaseChanged = 1,
87    /// a track has started playing
88    ITEventPlayerPlay = 2,
89    /// a track has stopped playing
90    ITEventPlayerStop = 3,
91    /// information about the currently playing track has changed
92    ITEventPlayerPlayingTrackChanged = 4,
93    /// calls to the iTunes COM interface will be deferred (typically because a modal dialog is displayed)
94    ITEventCOMCallsDisabled = 6,
95    /// calls to the iTunes COM interface will no longer be deferred (typically because the last modal dialog has been dismissed)
96    ITEventCOMCallsEnabled = 7,
97    /// iTunes is about to quit, existing iTunes COM objects will no longer be valid
98    ITEventQuitting = 8,
99    /// iTunes is about to prompt the user to quit, you should release iTunes COM objects if you want to avoid the dialog
100    ITEventAboutToPromptUserToQuit = 9,
101    /// the sound output volume has changed
102    ITEventSoundVolumeChanged = 10,
103}
104
105/// Specifies the state of the play/pause/stop button.
106#[repr(C)]
107#[derive(Debug, Eq, PartialEq)]
108#[cfg_attr(feature = "num_enum", derive(FromPrimitive))]
109pub enum ITPlayButtonState {
110    /// Disabled play button.
111    ITPlayButtonStatePlayDisabled = 0,
112    /// Enabled play button.
113    ITPlayButtonStatePlayEnabled = 1,
114    /// Enabled pause button.
115    ITPlayButtonStatePauseEnabled = 2,
116    /// Disabled pause button.
117    ITPlayButtonStatePauseDisabled = 3,
118    /// Enabled stop button.
119    ITPlayButtonStateStopEnabled = 4,
120    /// Disabled stop button.
121    ITPlayButtonStateStopDisabled = 5,
122}
123
124/// Specifies a player button.
125#[repr(C)]
126#[derive(Debug, Eq, PartialEq)]
127#[cfg_attr(feature = "num_enum", derive(FromPrimitive))]
128pub enum ITPlayerButton {
129    /// Previous/rewind button.
130    ITPlayerButtonPrevious = 0,
131    /// Play button.
132    ITPlayerButtonPlay = 1,
133    /// Next/fast forward button.
134    ITPlayerButtonNext = 2,
135}
136
137/// Player button modifier key flags.
138#[repr(C)]
139#[derive(Debug, Eq, PartialEq)]
140#[cfg_attr(feature = "num_enum", derive(FromPrimitive))]
141pub enum ITPlayerButtonModifierKey {
142    /// No modifiers.
143    ITPlayerButtonModifierKeyNone = 0,
144    /// Shift key down.
145    ITPlayerButtonModifierKeyShift = 1,
146    /// Control key down.
147    ITPlayerButtonModifierKeyControl = 2,
148    /// Alt key down.
149    ITPlayerButtonModifierKeyAlt = 4,
150    /// Caps Lock key toggled.
151    ITPlayerButtonModifierKeyCapsLock = 8,
152}
153
154/// Specifies the state of the player.
155#[repr(C)]
156#[derive(Debug, Eq, PartialEq)]
157#[cfg_attr(feature = "num_enum", derive(FromPrimitive))]
158pub enum ITPlayerState {
159    /// Player is stopped.
160    ITPlayerStateStopped = 0,
161    /// Player is playing.
162    ITPlayerStatePlaying = 1,
163    /// Player is fast forwarding.
164    ITPlayerStateFastForward = 2,
165    /// Player is rewinding.
166    ITPlayerStateRewind = 3,
167}
168
169/// Specifies the size of the visuals.
170#[repr(C)]
171#[derive(Debug, Eq, PartialEq)]
172#[cfg_attr(feature = "num_enum", derive(FromPrimitive))]
173pub enum ITVisualSize {
174    /// Small size visuals.
175    ITVisualSizeSmall = 0,
176    /// Medium size visuals.
177    ITVisualSizeMedium = 1,
178    /// Large size visuals.
179    ITVisualSizeLarge = 2,
180}
181
182/// Specifies the window kind.
183#[repr(C)]
184#[derive(Debug, Eq, PartialEq)]
185#[cfg_attr(feature = "num_enum", derive(FromPrimitive))]
186pub enum ITWindowKind {
187    /// Unknown window kind.
188    ITWindowKindUnknown = 0,
189    /// Main browser window (IITBrowserWindow).
190    ITWindowKindBrowser = 1,
191    /// Playlist window (IITPlaylistWindow).
192    ITWindowKindPlaylist = 2,
193    /// EQ window.
194    ITWindowKindEQ = 3,
195    /// Artwork window.
196    ITWindowKindArtwork = 4,
197    /// Now Playing window.
198    ITWindowKindNowPlaying = 5,
199}
200
201/// Specifies the source kind.
202#[repr(C)]
203#[derive(Debug, Eq, PartialEq)]
204#[cfg_attr(feature = "num_enum", derive(FromPrimitive))]
205pub enum ITSourceKind {
206    /// Unknown source kind.
207    ITSourceKindUnknown = 0,
208    /// Library source.
209    ITSourceKindLibrary = 1,
210    /// iPod source (IITIPodSource).
211    ITSourceKindIPod = 2,
212    /// Audio CD source.
213    ITSourceKindAudioCD = 3,
214    /// MP3 CD source.
215    ITSourceKindMP3CD = 4,
216    /// Device source.
217    ITSourceKindDevice = 5,
218    /// Radio tuner source.
219    ITSourceKindRadioTuner = 6,
220    /// Shared library source.
221    ITSourceKindSharedLibrary = 7,
222}
223
224/// Specifies the playlist kind.
225#[repr(C)]
226#[derive(Debug, Eq, PartialEq)]
227#[cfg_attr(feature = "num_enum", derive(FromPrimitive))]
228pub enum ITPlaylistKind {
229    /// Unknown playlist kind.
230    ITPlaylistKindUnknown = 0,
231    /// Library playlist (IITLibraryPlaylist).
232    ITPlaylistKindLibrary = 1,
233    /// User playlist (IITUserPlaylist).
234    ITPlaylistKindUser = 2,
235    /// CD playlist (IITAudioCDPlaylist).
236    ITPlaylistKindCD = 3,
237    /// Device playlist.
238    ITPlaylistKindDevice = 4,
239    /// Radio tuner playlist.
240    ITPlaylistKindRadioTuner = 5,
241}
242
243/// Specifies the kind of playlist printout.
244#[repr(C)]
245#[derive(Debug, Eq, PartialEq)]
246#[cfg_attr(feature = "num_enum", derive(FromPrimitive))]
247pub enum ITPlaylistPrintKind {
248    /// Print a list of tracks in the playlist.
249    ITPlaylistPrintKindPlaylist = 0,
250    /// Print a list of albums in the playlist.
251    ITPlaylistPrintKindAlbumlist = 1,
252    /// Print a CD jewel case insert.
253    ITPlaylistPrintKindInsert = 2,
254}
255
256/// Specifies the playlist playback repeat mode.
257#[repr(C)]
258#[derive(Debug, Eq, PartialEq)]
259#[cfg_attr(feature = "num_enum", derive(FromPrimitive))]
260pub enum ITPlaylistRepeatMode {
261    /// Play playlist once.
262    ITPlaylistRepeatModeOff = 0,
263    /// Repeat song.
264    ITPlaylistRepeatModeOne = 1,
265    /// Repeat playlist.
266    ITPlaylistRepeatModeAll = 2,
267}
268
269/// Specifies the fields in each track that will be searched by IITPlaylist::Search().
270#[repr(C)]
271#[derive(Debug, Eq, PartialEq)]
272#[cfg_attr(feature = "num_enum", derive(FromPrimitive))]
273pub enum ITPlaylistSearchField {
274    /// Search all fields of each track.
275    ITPlaylistSearchFieldAll = 0,
276    /// Search only the fields with columns that are currently visible in the display for the playlist.
277    /// Note that song name, artist, album, and composer will always be searched, even if these columns are not visible.
278    ITPlaylistSearchFieldVisible = 1,
279    /// Search only the artist field of each track (IITTrack::Artist).
280    ITPlaylistSearchFieldArtists = 2,
281    /// Search only the album field of each track (IITTrack::Album).
282    ITPlaylistSearchFieldAlbums = 3,
283    /// Search only the composer field of each track (IITTrack::Composer).
284    ITPlaylistSearchFieldComposers = 4,
285    /// Search only the song name field of each track (IITTrack::Name).
286    ITPlaylistSearchFieldSongNames = 5,
287}
288
289/// Specifies the user playlist special kind.
290#[repr(C)]
291#[derive(Debug, Eq, PartialEq)]
292#[cfg_attr(feature = "num_enum", derive(FromPrimitive))]
293pub enum ITUserPlaylistSpecialKind {
294    /// No special kind.
295    ITUserPlaylistSpecialKindNone = 0,
296    /// Purchased Music playlist.
297    ITUserPlaylistSpecialKindPurchasedMusic = 1,
298    /// Party Shuffle playlist. Was one called iTunes DJ.
299    ITUserPlaylistSpecialKindPartyShuffle = 2,
300    /// Podcasts playlist.
301    ITUserPlaylistSpecialKindPodcasts = 3,
302    /// Folder playlist.
303    ITUserPlaylistSpecialKindFolder = 4,
304    /// Videos playlist (added in iTunes type library 1.6).
305    ITUserPlaylistSpecialKindVideos = 5,
306    /// Music playlist (added in iTunes type library 1.8).
307    ITUserPlaylistSpecialKindMusic = 6,
308    /// Movies playlist (added in iTunes type library 1.8).
309    ITUserPlaylistSpecialKindMovies = 7,
310    /// TV Shows playlist (added in iTunes type library 1.8).
311    ITUserPlaylistSpecialKindTVShows = 8,
312    /// Audiobooks playlist (added in iTunes type library 1.8).
313    ITUserPlaylistSpecialKindAudiobooks = 9,
314    ITUserPlaylistSpecialKindITunesU = 10,
315    ITUserPlaylistSpecialKindGenius = 11,
316}
317
318/// Specifies the rating kind (added in iTunes type library 1.10).
319#[repr(C)]
320#[derive(Debug, Eq, PartialEq)]
321#[cfg_attr(feature = "num_enum", derive(FromPrimitive))]
322pub enum ITRatingKind {
323    /// User-specified rating.
324    ITRatingKindUser = 0,
325    /// iTunes-computed rating.
326    ITRatingKindComputed = 1,
327}
328
329/// Specifies the track kind.
330#[repr(C)]
331#[derive(Debug, Eq, PartialEq)]
332#[cfg_attr(feature = "num_enum", derive(FromPrimitive))]
333pub enum ITTrackKind {
334    /// Unknown track kind.
335    ITTrackKindUnknown = 0,
336    /// File track (IITFileOrCDTrack).
337    ITTrackKindFile = 1,
338    /// CD track (IITFileOrCDTrack).
339    ITTrackKindCD = 2,
340    /// URL track (IITURLTrack).
341    ITTrackKindURL = 3,
342    /// Device track.
343    ITTrackKindDevice = 4,
344    /// Shared library track.
345    ITTrackKindSharedLibrary = 5,
346}
347
348/// Specifies the video track kind (added in iTunes type library 1.8).
349#[repr(C)]
350#[derive(Debug, Eq, PartialEq)]
351#[cfg_attr(feature = "num_enum", derive(FromPrimitive))]
352pub enum ITVideoKind {
353    /// Not a video track, or unknown video track kind.
354    ITVideoKindNone = 0,
355    /// Movie video track.
356    ITVideoKindMovie = 1,
357    /// Music video track.
358    ITVideoKindMusicVideo = 2,
359    /// TV show video track.
360    ITVideoKindTVShow = 3,
361}