vitunes 0.0.3
Sign up to get free protection for your applications and to get access to all the features.
- data/.gitignore +11 -0
- data/NOTES +216 -0
- data/README.markdown +65 -0
- data/Rakefile +69 -0
- data/bin/vitunes +9 -0
- data/bin/vitunes-help +11 -0
- data/bin/vitunes-install +9 -0
- data/iTunes.h +507 -0
- data/lib/plugin.erb +10 -0
- data/lib/vitunes/version.rb +3 -0
- data/lib/vitunes-tool-objc +0 -0
- data/lib/vitunes.rb +29 -0
- data/lib/vitunes.vim +344 -0
- data/vitunes/main.m +277 -0
- data/vitunes/vitunes-Prefix.pch +7 -0
- data/vitunes/vitunes.1 +79 -0
- data/vitunes.gemspec +26 -0
- data/vitunes.xcodeproj/project.pbxproj +233 -0
- data/vitunes.xcodeproj/project.xcworkspace/contents.xcworkspacedata +7 -0
- metadata +87 -0
data/iTunes.h
ADDED
@@ -0,0 +1,507 @@
|
|
1
|
+
/*
|
2
|
+
* iTunes.h
|
3
|
+
*/
|
4
|
+
|
5
|
+
#import <AppKit/AppKit.h>
|
6
|
+
#import <ScriptingBridge/ScriptingBridge.h>
|
7
|
+
|
8
|
+
|
9
|
+
@class iTunesPrintSettings, iTunesApplication, iTunesItem, iTunesArtwork, iTunesEncoder, iTunesEQPreset, iTunesPlaylist, iTunesAudioCDPlaylist, iTunesDevicePlaylist, iTunesLibraryPlaylist, iTunesRadioTunerPlaylist, iTunesSource, iTunesTrack, iTunesAudioCDTrack, iTunesDeviceTrack, iTunesFileTrack, iTunesSharedTrack, iTunesURLTrack, iTunesUserPlaylist, iTunesFolderPlaylist, iTunesVisual, iTunesWindow, iTunesBrowserWindow, iTunesEQWindow, iTunesPlaylistWindow;
|
10
|
+
|
11
|
+
enum iTunesEKnd {
|
12
|
+
iTunesEKndTrackListing = 'kTrk' /* a basic listing of tracks within a playlist */,
|
13
|
+
iTunesEKndAlbumListing = 'kAlb' /* a listing of a playlist grouped by album */,
|
14
|
+
iTunesEKndCdInsert = 'kCDi' /* a printout of the playlist for jewel case inserts */
|
15
|
+
};
|
16
|
+
typedef enum iTunesEKnd iTunesEKnd;
|
17
|
+
|
18
|
+
enum iTunesEnum {
|
19
|
+
iTunesEnumStandard = 'lwst' /* Standard PostScript error handling */,
|
20
|
+
iTunesEnumDetailed = 'lwdt' /* print a detailed report of PostScript errors */
|
21
|
+
};
|
22
|
+
typedef enum iTunesEnum iTunesEnum;
|
23
|
+
|
24
|
+
enum iTunesEPlS {
|
25
|
+
iTunesEPlSStopped = 'kPSS',
|
26
|
+
iTunesEPlSPlaying = 'kPSP',
|
27
|
+
iTunesEPlSPaused = 'kPSp',
|
28
|
+
iTunesEPlSFastForwarding = 'kPSF',
|
29
|
+
iTunesEPlSRewinding = 'kPSR'
|
30
|
+
};
|
31
|
+
typedef enum iTunesEPlS iTunesEPlS;
|
32
|
+
|
33
|
+
enum iTunesERpt {
|
34
|
+
iTunesERptOff = 'kRpO',
|
35
|
+
iTunesERptOne = 'kRp1',
|
36
|
+
iTunesERptAll = 'kAll'
|
37
|
+
};
|
38
|
+
typedef enum iTunesERpt iTunesERpt;
|
39
|
+
|
40
|
+
enum iTunesEVSz {
|
41
|
+
iTunesEVSzSmall = 'kVSS',
|
42
|
+
iTunesEVSzMedium = 'kVSM',
|
43
|
+
iTunesEVSzLarge = 'kVSL'
|
44
|
+
};
|
45
|
+
typedef enum iTunesEVSz iTunesEVSz;
|
46
|
+
|
47
|
+
enum iTunesESrc {
|
48
|
+
iTunesESrcLibrary = 'kLib',
|
49
|
+
iTunesESrcIPod = 'kPod',
|
50
|
+
iTunesESrcAudioCD = 'kACD',
|
51
|
+
iTunesESrcMP3CD = 'kMCD',
|
52
|
+
iTunesESrcDevice = 'kDev',
|
53
|
+
iTunesESrcRadioTuner = 'kTun',
|
54
|
+
iTunesESrcSharedLibrary = 'kShd',
|
55
|
+
iTunesESrcUnknown = 'kUnk'
|
56
|
+
};
|
57
|
+
typedef enum iTunesESrc iTunesESrc;
|
58
|
+
|
59
|
+
enum iTunesESrA {
|
60
|
+
iTunesESrAAlbums = 'kSrL' /* albums only */,
|
61
|
+
iTunesESrAAll = 'kAll' /* all text fields */,
|
62
|
+
iTunesESrAArtists = 'kSrR' /* artists only */,
|
63
|
+
iTunesESrAComposers = 'kSrC' /* composers only */,
|
64
|
+
iTunesESrADisplayed = 'kSrV' /* visible text fields */,
|
65
|
+
iTunesESrASongs = 'kSrS' /* song names only */
|
66
|
+
};
|
67
|
+
typedef enum iTunesESrA iTunesESrA;
|
68
|
+
|
69
|
+
enum iTunesESpK {
|
70
|
+
iTunesESpKNone = 'kNon',
|
71
|
+
iTunesESpKBooks = 'kSpA',
|
72
|
+
iTunesESpKFolder = 'kSpF',
|
73
|
+
iTunesESpKGenius = 'kSpG',
|
74
|
+
iTunesESpKITunesU = 'kSpU',
|
75
|
+
iTunesESpKLibrary = 'kSpL',
|
76
|
+
iTunesESpKMovies = 'kSpI',
|
77
|
+
iTunesESpKMusic = 'kSpZ',
|
78
|
+
iTunesESpKPartyShuffle = 'kSpS',
|
79
|
+
iTunesESpKPodcasts = 'kSpP',
|
80
|
+
iTunesESpKPurchasedMusic = 'kSpM',
|
81
|
+
iTunesESpKTVShows = 'kSpT'
|
82
|
+
};
|
83
|
+
typedef enum iTunesESpK iTunesESpK;
|
84
|
+
|
85
|
+
enum iTunesEVdK {
|
86
|
+
iTunesEVdKNone = 'kNon' /* not a video or unknown video kind */,
|
87
|
+
iTunesEVdKMovie = 'kVdM' /* movie track */,
|
88
|
+
iTunesEVdKMusicVideo = 'kVdV' /* music video track */,
|
89
|
+
iTunesEVdKTVShow = 'kVdT' /* TV show track */
|
90
|
+
};
|
91
|
+
typedef enum iTunesEVdK iTunesEVdK;
|
92
|
+
|
93
|
+
enum iTunesERtK {
|
94
|
+
iTunesERtKUser = 'kRtU' /* user-specified rating */,
|
95
|
+
iTunesERtKComputed = 'kRtC' /* iTunes-computed rating */
|
96
|
+
};
|
97
|
+
typedef enum iTunesERtK iTunesERtK;
|
98
|
+
|
99
|
+
|
100
|
+
|
101
|
+
/*
|
102
|
+
* Standard Suite
|
103
|
+
*/
|
104
|
+
|
105
|
+
@interface iTunesPrintSettings : SBObject
|
106
|
+
|
107
|
+
@property (readonly) NSInteger copies; // the number of copies of a document to be printed
|
108
|
+
@property (readonly) BOOL collating; // Should printed copies be collated?
|
109
|
+
@property (readonly) NSInteger startingPage; // the first page of the document to be printed
|
110
|
+
@property (readonly) NSInteger endingPage; // the last page of the document to be printed
|
111
|
+
@property (readonly) NSInteger pagesAcross; // number of logical pages laid across a physical page
|
112
|
+
@property (readonly) NSInteger pagesDown; // number of logical pages laid out down a physical page
|
113
|
+
@property (readonly) iTunesEnum errorHandling; // how errors are handled
|
114
|
+
@property (copy, readonly) NSDate *requestedPrintTime; // the time at which the desktop printer should print the document
|
115
|
+
@property (copy, readonly) NSArray *printerFeatures; // printer specific options
|
116
|
+
@property (copy, readonly) NSString *faxNumber; // for fax number
|
117
|
+
@property (copy, readonly) NSString *targetPrinter; // for target printer
|
118
|
+
|
119
|
+
- (void) printPrintDialog:(BOOL)printDialog withProperties:(iTunesPrintSettings *)withProperties kind:(iTunesEKnd)kind theme:(NSString *)theme; // Print the specified object(s)
|
120
|
+
- (void) close; // Close an object
|
121
|
+
- (void) delete; // Delete an element from an object
|
122
|
+
- (SBObject *) duplicateTo:(SBObject *)to; // Duplicate one or more object(s)
|
123
|
+
- (BOOL) exists; // Verify if an object exists
|
124
|
+
- (void) open; // open the specified object(s)
|
125
|
+
- (void) playOnce:(BOOL)once; // play the current track or the specified track or file.
|
126
|
+
|
127
|
+
@end
|
128
|
+
|
129
|
+
|
130
|
+
|
131
|
+
/*
|
132
|
+
* iTunes Suite
|
133
|
+
*/
|
134
|
+
|
135
|
+
// The application program
|
136
|
+
@interface iTunesApplication : SBApplication
|
137
|
+
|
138
|
+
- (SBElementArray *) browserWindows;
|
139
|
+
- (SBElementArray *) encoders;
|
140
|
+
- (SBElementArray *) EQPresets;
|
141
|
+
- (SBElementArray *) EQWindows;
|
142
|
+
- (SBElementArray *) playlistWindows;
|
143
|
+
- (SBElementArray *) sources;
|
144
|
+
- (SBElementArray *) visuals;
|
145
|
+
- (SBElementArray *) windows;
|
146
|
+
|
147
|
+
@property (copy) iTunesEncoder *currentEncoder; // the currently selected encoder (MP3, AIFF, WAV, etc.)
|
148
|
+
@property (copy) iTunesEQPreset *currentEQPreset; // the currently selected equalizer preset
|
149
|
+
@property (copy, readonly) iTunesPlaylist *currentPlaylist; // the playlist containing the currently targeted track
|
150
|
+
@property (copy, readonly) NSString *currentStreamTitle; // the name of the current song in the playing stream (provided by streaming server)
|
151
|
+
@property (copy, readonly) NSString *currentStreamURL; // the URL of the playing stream or streaming web site (provided by streaming server)
|
152
|
+
@property (copy, readonly) iTunesTrack *currentTrack; // the current targeted track
|
153
|
+
@property (copy) iTunesVisual *currentVisual; // the currently selected visual plug-in
|
154
|
+
@property BOOL EQEnabled; // is the equalizer enabled?
|
155
|
+
@property BOOL fixedIndexing; // true if all AppleScript track indices should be independent of the play order of the owning playlist.
|
156
|
+
@property BOOL frontmost; // is iTunes the frontmost application?
|
157
|
+
@property BOOL fullScreen; // are visuals displayed using the entire screen?
|
158
|
+
@property (copy, readonly) NSString *name; // the name of the application
|
159
|
+
@property BOOL mute; // has the sound output been muted?
|
160
|
+
@property NSInteger playerPosition; // the player’s position within the currently playing track in seconds.
|
161
|
+
@property (readonly) iTunesEPlS playerState; // is iTunes stopped, paused, or playing?
|
162
|
+
@property (copy, readonly) SBObject *selection; // the selection visible to the user
|
163
|
+
@property NSInteger soundVolume; // the sound output volume (0 = minimum, 100 = maximum)
|
164
|
+
@property (copy, readonly) NSString *version; // the version of iTunes
|
165
|
+
@property BOOL visualsEnabled; // are visuals currently being displayed?
|
166
|
+
@property iTunesEVSz visualSize; // the size of the displayed visual
|
167
|
+
|
168
|
+
- (void) printPrintDialog:(BOOL)printDialog withProperties:(iTunesPrintSettings *)withProperties kind:(iTunesEKnd)kind theme:(NSString *)theme; // Print the specified object(s)
|
169
|
+
- (void) run; // run iTunes
|
170
|
+
- (void) quit; // quit iTunes
|
171
|
+
- (iTunesTrack *) add:(NSArray *)x to:(SBObject *)to; // add one or more files to a playlist
|
172
|
+
- (void) backTrack; // reposition to beginning of current track or go to previous track if already at start of current track
|
173
|
+
- (iTunesTrack *) convert:(NSArray *)x; // convert one or more files or tracks
|
174
|
+
- (void) fastForward; // skip forward in a playing track
|
175
|
+
- (void) nextTrack; // advance to the next track in the current playlist
|
176
|
+
- (void) pause; // pause playback
|
177
|
+
- (void) playOnce:(BOOL)once; // play the current track or the specified track or file.
|
178
|
+
- (void) playpause; // toggle the playing/paused state of the current track
|
179
|
+
- (void) previousTrack; // return to the previous track in the current playlist
|
180
|
+
- (void) resume; // disable fast forward/rewind and resume playback, if playing.
|
181
|
+
- (void) rewind; // skip backwards in a playing track
|
182
|
+
- (void) stop; // stop playback
|
183
|
+
- (void) update; // update the specified iPod
|
184
|
+
- (void) eject; // eject the specified iPod
|
185
|
+
- (void) subscribe:(NSString *)x; // subscribe to a podcast feed
|
186
|
+
- (void) updateAllPodcasts; // update all subscribed podcast feeds
|
187
|
+
- (void) updatePodcast; // update podcast feed
|
188
|
+
- (void) openLocation:(NSString *)x; // Opens a Music Store or audio stream URL
|
189
|
+
|
190
|
+
@end
|
191
|
+
|
192
|
+
// an item
|
193
|
+
@interface iTunesItem : SBObject
|
194
|
+
|
195
|
+
@property (copy, readonly) SBObject *container; // the container of the item
|
196
|
+
- (NSInteger) id; // the id of the item
|
197
|
+
@property (readonly) NSInteger index; // The index of the item in internal application order.
|
198
|
+
@property (copy) NSString *name; // the name of the item
|
199
|
+
@property (copy, readonly) NSString *persistentID; // the id of the item as a hexidecimal string. This id does not change over time.
|
200
|
+
|
201
|
+
- (void) printPrintDialog:(BOOL)printDialog withProperties:(iTunesPrintSettings *)withProperties kind:(iTunesEKnd)kind theme:(NSString *)theme; // Print the specified object(s)
|
202
|
+
- (void) close; // Close an object
|
203
|
+
- (void) delete; // Delete an element from an object
|
204
|
+
- (SBObject *) duplicateTo:(SBObject *)to; // Duplicate one or more object(s)
|
205
|
+
- (BOOL) exists; // Verify if an object exists
|
206
|
+
- (void) open; // open the specified object(s)
|
207
|
+
- (void) playOnce:(BOOL)once; // play the current track or the specified track or file.
|
208
|
+
- (void) reveal; // reveal and select a track or playlist
|
209
|
+
|
210
|
+
@end
|
211
|
+
|
212
|
+
// a piece of art within a track
|
213
|
+
@interface iTunesArtwork : iTunesItem
|
214
|
+
|
215
|
+
@property (copy) NSImage *data; // data for this artwork, in the form of a picture
|
216
|
+
@property (copy) NSString *objectDescription; // description of artwork as a string
|
217
|
+
@property (readonly) BOOL downloaded; // was this artwork downloaded by iTunes?
|
218
|
+
@property (copy, readonly) NSNumber *format; // the data format for this piece of artwork
|
219
|
+
@property NSInteger kind; // kind or purpose of this piece of artwork
|
220
|
+
@property (copy) NSData *rawData; // data for this artwork, in original format
|
221
|
+
|
222
|
+
|
223
|
+
@end
|
224
|
+
|
225
|
+
// converts a track to a specific file format
|
226
|
+
@interface iTunesEncoder : iTunesItem
|
227
|
+
|
228
|
+
@property (copy, readonly) NSString *format; // the data format created by the encoder
|
229
|
+
|
230
|
+
|
231
|
+
@end
|
232
|
+
|
233
|
+
// equalizer preset configuration
|
234
|
+
@interface iTunesEQPreset : iTunesItem
|
235
|
+
|
236
|
+
@property double band1; // the equalizer 32 Hz band level (-12.0 dB to +12.0 dB)
|
237
|
+
@property double band2; // the equalizer 64 Hz band level (-12.0 dB to +12.0 dB)
|
238
|
+
@property double band3; // the equalizer 125 Hz band level (-12.0 dB to +12.0 dB)
|
239
|
+
@property double band4; // the equalizer 250 Hz band level (-12.0 dB to +12.0 dB)
|
240
|
+
@property double band5; // the equalizer 500 Hz band level (-12.0 dB to +12.0 dB)
|
241
|
+
@property double band6; // the equalizer 1 kHz band level (-12.0 dB to +12.0 dB)
|
242
|
+
@property double band7; // the equalizer 2 kHz band level (-12.0 dB to +12.0 dB)
|
243
|
+
@property double band8; // the equalizer 4 kHz band level (-12.0 dB to +12.0 dB)
|
244
|
+
@property double band9; // the equalizer 8 kHz band level (-12.0 dB to +12.0 dB)
|
245
|
+
@property double band10; // the equalizer 16 kHz band level (-12.0 dB to +12.0 dB)
|
246
|
+
@property (readonly) BOOL modifiable; // can this preset be modified?
|
247
|
+
@property double preamp; // the equalizer preamp level (-12.0 dB to +12.0 dB)
|
248
|
+
@property BOOL updateTracks; // should tracks which refer to this preset be updated when the preset is renamed or deleted?
|
249
|
+
|
250
|
+
|
251
|
+
@end
|
252
|
+
|
253
|
+
// a list of songs/streams
|
254
|
+
@interface iTunesPlaylist : iTunesItem
|
255
|
+
|
256
|
+
- (SBElementArray *) tracks;
|
257
|
+
|
258
|
+
@property (readonly) NSInteger duration; // the total length of all songs (in seconds)
|
259
|
+
@property (copy) NSString *name; // the name of the playlist
|
260
|
+
@property (copy, readonly) iTunesPlaylist *parent; // folder which contains this playlist (if any)
|
261
|
+
@property BOOL shuffle; // play the songs in this playlist in random order?
|
262
|
+
@property (readonly) long long size; // the total size of all songs (in bytes)
|
263
|
+
@property iTunesERpt songRepeat; // playback repeat mode
|
264
|
+
@property (readonly) iTunesESpK specialKind; // special playlist kind
|
265
|
+
@property (copy, readonly) NSString *time; // the length of all songs in MM:SS format
|
266
|
+
@property (readonly) BOOL visible; // is this playlist visible in the Source list?
|
267
|
+
|
268
|
+
- (void) moveTo:(SBObject *)to; // Move playlist(s) to a new location
|
269
|
+
// fixed by dan:
|
270
|
+
- (SBElementArray *) searchFor:(NSString *)for_ only:(iTunesESrA)only; // search a playlist for tracks matching the search string. Identical to entering search text in the Search field in iTunes.
|
271
|
+
|
272
|
+
@end
|
273
|
+
|
274
|
+
// a playlist representing an audio CD
|
275
|
+
@interface iTunesAudioCDPlaylist : iTunesPlaylist
|
276
|
+
|
277
|
+
- (SBElementArray *) audioCDTracks;
|
278
|
+
|
279
|
+
@property (copy) NSString *artist; // the artist of the CD
|
280
|
+
@property BOOL compilation; // is this CD a compilation album?
|
281
|
+
@property (copy) NSString *composer; // the composer of the CD
|
282
|
+
@property NSInteger discCount; // the total number of discs in this CD’s album
|
283
|
+
@property NSInteger discNumber; // the index of this CD disc in the source album
|
284
|
+
@property (copy) NSString *genre; // the genre of the CD
|
285
|
+
@property NSInteger year; // the year the album was recorded/released
|
286
|
+
|
287
|
+
|
288
|
+
@end
|
289
|
+
|
290
|
+
// a playlist representing the contents of a portable device
|
291
|
+
@interface iTunesDevicePlaylist : iTunesPlaylist
|
292
|
+
|
293
|
+
- (SBElementArray *) deviceTracks;
|
294
|
+
|
295
|
+
|
296
|
+
@end
|
297
|
+
|
298
|
+
// the master music library playlist
|
299
|
+
@interface iTunesLibraryPlaylist : iTunesPlaylist
|
300
|
+
|
301
|
+
- (SBElementArray *) fileTracks;
|
302
|
+
- (SBElementArray *) URLTracks;
|
303
|
+
- (SBElementArray *) sharedTracks;
|
304
|
+
|
305
|
+
|
306
|
+
@end
|
307
|
+
|
308
|
+
// the radio tuner playlist
|
309
|
+
@interface iTunesRadioTunerPlaylist : iTunesPlaylist
|
310
|
+
|
311
|
+
- (SBElementArray *) URLTracks;
|
312
|
+
|
313
|
+
|
314
|
+
@end
|
315
|
+
|
316
|
+
// a music source (music library, CD, device, etc.)
|
317
|
+
@interface iTunesSource : iTunesItem
|
318
|
+
|
319
|
+
- (SBElementArray *) audioCDPlaylists;
|
320
|
+
- (SBElementArray *) devicePlaylists;
|
321
|
+
- (SBElementArray *) libraryPlaylists;
|
322
|
+
- (SBElementArray *) playlists;
|
323
|
+
- (SBElementArray *) radioTunerPlaylists;
|
324
|
+
- (SBElementArray *) userPlaylists;
|
325
|
+
|
326
|
+
@property (readonly) long long capacity; // the total size of the source if it has a fixed size
|
327
|
+
@property (readonly) long long freeSpace; // the free space on the source if it has a fixed size
|
328
|
+
@property (readonly) iTunesESrc kind;
|
329
|
+
|
330
|
+
- (void) update; // update the specified iPod
|
331
|
+
- (void) eject; // eject the specified iPod
|
332
|
+
|
333
|
+
@end
|
334
|
+
|
335
|
+
// playable audio source
|
336
|
+
@interface iTunesTrack : iTunesItem
|
337
|
+
|
338
|
+
- (SBElementArray *) artworks;
|
339
|
+
|
340
|
+
@property (copy) NSString *album; // the album name of the track
|
341
|
+
@property (copy) NSString *albumArtist; // the album artist of the track
|
342
|
+
@property NSInteger albumRating; // the rating of the album for this track (0 to 100)
|
343
|
+
@property (readonly) iTunesERtK albumRatingKind; // the rating kind of the album rating for this track
|
344
|
+
@property (copy) NSString *artist; // the artist/source of the track
|
345
|
+
@property (readonly) NSInteger bitRate; // the bit rate of the track (in kbps)
|
346
|
+
@property double bookmark; // the bookmark time of the track in seconds
|
347
|
+
@property BOOL bookmarkable; // is the playback position for this track remembered?
|
348
|
+
@property NSInteger bpm; // the tempo of this track in beats per minute
|
349
|
+
@property (copy) NSString *category; // the category of the track
|
350
|
+
@property (copy) NSString *comment; // freeform notes about the track
|
351
|
+
@property BOOL compilation; // is this track from a compilation album?
|
352
|
+
@property (copy) NSString *composer; // the composer of the track
|
353
|
+
@property (readonly) NSInteger databaseID; // the common, unique ID for this track. If two tracks in different playlists have the same database ID, they are sharing the same data.
|
354
|
+
@property (copy, readonly) NSDate *dateAdded; // the date the track was added to the playlist
|
355
|
+
@property (copy) NSString *objectDescription; // the description of the track
|
356
|
+
@property NSInteger discCount; // the total number of discs in the source album
|
357
|
+
@property NSInteger discNumber; // the index of the disc containing this track on the source album
|
358
|
+
@property (readonly) double duration; // the length of the track in seconds
|
359
|
+
@property BOOL enabled; // is this track checked for playback?
|
360
|
+
@property (copy) NSString *episodeID; // the episode ID of the track
|
361
|
+
@property NSInteger episodeNumber; // the episode number of the track
|
362
|
+
@property (copy) NSString *EQ; // the name of the EQ preset of the track
|
363
|
+
@property double finish; // the stop time of the track in seconds
|
364
|
+
@property BOOL gapless; // is this track from a gapless album?
|
365
|
+
@property (copy) NSString *genre; // the music/audio genre (category) of the track
|
366
|
+
@property (copy) NSString *grouping; // the grouping (piece) of the track. Generally used to denote movements within a classical work.
|
367
|
+
@property (copy, readonly) NSString *kind; // a text description of the track
|
368
|
+
@property (copy) NSString *longDescription;
|
369
|
+
@property (copy) NSString *lyrics; // the lyrics of the track
|
370
|
+
@property (copy, readonly) NSDate *modificationDate; // the modification date of the content of this track
|
371
|
+
@property NSInteger playedCount; // number of times this track has been played
|
372
|
+
@property (copy) NSDate *playedDate; // the date and time this track was last played
|
373
|
+
@property (readonly) BOOL podcast; // is this track a podcast episode?
|
374
|
+
@property NSInteger rating; // the rating of this track (0 to 100)
|
375
|
+
@property (readonly) iTunesERtK ratingKind; // the rating kind of this track
|
376
|
+
@property (copy, readonly) NSDate *releaseDate; // the release date of this track
|
377
|
+
@property (readonly) NSInteger sampleRate; // the sample rate of the track (in Hz)
|
378
|
+
@property NSInteger seasonNumber; // the season number of the track
|
379
|
+
@property BOOL shufflable; // is this track included when shuffling?
|
380
|
+
@property NSInteger skippedCount; // number of times this track has been skipped
|
381
|
+
@property (copy) NSDate *skippedDate; // the date and time this track was last skipped
|
382
|
+
@property (copy) NSString *show; // the show name of the track
|
383
|
+
@property (copy) NSString *sortAlbum; // override string to use for the track when sorting by album
|
384
|
+
@property (copy) NSString *sortArtist; // override string to use for the track when sorting by artist
|
385
|
+
@property (copy) NSString *sortAlbumArtist; // override string to use for the track when sorting by album artist
|
386
|
+
@property (copy) NSString *sortName; // override string to use for the track when sorting by name
|
387
|
+
@property (copy) NSString *sortComposer; // override string to use for the track when sorting by composer
|
388
|
+
@property (copy) NSString *sortShow; // override string to use for the track when sorting by show name
|
389
|
+
@property (readonly) NSInteger size; // the size of the track (in bytes)
|
390
|
+
@property double start; // the start time of the track in seconds
|
391
|
+
@property (copy, readonly) NSString *time; // the length of the track in MM:SS format
|
392
|
+
@property NSInteger trackCount; // the total number of tracks on the source album
|
393
|
+
@property NSInteger trackNumber; // the index of the track on the source album
|
394
|
+
@property BOOL unplayed; // is this track unplayed?
|
395
|
+
@property iTunesEVdK videoKind; // kind of video track
|
396
|
+
@property NSInteger volumeAdjustment; // relative volume adjustment of the track (-100% to 100%)
|
397
|
+
@property NSInteger year; // the year the track was recorded/released
|
398
|
+
|
399
|
+
|
400
|
+
@end
|
401
|
+
|
402
|
+
// a track on an audio CD
|
403
|
+
@interface iTunesAudioCDTrack : iTunesTrack
|
404
|
+
|
405
|
+
@property (copy, readonly) NSURL *location; // the location of the file represented by this track
|
406
|
+
|
407
|
+
|
408
|
+
@end
|
409
|
+
|
410
|
+
// a track residing on a portable music player
|
411
|
+
@interface iTunesDeviceTrack : iTunesTrack
|
412
|
+
|
413
|
+
|
414
|
+
@end
|
415
|
+
|
416
|
+
// a track representing an audio file (MP3, AIFF, etc.)
|
417
|
+
@interface iTunesFileTrack : iTunesTrack
|
418
|
+
|
419
|
+
@property (copy) NSURL *location; // the location of the file represented by this track
|
420
|
+
|
421
|
+
- (void) refresh; // update file track information from the current information in the track’s file
|
422
|
+
|
423
|
+
@end
|
424
|
+
|
425
|
+
// a track residing in a shared library
|
426
|
+
@interface iTunesSharedTrack : iTunesTrack
|
427
|
+
|
428
|
+
|
429
|
+
@end
|
430
|
+
|
431
|
+
// a track representing a network stream
|
432
|
+
@interface iTunesURLTrack : iTunesTrack
|
433
|
+
|
434
|
+
@property (copy) NSString *address; // the URL for this track
|
435
|
+
|
436
|
+
- (void) download; // download podcast episode
|
437
|
+
|
438
|
+
@end
|
439
|
+
|
440
|
+
// custom playlists created by the user
|
441
|
+
@interface iTunesUserPlaylist : iTunesPlaylist
|
442
|
+
|
443
|
+
- (SBElementArray *) fileTracks;
|
444
|
+
- (SBElementArray *) URLTracks;
|
445
|
+
- (SBElementArray *) sharedTracks;
|
446
|
+
|
447
|
+
@property BOOL shared; // is this playlist shared?
|
448
|
+
@property (readonly) BOOL smart; // is this a Smart Playlist?
|
449
|
+
|
450
|
+
|
451
|
+
@end
|
452
|
+
|
453
|
+
// a folder that contains other playlists
|
454
|
+
@interface iTunesFolderPlaylist : iTunesUserPlaylist
|
455
|
+
|
456
|
+
|
457
|
+
@end
|
458
|
+
|
459
|
+
// a visual plug-in
|
460
|
+
@interface iTunesVisual : iTunesItem
|
461
|
+
|
462
|
+
|
463
|
+
@end
|
464
|
+
|
465
|
+
// any window
|
466
|
+
@interface iTunesWindow : iTunesItem
|
467
|
+
|
468
|
+
@property NSRect bounds; // the boundary rectangle for the window
|
469
|
+
@property (readonly) BOOL closeable; // does the window have a close box?
|
470
|
+
@property (readonly) BOOL collapseable; // does the window have a collapse (windowshade) box?
|
471
|
+
@property BOOL collapsed; // is the window collapsed?
|
472
|
+
@property NSPoint position; // the upper left position of the window
|
473
|
+
@property (readonly) BOOL resizable; // is the window resizable?
|
474
|
+
@property BOOL visible; // is the window visible?
|
475
|
+
@property (readonly) BOOL zoomable; // is the window zoomable?
|
476
|
+
@property BOOL zoomed; // is the window zoomed?
|
477
|
+
|
478
|
+
|
479
|
+
@end
|
480
|
+
|
481
|
+
// the main iTunes window
|
482
|
+
@interface iTunesBrowserWindow : iTunesWindow
|
483
|
+
|
484
|
+
@property BOOL minimized; // is the small player visible?
|
485
|
+
@property (copy, readonly) SBObject *selection; // the selected songs
|
486
|
+
@property (copy) iTunesPlaylist *view; // the playlist currently displayed in the window
|
487
|
+
|
488
|
+
|
489
|
+
@end
|
490
|
+
|
491
|
+
// the iTunes equalizer window
|
492
|
+
@interface iTunesEQWindow : iTunesWindow
|
493
|
+
|
494
|
+
@property BOOL minimized; // is the small EQ window visible?
|
495
|
+
|
496
|
+
|
497
|
+
@end
|
498
|
+
|
499
|
+
// a sub-window showing a single playlist
|
500
|
+
@interface iTunesPlaylistWindow : iTunesWindow
|
501
|
+
|
502
|
+
@property (copy, readonly) SBObject *selection; // the selected songs
|
503
|
+
@property (copy, readonly) iTunesPlaylist *view; // the playlist displayed in the window
|
504
|
+
|
505
|
+
|
506
|
+
@end
|
507
|
+
|
data/lib/plugin.erb
ADDED
@@ -0,0 +1,10 @@
|
|
1
|
+
" Vim script that add ability to search and play iTunes tracks from Vim
|
2
|
+
" Maintainer: Daniel Choi <dhchoi@gmail.com>
|
3
|
+
" License: MIT License (c) 2011 Daniel Choi
|
4
|
+
|
5
|
+
if exists("g:ViTunesLoaded") || &cp || version < 700
|
6
|
+
finish
|
7
|
+
endif
|
8
|
+
let g:vitunes_tool = '<%= vitunes_tool_path %> '
|
9
|
+
source <%= vimscript_file %>
|
10
|
+
|
Binary file
|
data/lib/vitunes.rb
ADDED
@@ -0,0 +1,29 @@
|
|
1
|
+
#!/usr/bin/env ruby
|
2
|
+
|
3
|
+
class ViTunes
|
4
|
+
def self.install_vim_plugin
|
5
|
+
require 'erb'
|
6
|
+
plugin_template = File.read(File.join(File.dirname(__FILE__), 'plugin.erb'))
|
7
|
+
vimscript_file = File.join(File.dirname(__FILE__), 'vitunes.vim')
|
8
|
+
vitunes_tool_path = File.join(File.dirname(__FILE__), 'vitunes-tool-objc')
|
9
|
+
|
10
|
+
plugin_body = ERB.new(plugin_template).result(binding)
|
11
|
+
|
12
|
+
# fix the path to vitunes-tool-objc
|
13
|
+
#
|
14
|
+
`mkdir -p #{ENV['HOME']}/.vim/plugin`
|
15
|
+
File.open("#{ENV['HOME']}/.vim/plugin/vitunes.vim", "w") {|f| f.write plugin_body}
|
16
|
+
puts "Installed vitunes.vim into your ~/.vim/plugin directory"
|
17
|
+
puts "You should be able to invoke ViTunes in Vim with <Leader>i"
|
18
|
+
end
|
19
|
+
|
20
|
+
def self.help
|
21
|
+
readme = File.expand_path("../../README.markdown", __FILE__)
|
22
|
+
help = "ViTunes help\n\n" + File.read(readme).split("## How to use it")[1].strip
|
23
|
+
end
|
24
|
+
end
|
25
|
+
|
26
|
+
if __FILE__ == $0
|
27
|
+
ViTunes.install_vim_plugin
|
28
|
+
end
|
29
|
+
|