Class: RJL::Track
- Inherits:
-
Object
- Object
- RJL::Track
- Defined in:
- lib/rjl/track.rb
Instance Method Summary collapse
- #album ⇒ Object
- #album=(str) ⇒ Object
- #album_artist ⇒ Object
- #album_artist=(str) ⇒ Object
- #artist ⇒ Object
- #artist=(str) ⇒ Object
- #class ⇒ Object
- #comment ⇒ Object
- #comment=(str) ⇒ Object
- #compilation? ⇒ Boolean
- #composer ⇒ Object
- #composer=(str) ⇒ Object
- #database_id ⇒ Object
- #disc_number ⇒ Object
- #disc_number=(int) ⇒ Object
- #genre ⇒ Object
- #genre=(str) ⇒ Object
- #grouping ⇒ Object
- #grouping=(str) ⇒ Object
-
#initialize(track_obj) ⇒ Track
constructor
A new instance of Track.
- #name ⇒ Object
- #name=(str) ⇒ Object
- #sort_album ⇒ Object
- #sort_album=(str) ⇒ Object
- #sort_album_artist ⇒ Object
- #sort_album_artist=(str) ⇒ Object
- #sort_artist ⇒ Object
- #sort_artist=(str) ⇒ Object
-
#tags ⇒ List of String
Tags use square bracket markup in the ‘groupings’ field of iTunes.
- #to_s ⇒ Object
Constructor Details
#initialize(track_obj) ⇒ Track
Returns a new instance of Track.
4 5 6 |
# File 'lib/rjl/track.rb', line 4 def initialize track_obj @track_obj = track_obj end |
Instance Method Details
#album ⇒ Object
33 34 35 |
# File 'lib/rjl/track.rb', line 33 def album return @track_obj.album.get end |
#album=(str) ⇒ Object
36 37 38 |
# File 'lib/rjl/track.rb', line 36 def album=(str) @track_obj.album.set(str) end |
#album_artist ⇒ Object
47 48 49 |
# File 'lib/rjl/track.rb', line 47 def album_artist return @track_obj.album_artist.get end |
#album_artist=(str) ⇒ Object
50 51 52 |
# File 'lib/rjl/track.rb', line 50 def album_artist=(str) @track_obj.album_artist.set(str) end |
#artist ⇒ Object
19 20 21 |
# File 'lib/rjl/track.rb', line 19 def artist return @track_obj.artist.get end |
#artist=(str) ⇒ Object
22 23 24 |
# File 'lib/rjl/track.rb', line 22 def artist=(str) @track_obj.artist.set(str) end |
#class ⇒ Object
102 103 104 |
# File 'lib/rjl/track.rb', line 102 def class return @track_obj.class_.get end |
#comment ⇒ Object
84 85 86 |
# File 'lib/rjl/track.rb', line 84 def comment return @track_obj.comment.get end |
#comment=(str) ⇒ Object
87 88 89 |
# File 'lib/rjl/track.rb', line 87 def comment=(str) @track_obj.comment.set(str) end |
#compilation? ⇒ Boolean
98 99 100 |
# File 'lib/rjl/track.rb', line 98 def compilation? return @track_obj.compilation.get end |
#composer ⇒ Object
61 62 63 |
# File 'lib/rjl/track.rb', line 61 def composer return @track_obj.composer.get end |
#composer=(str) ⇒ Object
64 65 66 |
# File 'lib/rjl/track.rb', line 64 def composer=(str) @track_obj.composer.set(str) end |
#database_id ⇒ Object
8 9 10 |
# File 'lib/rjl/track.rb', line 8 def database_id return @track_obj.database_ID.get end |
#disc_number ⇒ Object
91 92 93 |
# File 'lib/rjl/track.rb', line 91 def disc_number return @track_obj.disc_number.get end |
#disc_number=(int) ⇒ Object
94 95 96 |
# File 'lib/rjl/track.rb', line 94 def disc_number=(int) @track_obj.disc_number.set(int) end |
#genre ⇒ Object
75 76 77 |
# File 'lib/rjl/track.rb', line 75 def genre return @track_obj.genre.get end |
#genre=(str) ⇒ Object
78 79 80 81 82 |
# File 'lib/rjl/track.rb', line 78 def genre=(str) unless self.class == :shared_track @track_obj.genre.set(str) end end |
#grouping ⇒ Object
68 69 70 |
# File 'lib/rjl/track.rb', line 68 def grouping return @track_obj.grouping.get end |
#grouping=(str) ⇒ Object
71 72 73 |
# File 'lib/rjl/track.rb', line 71 def grouping=(str) @track_obj.grouping.set(str) end |
#name ⇒ Object
12 13 14 |
# File 'lib/rjl/track.rb', line 12 def name return @track_obj.name.get end |
#name=(str) ⇒ Object
15 16 17 |
# File 'lib/rjl/track.rb', line 15 def name=(str) @track_obj.name.set(str) end |
#sort_album ⇒ Object
40 41 42 |
# File 'lib/rjl/track.rb', line 40 def sort_album return @track_obj.sort_album.get end |
#sort_album=(str) ⇒ Object
43 44 45 |
# File 'lib/rjl/track.rb', line 43 def sort_album=(str) @track_obj.sort_album.set(str) end |
#sort_album_artist ⇒ Object
54 55 56 |
# File 'lib/rjl/track.rb', line 54 def sort_album_artist return @track_obj.sort_album_artist.get end |
#sort_album_artist=(str) ⇒ Object
57 58 59 |
# File 'lib/rjl/track.rb', line 57 def sort_album_artist=(str) @track_obj.sort_album_artist.set(str) end |
#sort_artist ⇒ Object
26 27 28 |
# File 'lib/rjl/track.rb', line 26 def sort_artist return @track_obj.sort_artist.get end |
#sort_artist=(str) ⇒ Object
29 30 31 |
# File 'lib/rjl/track.rb', line 29 def sort_artist=(str) @track_obj.sort_artist.set(str) end |
#tags ⇒ List of String
Tags use square bracket markup in the ‘groupings’ field of iTunes
108 109 110 111 112 113 114 115 |
# File 'lib/rjl/track.rb', line 108 def = [] begin = self.grouping.gsub("][", ",")[1..-2].split(',') rescue end return end |
#to_s ⇒ Object
117 118 119 |
# File 'lib/rjl/track.rb', line 117 def to_s puts "#{self.artist} - #{self.name}" end |