Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

initialize

  • Loading branch information...
commit d0471fe17db011e21e06059cec0433d5d0678968 0 parents
@plukevdh authored
8 LICENSE.md
@@ -0,0 +1,8 @@
+Copyright (c) 2012 Luke van der Hoeven
+
+Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
+
+The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+
35 README.md
@@ -0,0 +1,35 @@
+Based on this tweet: https://twitter.com/joshaber/status/175230633033994240
+
+__For realz.__
+
+Created with macruby 0.10. Should work down to 0.5 I believe.
+
+Defaults:
+* Need an empty playlist named "Top Tracks" or create your own and change the PLAYLIST const.
+* Adjust the DELIMITER to your liking. Mine plays out nicely at 3-5.
+
+Explanation:
+---
+The algorithm takes the average play count (disregarding the highest and lowest count for good measure) for each album, and then se​​lects any songs in that album with a play count > DELIMITER
+
+To run:
+---
+just run `macruby counter.rb`
+
+Problem solving:
+---
+There shouldn't be any.
+If there are, you may need to build the iTunes bridge support files for your machine. Simply run:
+
+`sdef /Applications/iTunes.app | sdp -fh --basename iTunes`
+_and_
+`gen_bridge_metadata -c '-I.' iTunes.h > iTunes.bridgesupport`
+
+
+???:
+___
+Profit.
+
+License:
+___
+See LICENSE.md
39 counter.rb
@@ -0,0 +1,39 @@
+#!/usr/local/bin/macruby
+framework 'Foundation'
+framework 'ScriptingBridge'
+
+itunes = SBApplication.applicationWithBundleIdentifier("com.apple.itunes")
+load_bridge_support_file 'iTunes.bridgesupport'
+itunes.run
+
+class SBElementArray
+ def [](value)
+ self.objectWithName(value)
+ end
+end
+
+DELIMITER = 5
+PLAYLIST = "Top Tracks"
+
+tracks = itunes.sources["Library"].userPlaylists["Music"].fileTracks
+albums = {}
+
+tracks.each do |track|
+ albums[track.album] ||= []
+ albums[track.album] << track if track.album.strip != ""
+end
+
+top_tracks = albums.flat_map do |title, tracks|
+ next if tracks.empty?
+
+ # get counts and reject minmax
+ counts = tracks.map &:playedCount
+ counts -= counts.minmax unless counts.count < 2
+
+ next if counts.empty? || counts == 0
+
+ avg = ( counts.inject(0,&:+) / counts.count )
+ tracks.select { |track| track.playedCount > (avg + DELIMITER) }
+end
+
+itunes.add top_tracks.compact.map(&:location), to: itunes.sources["Library"].playlists[PLAYLIST]
256 iTunes.bridgesupport
@@ -0,0 +1,256 @@
+<?xml version='1.0'?>
+<!DOCTYPE signatures SYSTEM "file://localhost/System/Library/DTDs/BridgeSupport.dtd">
+<signatures version='1.0'>
+<enum name='iTunesEKndAlbumListing' value='1799449698'/>
+<enum name='iTunesEKndCdInsert' value='1799570537'/>
+<enum name='iTunesEKndTrackListing' value='1800696427'/>
+<enum name='iTunesEPlSFastForwarding' value='1800426310'/>
+<enum name='iTunesEPlSPaused' value='1800426352'/>
+<enum name='iTunesEPlSPlaying' value='1800426320'/>
+<enum name='iTunesEPlSRewinding' value='1800426322'/>
+<enum name='iTunesEPlSStopped' value='1800426323'/>
+<enum name='iTunesERptAll' value='1799449708'/>
+<enum name='iTunesERptOff' value='1800564815'/>
+<enum name='iTunesERptOne' value='1800564785'/>
+<enum name='iTunesERtKComputed' value='1800565827'/>
+<enum name='iTunesERtKUser' value='1800565845'/>
+<enum name='iTunesESpKBooks' value='1800630337'/>
+<enum name='iTunesESpKFolder' value='1800630342'/>
+<enum name='iTunesESpKGenius' value='1800630343'/>
+<enum name='iTunesESpKITunesU' value='1800630357'/>
+<enum name='iTunesESpKLibrary' value='1800630348'/>
+<enum name='iTunesESpKMovies' value='1800630345'/>
+<enum name='iTunesESpKMusic' value='1800630362'/>
+<enum name='iTunesESpKNone' value='1800302446'/>
+<enum name='iTunesESpKPartyShuffle' value='1800630355'/>
+<enum name='iTunesESpKPodcasts' value='1800630352'/>
+<enum name='iTunesESpKPurchasedMusic' value='1800630349'/>
+<enum name='iTunesESpKTVShows' value='1800630356'/>
+<enum name='iTunesESrAAlbums' value='1800630860'/>
+<enum name='iTunesESrAAll' value='1799449708'/>
+<enum name='iTunesESrAArtists' value='1800630866'/>
+<enum name='iTunesESrAComposers' value='1800630851'/>
+<enum name='iTunesESrADisplayed' value='1800630870'/>
+<enum name='iTunesESrASongs' value='1800630867'/>
+<enum name='iTunesESrcAudioCD' value='1799439172'/>
+<enum name='iTunesESrcDevice' value='1799644534'/>
+<enum name='iTunesESrcIPod' value='1800433508'/>
+<enum name='iTunesESrcLibrary' value='1800169826'/>
+<enum name='iTunesESrcMP3CD' value='1800225604'/>
+<enum name='iTunesESrcRadioTuner' value='1800697198'/>
+<enum name='iTunesESrcSharedLibrary' value='1800628324'/>
+<enum name='iTunesESrcUnknown' value='1800760939'/>
+<enum name='iTunesEVSzLarge' value='1800819532'/>
+<enum name='iTunesEVSzMedium' value='1800819533'/>
+<enum name='iTunesEVSzSmall' value='1800819539'/>
+<enum name='iTunesEVdKMovie' value='1800823885'/>
+<enum name='iTunesEVdKMusicVideo' value='1800823894'/>
+<enum name='iTunesEVdKNone' value='1800302446'/>
+<enum name='iTunesEVdKTVShow' value='1800823892'/>
+<enum name='iTunesEnumDetailed' value='1819763828'/>
+<enum name='iTunesEnumStandard' value='1819767668'/>
+<class name='iTunesApplication'>
+<method selector='EQEnabled'>
+<retval type='B'/>
+</method>
+<method selector='fixedIndexing'>
+<retval type='B'/>
+</method>
+<method selector='frontmost'>
+<retval type='B'/>
+</method>
+<method selector='fullScreen'>
+<retval type='B'/>
+</method>
+<method selector='mute'>
+<retval type='B'/>
+</method>
+<method selector='playOnce:'>
+<arg type='B' index='0'/>
+</method>
+<method selector='printPrintDialog:withProperties:kind:theme:'>
+<arg type='B' index='0'/>
+</method>
+<method selector='setEQEnabled:'>
+<arg type='B' index='0'/>
+</method>
+<method selector='setFixedIndexing:'>
+<arg type='B' index='0'/>
+</method>
+<method selector='setFrontmost:'>
+<arg type='B' index='0'/>
+</method>
+<method selector='setFullScreen:'>
+<arg type='B' index='0'/>
+</method>
+<method selector='setMute:'>
+<arg type='B' index='0'/>
+</method>
+<method selector='setVisualsEnabled:'>
+<arg type='B' index='0'/>
+</method>
+<method selector='visualsEnabled'>
+<retval type='B'/>
+</method>
+</class>
+<class name='iTunesArtwork'>
+<method selector='downloaded'>
+<retval type='B'/>
+</method>
+</class>
+<class name='iTunesAudioCDPlaylist'>
+<method selector='compilation'>
+<retval type='B'/>
+</method>
+<method selector='setCompilation:'>
+<arg type='B' index='0'/>
+</method>
+</class>
+<class name='iTunesBrowserWindow'>
+<method selector='minimized'>
+<retval type='B'/>
+</method>
+<method selector='setMinimized:'>
+<arg type='B' index='0'/>
+</method>
+</class>
+<class name='iTunesEQPreset'>
+<method selector='modifiable'>
+<retval type='B'/>
+</method>
+<method selector='setUpdateTracks:'>
+<arg type='B' index='0'/>
+</method>
+<method selector='updateTracks'>
+<retval type='B'/>
+</method>
+</class>
+<class name='iTunesEQWindow'>
+<method selector='minimized'>
+<retval type='B'/>
+</method>
+<method selector='setMinimized:'>
+<arg type='B' index='0'/>
+</method>
+</class>
+<class name='iTunesItem'>
+<method selector='exists'>
+<retval type='B'/>
+</method>
+<method selector='playOnce:'>
+<arg type='B' index='0'/>
+</method>
+<method selector='printPrintDialog:withProperties:kind:theme:'>
+<arg type='B' index='0'/>
+</method>
+</class>
+<class name='iTunesPlaylist'>
+<method selector='setShuffle:'>
+<arg type='B' index='0'/>
+</method>
+<method selector='shuffle'>
+<retval type='B'/>
+</method>
+<method selector='visible'>
+<retval type='B'/>
+</method>
+</class>
+<class name='iTunesPrintSettings'>
+<method selector='collating'>
+<retval type='B'/>
+</method>
+<method selector='exists'>
+<retval type='B'/>
+</method>
+<method selector='playOnce:'>
+<arg type='B' index='0'/>
+</method>
+<method selector='printPrintDialog:withProperties:kind:theme:'>
+<arg type='B' index='0'/>
+</method>
+</class>
+<class name='iTunesTrack'>
+<method selector='bookmarkable'>
+<retval type='B'/>
+</method>
+<method selector='compilation'>
+<retval type='B'/>
+</method>
+<method selector='enabled'>
+<retval type='B'/>
+</method>
+<method selector='gapless'>
+<retval type='B'/>
+</method>
+<method selector='podcast'>
+<retval type='B'/>
+</method>
+<method selector='setBookmarkable:'>
+<arg type='B' index='0'/>
+</method>
+<method selector='setCompilation:'>
+<arg type='B' index='0'/>
+</method>
+<method selector='setEnabled:'>
+<arg type='B' index='0'/>
+</method>
+<method selector='setGapless:'>
+<arg type='B' index='0'/>
+</method>
+<method selector='setShufflable:'>
+<arg type='B' index='0'/>
+</method>
+<method selector='setUnplayed:'>
+<arg type='B' index='0'/>
+</method>
+<method selector='shufflable'>
+<retval type='B'/>
+</method>
+<method selector='unplayed'>
+<retval type='B'/>
+</method>
+</class>
+<class name='iTunesUserPlaylist'>
+<method selector='setShared:'>
+<arg type='B' index='0'/>
+</method>
+<method selector='shared'>
+<retval type='B'/>
+</method>
+<method selector='smart'>
+<retval type='B'/>
+</method>
+</class>
+<class name='iTunesWindow'>
+<method selector='closeable'>
+<retval type='B'/>
+</method>
+<method selector='collapseable'>
+<retval type='B'/>
+</method>
+<method selector='collapsed'>
+<retval type='B'/>
+</method>
+<method selector='resizable'>
+<retval type='B'/>
+</method>
+<method selector='setCollapsed:'>
+<arg type='B' index='0'/>
+</method>
+<method selector='setVisible:'>
+<arg type='B' index='0'/>
+</method>
+<method selector='setZoomed:'>
+<arg type='B' index='0'/>
+</method>
+<method selector='visible'>
+<retval type='B'/>
+</method>
+<method selector='zoomable'>
+<retval type='B'/>
+</method>
+<method selector='zoomed'>
+<retval type='B'/>
+</method>
+</class>
+</signatures>
506 iTunes.h
@@ -0,0 +1,506 @@
+/*
+ * iTunes.h
+ */
+
+#import <AppKit/AppKit.h>
+#import <ScriptingBridge/ScriptingBridge.h>
+
+
+@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;
+
+enum iTunesEKnd {
+ iTunesEKndTrackListing = 'kTrk' /* a basic listing of tracks within a playlist */,
+ iTunesEKndAlbumListing = 'kAlb' /* a listing of a playlist grouped by album */,
+ iTunesEKndCdInsert = 'kCDi' /* a printout of the playlist for jewel case inserts */
+};
+typedef enum iTunesEKnd iTunesEKnd;
+
+enum iTunesEnum {
+ iTunesEnumStandard = 'lwst' /* Standard PostScript error handling */,
+ iTunesEnumDetailed = 'lwdt' /* print a detailed report of PostScript errors */
+};
+typedef enum iTunesEnum iTunesEnum;
+
+enum iTunesEPlS {
+ iTunesEPlSStopped = 'kPSS',
+ iTunesEPlSPlaying = 'kPSP',
+ iTunesEPlSPaused = 'kPSp',
+ iTunesEPlSFastForwarding = 'kPSF',
+ iTunesEPlSRewinding = 'kPSR'
+};
+typedef enum iTunesEPlS iTunesEPlS;
+
+enum iTunesERpt {
+ iTunesERptOff = 'kRpO',
+ iTunesERptOne = 'kRp1',
+ iTunesERptAll = 'kAll'
+};
+typedef enum iTunesERpt iTunesERpt;
+
+enum iTunesEVSz {
+ iTunesEVSzSmall = 'kVSS',
+ iTunesEVSzMedium = 'kVSM',
+ iTunesEVSzLarge = 'kVSL'
+};
+typedef enum iTunesEVSz iTunesEVSz;
+
+enum iTunesESrc {
+ iTunesESrcLibrary = 'kLib',
+ iTunesESrcIPod = 'kPod',
+ iTunesESrcAudioCD = 'kACD',
+ iTunesESrcMP3CD = 'kMCD',
+ iTunesESrcDevice = 'kDev',
+ iTunesESrcRadioTuner = 'kTun',
+ iTunesESrcSharedLibrary = 'kShd',
+ iTunesESrcUnknown = 'kUnk'
+};
+typedef enum iTunesESrc iTunesESrc;
+
+enum iTunesESrA {
+ iTunesESrAAlbums = 'kSrL' /* albums only */,
+ iTunesESrAAll = 'kAll' /* all text fields */,
+ iTunesESrAArtists = 'kSrR' /* artists only */,
+ iTunesESrAComposers = 'kSrC' /* composers only */,
+ iTunesESrADisplayed = 'kSrV' /* visible text fields */,
+ iTunesESrASongs = 'kSrS' /* song names only */
+};
+typedef enum iTunesESrA iTunesESrA;
+
+enum iTunesESpK {
+ iTunesESpKNone = 'kNon',
+ iTunesESpKBooks = 'kSpA',
+ iTunesESpKFolder = 'kSpF',
+ iTunesESpKGenius = 'kSpG',
+ iTunesESpKITunesU = 'kSpU',
+ iTunesESpKLibrary = 'kSpL',
+ iTunesESpKMovies = 'kSpI',
+ iTunesESpKMusic = 'kSpZ',
+ iTunesESpKPartyShuffle = 'kSpS',
+ iTunesESpKPodcasts = 'kSpP',
+ iTunesESpKPurchasedMusic = 'kSpM',
+ iTunesESpKTVShows = 'kSpT'
+};
+typedef enum iTunesESpK iTunesESpK;
+
+enum iTunesEVdK {
+ iTunesEVdKNone = 'kNon' /* not a video or unknown video kind */,
+ iTunesEVdKMovie = 'kVdM' /* movie track */,
+ iTunesEVdKMusicVideo = 'kVdV' /* music video track */,
+ iTunesEVdKTVShow = 'kVdT' /* TV show track */
+};
+typedef enum iTunesEVdK iTunesEVdK;
+
+enum iTunesERtK {
+ iTunesERtKUser = 'kRtU' /* user-specified rating */,
+ iTunesERtKComputed = 'kRtC' /* iTunes-computed rating */
+};
+typedef enum iTunesERtK iTunesERtK;
+
+
+
+/*
+ * Standard Suite
+ */
+
+@interface iTunesPrintSettings : SBObject
+
+@property (readonly) NSInteger copies; // the number of copies of a document to be printed
+@property (readonly) BOOL collating; // Should printed copies be collated?
+@property (readonly) NSInteger startingPage; // the first page of the document to be printed
+@property (readonly) NSInteger endingPage; // the last page of the document to be printed
+@property (readonly) NSInteger pagesAcross; // number of logical pages laid across a physical page
+@property (readonly) NSInteger pagesDown; // number of logical pages laid out down a physical page
+@property (readonly) iTunesEnum errorHandling; // how errors are handled
+@property (copy, readonly) NSDate *requestedPrintTime; // the time at which the desktop printer should print the document
+@property (copy, readonly) NSArray *printerFeatures; // printer specific options
+@property (copy, readonly) NSString *faxNumber; // for fax number
+@property (copy, readonly) NSString *targetPrinter; // for target printer
+
+- (void) printPrintDialog:(BOOL)printDialog withProperties:(iTunesPrintSettings *)withProperties kind:(iTunesEKnd)kind theme:(NSString *)theme; // Print the specified object(s)
+- (void) close; // Close an object
+- (void) delete; // Delete an element from an object
+- (SBObject *) duplicateTo:(SBObject *)to; // Duplicate one or more object(s)
+- (BOOL) exists; // Verify if an object exists
+- (void) open; // open the specified object(s)
+- (void) playOnce:(BOOL)once; // play the current track or the specified track or file.
+
+@end
+
+
+
+/*
+ * iTunes Suite
+ */
+
+// The application program
+@interface iTunesApplication : SBApplication
+
+- (SBElementArray *) browserWindows;
+- (SBElementArray *) encoders;
+- (SBElementArray *) EQPresets;
+- (SBElementArray *) EQWindows;
+- (SBElementArray *) playlistWindows;
+- (SBElementArray *) sources;
+- (SBElementArray *) visuals;
+- (SBElementArray *) windows;
+
+@property (copy) iTunesEncoder *currentEncoder; // the currently selected encoder (MP3, AIFF, WAV, etc.)
+@property (copy) iTunesEQPreset *currentEQPreset; // the currently selected equalizer preset
+@property (copy, readonly) iTunesPlaylist *currentPlaylist; // the playlist containing the currently targeted track
+@property (copy, readonly) NSString *currentStreamTitle; // the name of the current song in the playing stream (provided by streaming server)
+@property (copy, readonly) NSString *currentStreamURL; // the URL of the playing stream or streaming web site (provided by streaming server)
+@property (copy, readonly) iTunesTrack *currentTrack; // the current targeted track
+@property (copy) iTunesVisual *currentVisual; // the currently selected visual plug-in
+@property BOOL EQEnabled; // is the equalizer enabled?
+@property BOOL fixedIndexing; // true if all AppleScript track indices should be independent of the play order of the owning playlist.
+@property BOOL frontmost; // is iTunes the frontmost application?
+@property BOOL fullScreen; // are visuals displayed using the entire screen?
+@property (copy, readonly) NSString *name; // the name of the application
+@property BOOL mute; // has the sound output been muted?
+@property NSInteger playerPosition; // the player’s position within the currently playing track in seconds.
+@property (readonly) iTunesEPlS playerState; // is iTunes stopped, paused, or playing?
+@property (copy, readonly) SBObject *selection; // the selection visible to the user
+@property NSInteger soundVolume; // the sound output volume (0 = minimum, 100 = maximum)
+@property (copy, readonly) NSString *version; // the version of iTunes
+@property BOOL visualsEnabled; // are visuals currently being displayed?
+@property iTunesEVSz visualSize; // the size of the displayed visual
+
+- (void) printPrintDialog:(BOOL)printDialog withProperties:(iTunesPrintSettings *)withProperties kind:(iTunesEKnd)kind theme:(NSString *)theme; // Print the specified object(s)
+- (void) run; // run iTunes
+- (void) quit; // quit iTunes
+- (iTunesTrack *) add:(NSArray *)x to:(SBObject *)to; // add one or more files to a playlist
+- (void) backTrack; // reposition to beginning of current track or go to previous track if already at start of current track
+- (iTunesTrack *) convert:(NSArray *)x; // convert one or more files or tracks
+- (void) fastForward; // skip forward in a playing track
+- (void) nextTrack; // advance to the next track in the current playlist
+- (void) pause; // pause playback
+- (void) playOnce:(BOOL)once; // play the current track or the specified track or file.
+- (void) playpause; // toggle the playing/paused state of the current track
+- (void) previousTrack; // return to the previous track in the current playlist
+- (void) resume; // disable fast forward/rewind and resume playback, if playing.
+- (void) rewind; // skip backwards in a playing track
+- (void) stop; // stop playback
+- (void) update; // update the specified iPod
+- (void) eject; // eject the specified iPod
+- (void) subscribe:(NSString *)x; // subscribe to a podcast feed
+- (void) updateAllPodcasts; // update all subscribed podcast feeds
+- (void) updatePodcast; // update podcast feed
+- (void) openLocation:(NSString *)x; // Opens a Music Store or audio stream URL
+
+@end
+
+// an item
+@interface iTunesItem : SBObject
+
+@property (copy, readonly) SBObject *container; // the container of the item
+- (NSInteger) id; // the id of the item
+@property (readonly) NSInteger index; // The index of the item in internal application order.
+@property (copy) NSString *name; // the name of the item
+@property (copy, readonly) NSString *persistentID; // the id of the item as a hexidecimal string. This id does not change over time.
+
+- (void) printPrintDialog:(BOOL)printDialog withProperties:(iTunesPrintSettings *)withProperties kind:(iTunesEKnd)kind theme:(NSString *)theme; // Print the specified object(s)
+- (void) close; // Close an object
+- (void) delete; // Delete an element from an object
+- (SBObject *) duplicateTo:(SBObject *)to; // Duplicate one or more object(s)
+- (BOOL) exists; // Verify if an object exists
+- (void) open; // open the specified object(s)
+- (void) playOnce:(BOOL)once; // play the current track or the specified track or file.
+- (void) reveal; // reveal and select a track or playlist
+
+@end
+
+// a piece of art within a track
+@interface iTunesArtwork : iTunesItem
+
+@property (copy) NSImage *data; // data for this artwork, in the form of a picture
+@property (copy) NSString *objectDescription; // description of artwork as a string
+@property (readonly) BOOL downloaded; // was this artwork downloaded by iTunes?
+@property (copy, readonly) NSNumber *format; // the data format for this piece of artwork
+@property NSInteger kind; // kind or purpose of this piece of artwork
+@property (copy) NSData *rawData; // data for this artwork, in original format
+
+
+@end
+
+// converts a track to a specific file format
+@interface iTunesEncoder : iTunesItem
+
+@property (copy, readonly) NSString *format; // the data format created by the encoder
+
+
+@end
+
+// equalizer preset configuration
+@interface iTunesEQPreset : iTunesItem
+
+@property double band1; // the equalizer 32 Hz band level (-12.0 dB to +12.0 dB)
+@property double band2; // the equalizer 64 Hz band level (-12.0 dB to +12.0 dB)
+@property double band3; // the equalizer 125 Hz band level (-12.0 dB to +12.0 dB)
+@property double band4; // the equalizer 250 Hz band level (-12.0 dB to +12.0 dB)
+@property double band5; // the equalizer 500 Hz band level (-12.0 dB to +12.0 dB)
+@property double band6; // the equalizer 1 kHz band level (-12.0 dB to +12.0 dB)
+@property double band7; // the equalizer 2 kHz band level (-12.0 dB to +12.0 dB)
+@property double band8; // the equalizer 4 kHz band level (-12.0 dB to +12.0 dB)
+@property double band9; // the equalizer 8 kHz band level (-12.0 dB to +12.0 dB)
+@property double band10; // the equalizer 16 kHz band level (-12.0 dB to +12.0 dB)
+@property (readonly) BOOL modifiable; // can this preset be modified?
+@property double preamp; // the equalizer preamp level (-12.0 dB to +12.0 dB)
+@property BOOL updateTracks; // should tracks which refer to this preset be updated when the preset is renamed or deleted?
+
+
+@end
+
+// a list of songs/streams
+@interface iTunesPlaylist : iTunesItem
+
+- (SBElementArray *) tracks;
+
+@property (readonly) NSInteger duration; // the total length of all songs (in seconds)
+@property (copy) NSString *name; // the name of the playlist
+@property (copy, readonly) iTunesPlaylist *parent; // folder which contains this playlist (if any)
+@property BOOL shuffle; // play the songs in this playlist in random order?
+@property (readonly) long long size; // the total size of all songs (in bytes)
+@property iTunesERpt songRepeat; // playback repeat mode
+@property (readonly) iTunesESpK specialKind; // special playlist kind
+@property (copy, readonly) NSString *time; // the length of all songs in MM:SS format
+@property (readonly) BOOL visible; // is this playlist visible in the Source list?
+
+- (void) moveTo:(SBObject *)to; // Move playlist(s) to a new location
+- (iTunesTrack *) 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.
+
+@end
+
+// a playlist representing an audio CD
+@interface iTunesAudioCDPlaylist : iTunesPlaylist
+
+- (SBElementArray *) audioCDTracks;
+
+@property (copy) NSString *artist; // the artist of the CD
+@property BOOL compilation; // is this CD a compilation album?
+@property (copy) NSString *composer; // the composer of the CD
+@property NSInteger discCount; // the total number of discs in this CD’s album
+@property NSInteger discNumber; // the index of this CD disc in the source album
+@property (copy) NSString *genre; // the genre of the CD
+@property NSInteger year; // the year the album was recorded/released
+
+
+@end
+
+// a playlist representing the contents of a portable device
+@interface iTunesDevicePlaylist : iTunesPlaylist
+
+- (SBElementArray *) deviceTracks;
+
+
+@end
+
+// the master music library playlist
+@interface iTunesLibraryPlaylist : iTunesPlaylist
+
+- (SBElementArray *) fileTracks;
+- (SBElementArray *) URLTracks;
+- (SBElementArray *) sharedTracks;
+
+
+@end
+
+// the radio tuner playlist
+@interface iTunesRadioTunerPlaylist : iTunesPlaylist
+
+- (SBElementArray *) URLTracks;
+
+
+@end
+
+// a music source (music library, CD, device, etc.)
+@interface iTunesSource : iTunesItem
+
+- (SBElementArray *) audioCDPlaylists;
+- (SBElementArray *) devicePlaylists;
+- (SBElementArray *) libraryPlaylists;
+- (SBElementArray *) playlists;
+- (SBElementArray *) radioTunerPlaylists;
+- (SBElementArray *) userPlaylists;
+
+@property (readonly) long long capacity; // the total size of the source if it has a fixed size
+@property (readonly) long long freeSpace; // the free space on the source if it has a fixed size
+@property (readonly) iTunesESrc kind;
+
+- (void) update; // update the specified iPod
+- (void) eject; // eject the specified iPod
+
+@end
+
+// playable audio source
+@interface iTunesTrack : iTunesItem
+
+- (SBElementArray *) artworks;
+
+@property (copy) NSString *album; // the album name of the track
+@property (copy) NSString *albumArtist; // the album artist of the track
+@property NSInteger albumRating; // the rating of the album for this track (0 to 100)
+@property (readonly) iTunesERtK albumRatingKind; // the rating kind of the album rating for this track
+@property (copy) NSString *artist; // the artist/source of the track
+@property (readonly) NSInteger bitRate; // the bit rate of the track (in kbps)
+@property double bookmark; // the bookmark time of the track in seconds
+@property BOOL bookmarkable; // is the playback position for this track remembered?
+@property NSInteger bpm; // the tempo of this track in beats per minute
+@property (copy) NSString *category; // the category of the track
+@property (copy) NSString *comment; // freeform notes about the track
+@property BOOL compilation; // is this track from a compilation album?
+@property (copy) NSString *composer; // the composer of the track
+@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.
+@property (copy, readonly) NSDate *dateAdded; // the date the track was added to the playlist
+@property (copy) NSString *objectDescription; // the description of the track
+@property NSInteger discCount; // the total number of discs in the source album
+@property NSInteger discNumber; // the index of the disc containing this track on the source album
+@property (readonly) double duration; // the length of the track in seconds
+@property BOOL enabled; // is this track checked for playback?
+@property (copy) NSString *episodeID; // the episode ID of the track
+@property NSInteger episodeNumber; // the episode number of the track
+@property (copy) NSString *EQ; // the name of the EQ preset of the track
+@property double finish; // the stop time of the track in seconds
+@property BOOL gapless; // is this track from a gapless album?
+@property (copy) NSString *genre; // the music/audio genre (category) of the track
+@property (copy) NSString *grouping; // the grouping (piece) of the track. Generally used to denote movements within a classical work.
+@property (copy, readonly) NSString *kind; // a text description of the track
+@property (copy) NSString *longDescription;
+@property (copy) NSString *lyrics; // the lyrics of the track
+@property (copy, readonly) NSDate *modificationDate; // the modification date of the content of this track
+@property NSInteger playedCount; // number of times this track has been played
+@property (copy) NSDate *playedDate; // the date and time this track was last played
+@property (readonly) BOOL podcast; // is this track a podcast episode?
+@property NSInteger rating; // the rating of this track (0 to 100)
+@property (readonly) iTunesERtK ratingKind; // the rating kind of this track
+@property (copy, readonly) NSDate *releaseDate; // the release date of this track
+@property (readonly) NSInteger sampleRate; // the sample rate of the track (in Hz)
+@property NSInteger seasonNumber; // the season number of the track
+@property BOOL shufflable; // is this track included when shuffling?
+@property NSInteger skippedCount; // number of times this track has been skipped
+@property (copy) NSDate *skippedDate; // the date and time this track was last skipped
+@property (copy) NSString *show; // the show name of the track
+@property (copy) NSString *sortAlbum; // override string to use for the track when sorting by album
+@property (copy) NSString *sortArtist; // override string to use for the track when sorting by artist
+@property (copy) NSString *sortAlbumArtist; // override string to use for the track when sorting by album artist
+@property (copy) NSString *sortName; // override string to use for the track when sorting by name
+@property (copy) NSString *sortComposer; // override string to use for the track when sorting by composer
+@property (copy) NSString *sortShow; // override string to use for the track when sorting by show name
+@property (readonly) NSInteger size; // the size of the track (in bytes)
+@property double start; // the start time of the track in seconds
+@property (copy, readonly) NSString *time; // the length of the track in MM:SS format
+@property NSInteger trackCount; // the total number of tracks on the source album
+@property NSInteger trackNumber; // the index of the track on the source album
+@property BOOL unplayed; // is this track unplayed?
+@property iTunesEVdK videoKind; // kind of video track
+@property NSInteger volumeAdjustment; // relative volume adjustment of the track (-100% to 100%)
+@property NSInteger year; // the year the track was recorded/released
+
+
+@end
+
+// a track on an audio CD
+@interface iTunesAudioCDTrack : iTunesTrack
+
+@property (copy, readonly) NSURL *location; // the location of the file represented by this track
+
+
+@end
+
+// a track residing on a portable music player
+@interface iTunesDeviceTrack : iTunesTrack
+
+
+@end
+
+// a track representing an audio file (MP3, AIFF, etc.)
+@interface iTunesFileTrack : iTunesTrack
+
+@property (copy) NSURL *location; // the location of the file represented by this track
+
+- (void) refresh; // update file track information from the current information in the track’s file
+
+@end
+
+// a track residing in a shared library
+@interface iTunesSharedTrack : iTunesTrack
+
+
+@end
+
+// a track representing a network stream
+@interface iTunesURLTrack : iTunesTrack
+
+@property (copy) NSString *address; // the URL for this track
+
+- (void) download; // download podcast episode
+
+@end
+
+// custom playlists created by the user
+@interface iTunesUserPlaylist : iTunesPlaylist
+
+- (SBElementArray *) fileTracks;
+- (SBElementArray *) URLTracks;
+- (SBElementArray *) sharedTracks;
+
+@property BOOL shared; // is this playlist shared?
+@property (readonly) BOOL smart; // is this a Smart Playlist?
+
+
+@end
+
+// a folder that contains other playlists
+@interface iTunesFolderPlaylist : iTunesUserPlaylist
+
+
+@end
+
+// a visual plug-in
+@interface iTunesVisual : iTunesItem
+
+
+@end
+
+// any window
+@interface iTunesWindow : iTunesItem
+
+@property NSRect bounds; // the boundary rectangle for the window
+@property (readonly) BOOL closeable; // does the window have a close box?
+@property (readonly) BOOL collapseable; // does the window have a collapse (windowshade) box?
+@property BOOL collapsed; // is the window collapsed?
+@property NSPoint position; // the upper left position of the window
+@property (readonly) BOOL resizable; // is the window resizable?
+@property BOOL visible; // is the window visible?
+@property (readonly) BOOL zoomable; // is the window zoomable?
+@property BOOL zoomed; // is the window zoomed?
+
+
+@end
+
+// the main iTunes window
+@interface iTunesBrowserWindow : iTunesWindow
+
+@property BOOL minimized; // is the small player visible?
+@property (copy, readonly) SBObject *selection; // the selected songs
+@property (copy) iTunesPlaylist *view; // the playlist currently displayed in the window
+
+
+@end
+
+// the iTunes equalizer window
+@interface iTunesEQWindow : iTunesWindow
+
+@property BOOL minimized; // is the small EQ window visible?
+
+
+@end
+
+// a sub-window showing a single playlist
+@interface iTunesPlaylistWindow : iTunesWindow
+
+@property (copy, readonly) SBObject *selection; // the selected songs
+@property (copy, readonly) iTunesPlaylist *view; // the playlist displayed in the window
+
+
+@end
+
Please sign in to comment.
Something went wrong with that request. Please try again.