itch 1.0.4 → 1.0.5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- data/README.txt +91 -31
 - data/lib/itch.rb +4 -5
 - metadata +2 -2
 
    
        data/README.txt
    CHANGED
    
    | 
         @@ -5,10 +5,12 @@ itch - Control Helper for ITunes - Perform operations on iTunes tracks. 
     | 
|
| 
       5 
5 
     | 
    
         | 
| 
       6 
6 
     | 
    
         
             
            == Usage
         
     | 
| 
       7 
7 
     | 
    
         | 
| 
      
 8 
     | 
    
         
            +
            Usage: itch [options]
         
     | 
| 
       8 
9 
     | 
    
         
             
            Program help:
         
     | 
| 
       9 
10 
     | 
    
         
             
                -h, --help                       Display program help.
         
     | 
| 
       10 
11 
     | 
    
         
             
            Playback controls:
         
     | 
| 
       11 
     | 
    
         
            -
                -p, --play-pause                 If currently paused, begin playing.  If 
     | 
| 
      
 12 
     | 
    
         
            +
                -p, --play-pause                 If currently paused, begin playing.  If
         
     | 
| 
      
 13 
     | 
    
         
            +
                                                 currently playing, pause playback.
         
     | 
| 
       12 
14 
     | 
    
         
             
                    --pause                      Pause playback.
         
     | 
| 
       13 
15 
     | 
    
         
             
                    --play                       Play the current track.
         
     | 
| 
       14 
16 
     | 
    
         
             
                -s, --stop                       Stop playback.
         
     | 
| 
         @@ -17,14 +19,23 @@ Playback controls: 
     | 
|
| 
       17 
19 
     | 
    
         
             
                -m, --mute                       Mute the audio.
         
     | 
| 
       18 
20 
     | 
    
         
             
                -M, --unmute                     Unmute the audio.
         
     | 
| 
       19 
21 
     | 
    
         
             
                -v, --volume number              Set the volume to X percentage points.
         
     | 
| 
       20 
     | 
    
         
            -
                    --volume-down [number]       Decrease the volume by X percentage points 
     | 
| 
       21 
     | 
    
         
            -
             
     | 
| 
       22 
     | 
    
         
            -
                    -- 
     | 
| 
       23 
     | 
    
         
            -
             
     | 
| 
       24 
     | 
    
         
            -
                    --scan- 
     | 
| 
      
 22 
     | 
    
         
            +
                    --volume-down [number]       Decrease the volume by X percentage points
         
     | 
| 
      
 23 
     | 
    
         
            +
                                                 (default 10).
         
     | 
| 
      
 24 
     | 
    
         
            +
                    --volume-up [number]         Increase the volume by X percentage points
         
     | 
| 
      
 25 
     | 
    
         
            +
                                                 (default 10).
         
     | 
| 
      
 26 
     | 
    
         
            +
                    --scan-to seconds            Scan to an offset X seconds within the
         
     | 
| 
      
 27 
     | 
    
         
            +
                                                 current track.
         
     | 
| 
      
 28 
     | 
    
         
            +
                    --scan-backwards [seconds]   Scan backwards X seconds within the
         
     | 
| 
      
 29 
     | 
    
         
            +
                                                 current track (default 10).
         
     | 
| 
      
 30 
     | 
    
         
            +
                    --scan-forwards [seconds]    Scan forwards X seconds within the current
         
     | 
| 
      
 31 
     | 
    
         
            +
                                                 track (default 10).
         
     | 
| 
       25 
32 
     | 
    
         
             
                    --play-file name             Play the specified file or folder.
         
     | 
| 
       26 
33 
     | 
    
         
             
            Info on selected tracks:
         
     | 
| 
       27 
     | 
    
         
            -
                -i, --print-info format          For each track, print information in the 
     | 
| 
      
 34 
     | 
    
         
            +
                -i, --print-info format          For each track, print information in the
         
     | 
| 
      
 35 
     | 
    
         
            +
                                                 given format.  If the following strings
         
     | 
| 
      
 36 
     | 
    
         
            +
                                                 appear in the given format, they will be
         
     | 
| 
      
 37 
     | 
    
         
            +
                                                 replaced with the corresponding track
         
     | 
| 
      
 38 
     | 
    
         
            +
                                                 information:
         
     | 
| 
       28 
39 
     | 
    
         
             
                                                 "%a": artist
         
     | 
| 
       29 
40 
     | 
    
         
             
                                                 "%e": encoding
         
     | 
| 
       30 
41 
     | 
    
         
             
                                                 "%A": album
         
     | 
| 
         @@ -33,7 +44,8 @@ Info on selected tracks: 
     | 
|
| 
       33 
44 
     | 
    
         
             
                                                 "%C": comment
         
     | 
| 
       34 
45 
     | 
    
         
             
                                                 "%d": disc number
         
     | 
| 
       35 
46 
     | 
    
         
             
                                                 "%D": disc count
         
     | 
| 
       36 
     | 
    
         
            -
                                                 "%E": Enabled status ("enabled" or 
     | 
| 
      
 47 
     | 
    
         
            +
                                                 "%E": Enabled status ("enabled" or
         
     | 
| 
      
 48 
     | 
    
         
            +
                                                 "disabled")
         
     | 
| 
       37 
49 
     | 
    
         
             
                                                 "%l": location (file name/URL)
         
     | 
| 
       38 
50 
     | 
    
         
             
                                                 "%p": play count
         
     | 
| 
       39 
51 
     | 
    
         
             
                                                 "%q": equalizer
         
     | 
| 
         @@ -48,50 +60,94 @@ Info on selected tracks: 
     | 
|
| 
       48 
60 
     | 
    
         
             
                                                 "%y": year
         
     | 
| 
       49 
61 
     | 
    
         
             
                                                 "%%": percent sign
         
     | 
| 
       50 
62 
     | 
    
         
             
            General iTunes controls:
         
     | 
| 
       51 
     | 
    
         
            -
                -a, --add-file name              Add the specified file or folder to the 
     | 
| 
      
 63 
     | 
    
         
            +
                -a, --add-file name              Add the specified file or folder to the
         
     | 
| 
      
 64 
     | 
    
         
            +
                                                 library.
         
     | 
| 
       52 
65 
     | 
    
         
             
                -q, --quit                       Exit iTunes.
         
     | 
| 
       53 
66 
     | 
    
         
             
                    --open-url url               Open the given URL.
         
     | 
| 
       54 
67 
     | 
    
         
             
                    --goto-store-home-page       Go to the Store.
         
     | 
| 
       55 
68 
     | 
    
         
             
                    --update-ipod                Update the iPod.
         
     | 
| 
       56 
69 
     | 
    
         
             
            Playlist selection:
         
     | 
| 
       57 
     | 
    
         
            -
                    --library                    Operation will include the entire iTunes 
     | 
| 
       58 
     | 
    
         
            -
             
     | 
| 
       59 
     | 
    
         
            -
             
     | 
| 
      
 70 
     | 
    
         
            +
                    --library                    Operation will include the entire iTunes
         
     | 
| 
      
 71 
     | 
    
         
            +
                                                 library.  Used by default unless other
         
     | 
| 
      
 72 
     | 
    
         
            +
                                                 libraries are selected.
         
     | 
| 
      
 73 
     | 
    
         
            +
                    --current-playlist           Operation will include the current
         
     | 
| 
      
 74 
     | 
    
         
            +
                                                 playlist.
         
     | 
| 
      
 75 
     | 
    
         
            +
                    --playlist name              Operation will include the named playlist.
         
     | 
| 
      
 76 
     | 
    
         
            +
                                                 (This option can occur more than once.)
         
     | 
| 
       60 
77 
     | 
    
         
             
                    --all-playlists              Operation will include all playlists.
         
     | 
| 
       61 
     | 
    
         
            -
                    --create-playlist name       Create a playlist with the specified name 
     | 
| 
       62 
     | 
    
         
            -
             
     | 
| 
      
 78 
     | 
    
         
            +
                    --create-playlist name       Create a playlist with the specified name
         
     | 
| 
      
 79 
     | 
    
         
            +
                                                 and include it in the operation.  (This
         
     | 
| 
      
 80 
     | 
    
         
            +
                                                 option can occur more than once.)
         
     | 
| 
      
 81 
     | 
    
         
            +
                    --delete-playlist name       Delete the playlist with the specified
         
     | 
| 
      
 82 
     | 
    
         
            +
                                                 name.  (This option can occur more than
         
     | 
| 
      
 83 
     | 
    
         
            +
                                                 once.)
         
     | 
| 
       63 
84 
     | 
    
         
             
            Track selection:
         
     | 
| 
       64 
     | 
    
         
            -
                -f, --find string                Operation will include all tracks in the 
     | 
| 
      
 85 
     | 
    
         
            +
                -f, --find string                Operation will include all tracks in the
         
     | 
| 
      
 86 
     | 
    
         
            +
                                                 specified playlist(s) where any field
         
     | 
| 
      
 87 
     | 
    
         
            +
                                                 matches the specified string.  (This
         
     | 
| 
      
 88 
     | 
    
         
            +
                                                 option can occur more than once.)
         
     | 
| 
       65 
89 
     | 
    
         
             
                -c, --current-track              Operation will inclue the current track.
         
     | 
| 
       66 
     | 
    
         
            -
                    --selected-tracks            Operation will include the selected 
     | 
| 
       67 
     | 
    
         
            -
             
     | 
| 
       68 
     | 
    
         
            -
                    -- 
     | 
| 
       69 
     | 
    
         
            -
             
     | 
| 
       70 
     | 
    
         
            -
                    --find 
     | 
| 
       71 
     | 
    
         
            -
             
     | 
| 
       72 
     | 
    
         
            -
             
     | 
| 
      
 90 
     | 
    
         
            +
                    --selected-tracks            Operation will include the selected
         
     | 
| 
      
 91 
     | 
    
         
            +
                                                 tracks.
         
     | 
| 
      
 92 
     | 
    
         
            +
                    --all-tracks                 Operation will include all tracks in the
         
     | 
| 
      
 93 
     | 
    
         
            +
                                                 specified playlist(s).
         
     | 
| 
      
 94 
     | 
    
         
            +
                    --visible-find string        Operation will include all tracks in the
         
     | 
| 
      
 95 
     | 
    
         
            +
                                                 specified playlist(s) where any visible
         
     | 
| 
      
 96 
     | 
    
         
            +
                                                 field matches the specified string.  (This
         
     | 
| 
      
 97 
     | 
    
         
            +
                                                 option can occur more than once.)
         
     | 
| 
      
 98 
     | 
    
         
            +
                    --find-artist string         Operation will include all tracks in the
         
     | 
| 
      
 99 
     | 
    
         
            +
                                                 specified playlist(s) where the artist
         
     | 
| 
      
 100 
     | 
    
         
            +
                                                 matches the specified string.  (This
         
     | 
| 
      
 101 
     | 
    
         
            +
                                                 option can occur more than once.)
         
     | 
| 
      
 102 
     | 
    
         
            +
                    --find-album string          Operation will include all tracks in the
         
     | 
| 
      
 103 
     | 
    
         
            +
                                                 specified playlist(s) where the album
         
     | 
| 
      
 104 
     | 
    
         
            +
                                                 matches the specified string.  (This
         
     | 
| 
      
 105 
     | 
    
         
            +
                                                 option can occur more than once.)
         
     | 
| 
      
 106 
     | 
    
         
            +
                    --find-composer string       Operation will include all tracks in the
         
     | 
| 
      
 107 
     | 
    
         
            +
                                                 specified playlist(s) where the composer
         
     | 
| 
      
 108 
     | 
    
         
            +
                                                 matches the specified string.  (This
         
     | 
| 
      
 109 
     | 
    
         
            +
                                                 option can occur more than once.)
         
     | 
| 
      
 110 
     | 
    
         
            +
                    --find-track-name string     Operation will include all tracks in the
         
     | 
| 
      
 111 
     | 
    
         
            +
                                                 specified playlist(s) where the track name
         
     | 
| 
      
 112 
     | 
    
         
            +
                                                 matches the specified string.  (This
         
     | 
| 
      
 113 
     | 
    
         
            +
                                                 option can occur more than once.)
         
     | 
| 
       73 
114 
     | 
    
         
             
                -F, --play-found                 Play the first of the selected tracks.
         
     | 
| 
       74 
     | 
    
         
            -
             
     | 
| 
      
 115 
     | 
    
         
            +
            Operations on selected tracks:
         
     | 
| 
       75 
116 
     | 
    
         
             
                    --set-artist name            Set the artist for each track.
         
     | 
| 
       76 
117 
     | 
    
         
             
                    --set-album name             Set the album for each track.
         
     | 
| 
       77 
118 
     | 
    
         
             
                    --set-bpm number             Set the beats per minute for each track.
         
     | 
| 
       78 
119 
     | 
    
         
             
                    --set-comment string         Set the comment for each track.
         
     | 
| 
       79 
120 
     | 
    
         
             
                    --set-composer string        Set the composer for each track.
         
     | 
| 
       80 
     | 
    
         
            -
                    --set-disc-number number     For each track, set the disc number. 
     | 
| 
       81 
     | 
    
         
            -
             
     | 
| 
      
 121 
     | 
    
         
            +
                    --set-disc-number number     For each track, set the disc number.
         
     | 
| 
      
 122 
     | 
    
         
            +
                                                 (Used with multi-disc albums.)
         
     | 
| 
      
 123 
     | 
    
         
            +
                    --set-disc-count number      For each track, set the number of discs in
         
     | 
| 
      
 124 
     | 
    
         
            +
                                                 the album.  (Used with multi-disc albums.)
         
     | 
| 
       82 
125 
     | 
    
         
             
                    --set-enabled                Enable the check box for each track.
         
     | 
| 
       83 
126 
     | 
    
         
             
                    --set-disabled               Disable the check box for each track.
         
     | 
| 
       84 
     | 
    
         
            -
                    --set-eq name                Set the equalizer to the named preset. 
     | 
| 
      
 127 
     | 
    
         
            +
                    --set-eq name                Set the equalizer to the named preset.
         
     | 
| 
      
 128 
     | 
    
         
            +
                                                 Use 'None' to disable.
         
     | 
| 
       85 
129 
     | 
    
         
             
                    --set-genre name             Set the genre for each track.
         
     | 
| 
       86 
130 
     | 
    
         
             
                    --set-grouping string        Set the grouping for each track.
         
     | 
| 
       87 
131 
     | 
    
         
             
                    --set-name name              Set the name (title) for each track.
         
     | 
| 
       88 
132 
     | 
    
         
             
                    --set-play-count number      Set the play count for each track.
         
     | 
| 
       89 
     | 
    
         
            -
                    --set-rating number          Set the rating for each track.  Valid 
     | 
| 
      
 133 
     | 
    
         
            +
                    --set-rating number          Set the rating for each track.  Valid
         
     | 
| 
      
 134 
     | 
    
         
            +
                                                 values are 0 through 5.
         
     | 
| 
       90 
135 
     | 
    
         
             
                    --set-skip-count number      Set the skip count for each track.
         
     | 
| 
       91 
     | 
    
         
            -
                    --set-track-number number    For each track, set its album track 
     | 
| 
       92 
     | 
    
         
            -
             
     | 
| 
       93 
     | 
    
         
            -
                    --set-track- 
     | 
| 
       94 
     | 
    
         
            -
             
     | 
| 
      
 136 
     | 
    
         
            +
                    --set-track-number number    For each track, set its album track
         
     | 
| 
      
 137 
     | 
    
         
            +
                                                 number.
         
     | 
| 
      
 138 
     | 
    
         
            +
                    --set-track-count number     For each track, set the number of tracks
         
     | 
| 
      
 139 
     | 
    
         
            +
                                                 on its album.
         
     | 
| 
      
 140 
     | 
    
         
            +
                    --set-track-volume percent   Set the volume adjustment percentage for
         
     | 
| 
      
 141 
     | 
    
         
            +
                                                 each track, from -100 to 100.  Negative
         
     | 
| 
      
 142 
     | 
    
         
            +
                                                 numbers decrease the volume, positive
         
     | 
| 
      
 143 
     | 
    
         
            +
                                                 numbers increase it.  0 means no
         
     | 
| 
      
 144 
     | 
    
         
            +
                                                 adjustment.
         
     | 
| 
      
 145 
     | 
    
         
            +
                    --set-year number            Set the year of publication for each
         
     | 
| 
      
 146 
     | 
    
         
            +
                                                 track.
         
     | 
| 
      
 147 
     | 
    
         
            +
                    --add-to-playlist name       Add selected tracks to the given playlist.
         
     | 
| 
      
 148 
     | 
    
         
            +
            Troubleshooting:
         
     | 
| 
      
 149 
     | 
    
         
            +
                    --debug                      When an error occurs, show a more detailed
         
     | 
| 
      
 150 
     | 
    
         
            +
                                                 message.
         
     | 
| 
       95 
151 
     | 
    
         | 
| 
       96 
152 
     | 
    
         | 
| 
       97 
153 
     | 
    
         
             
            == Description
         
     | 
| 
         @@ -124,6 +180,10 @@ You can improve readability in batch files by specifying options in long form: 
     | 
|
| 
       124 
180 
     | 
    
         | 
| 
       125 
181 
     | 
    
         
             
            	itch --find "aphex twin" --print-info "%a - %A - %t - %n" --play-found
         
     | 
| 
       126 
182 
     | 
    
         | 
| 
      
 183 
     | 
    
         
            +
            Import files from CD:
         
     | 
| 
      
 184 
     | 
    
         
            +
             
     | 
| 
      
 185 
     | 
    
         
            +
            	itch --add-file D:\
         
     | 
| 
      
 186 
     | 
    
         
            +
             
     | 
| 
       127 
187 
     | 
    
         | 
| 
       128 
188 
     | 
    
         
             
            == Installation
         
     | 
| 
       129 
189 
     | 
    
         | 
    
        data/lib/itch.rb
    CHANGED
    
    | 
         @@ -129,7 +129,7 @@ class Itch 
     | 
|
| 
       129 
129 
     | 
    
         
             
            		options.on("--find-track-name string", Object, "Operation will include all tracks in the specified playlist(s) where the track name matches the specified string.  (This option can occur more than once.)") {|value| (config['find-track-name'] ||= []) << value}
         
     | 
| 
       130 
130 
     | 
    
         
             
            		options.on("-F", "--play-found", TrueClass, "Play the first of the selected tracks.") {|value| config['play-found'] = value}
         
     | 
| 
       131 
131 
     | 
    
         | 
| 
       132 
     | 
    
         
            -
            		options.separator(" 
     | 
| 
      
 132 
     | 
    
         
            +
            		options.separator("Operations on selected tracks:")
         
     | 
| 
       133 
133 
     | 
    
         
             
            		options.on("--set-artist name", Object, "Set the artist for each track.") {|value| config['set-artist'] = value}
         
     | 
| 
       134 
134 
     | 
    
         
             
            		options.on("--set-album name", Object, "Set the album for each track.") {|value| config['set-album'] = value}
         
     | 
| 
       135 
135 
     | 
    
         
             
            		options.on("--set-bpm number", Integer, "Set the beats per minute for each track.") {|value| config['set-bpm'] = value}
         
     | 
| 
         @@ -150,7 +150,8 @@ class Itch 
     | 
|
| 
       150 
150 
     | 
    
         
             
            		options.on("--set-track-count number", Integer, "For each track, set the number of tracks on its album.") {|value| config['set-track-count'] = value}
         
     | 
| 
       151 
151 
     | 
    
         
             
            		options.on("--set-track-volume percent", Integer, "Set the volume adjustment percentage for each track, from -100 to 100.  Negative numbers decrease the volume, positive numbers increase it.  0 means no adjustment.") {|value| config['set-track-volume'] = value}
         
     | 
| 
       152 
152 
     | 
    
         
             
            		options.on("--set-year number", Integer, "Set the year of publication for each track.") {|value| config['set-year'] = value}
         
     | 
| 
       153 
     | 
    
         
            -
            		
         
     | 
| 
      
 153 
     | 
    
         
            +
            		options.on("--add-to-playlist name", Object, "Add selected tracks to the given playlist.") {|value| config['add-to-playlist'] = value}
         
     | 
| 
      
 154 
     | 
    
         
            +
             
     | 
| 
       154 
155 
     | 
    
         
             
            		options.separator("Troubleshooting:")
         
     | 
| 
       155 
156 
     | 
    
         
             
            		options.on("--debug", TrueClass, "When an error occurs, show a more detailed message.") {|value| config['debug'] = value}
         
     | 
| 
       156 
157 
     | 
    
         | 
| 
         @@ -246,8 +247,6 @@ class Itch 
     | 
|
| 
       246 
247 
     | 
    
         
             
            					with_option_values(option, config) do |terms|
         
     | 
| 
       247 
248 
     | 
    
         
             
            						if (results = playlist.Search(terms, field_id))
         
     | 
| 
       248 
249 
     | 
    
         
             
            							results.each {|track| tracks << track}
         
     | 
| 
       249 
     | 
    
         
            -
            						else
         
     | 
| 
       250 
     | 
    
         
            -
            							raise "No tracks found."
         
     | 
| 
       251 
250 
     | 
    
         
             
            						end
         
     | 
| 
       252 
251 
     | 
    
         
             
            					end
         
     | 
| 
       253 
252 
     | 
    
         
             
            				}
         
     | 
| 
         @@ -324,7 +323,7 @@ class Itch 
     | 
|
| 
       324 
323 
     | 
    
         
             
            			specified?(config, 'set-year') {|v| track.Year = v}
         
     | 
| 
       325 
324 
     | 
    
         
             
            			specified?(config, 'print-info') {|v| puts track_info(track, v)}
         
     | 
| 
       326 
325 
     | 
    
         
             
            			specified?(config, 'set-artist') {|v| track.Artist = v}
         
     | 
| 
       327 
     | 
    
         
            -
            			 
     | 
| 
      
 326 
     | 
    
         
            +
            			specified?(config, 'add-to-playlist') {|v| find_playlist(v).AddTrack(track)}
         
     | 
| 
       328 
327 
     | 
    
         
             
            		end
         
     | 
| 
       329 
328 
     | 
    
         | 
| 
       330 
329 
     | 
    
         
             
            		#Play first of selected tracks if requested.
         
     | 
    
        metadata
    CHANGED
    
    | 
         @@ -3,8 +3,8 @@ rubygems_version: 0.9.2 
     | 
|
| 
       3 
3 
     | 
    
         
             
            specification_version: 1
         
     | 
| 
       4 
4 
     | 
    
         
             
            name: itch
         
     | 
| 
       5 
5 
     | 
    
         
             
            version: !ruby/object:Gem::Version 
         
     | 
| 
       6 
     | 
    
         
            -
              version: 1.0. 
     | 
| 
       7 
     | 
    
         
            -
            date:  
     | 
| 
      
 6 
     | 
    
         
            +
              version: 1.0.5
         
     | 
| 
      
 7 
     | 
    
         
            +
            date: 2008-08-18 00:00:00 -07:00
         
     | 
| 
       8 
8 
     | 
    
         
             
            summary: Allows control of iTunes for Windows via a command line.
         
     | 
| 
       9 
9 
     | 
    
         
             
            require_paths: 
         
     | 
| 
       10 
10 
     | 
    
         
             
            - lib
         
     |