xspf 0.3 → 0.4
Sign up to get free protection for your applications and to get access to all the features.
- data/AUTHORS +1 -1
- data/ChangeLog +15 -0
- data/README +6 -9
- data/USAGE +350 -0
- data/coverage/index.html +17 -17
- data/coverage/lib-xspf_rb.html +466 -305
- data/doc/created.rid +1 -1
- data/doc/fr_file_index.html +4 -0
- data/doc/fr_method_index.html +88 -44
- data/doc/index.html +1 -1
- data/examples/parse_and_generate_right.rb +25 -0
- data/examples/parse_and_generate_right_too.rb +27 -0
- data/examples/parse_and_generate_wrong.rb +25 -0
- data/examples/{example.rb → parse_from_file.rb} +15 -16
- data/examples/parse_from_string.rb +70 -0
- data/examples/playlist-tiersen.xspf +100 -0
- data/lib/xspf.rb +335 -174
- data/test/tc_dogfood.rb +106 -0
- data/test/tc_generate_output_formats.rb +352 -0
- data/test/tc_generate_playlist.rb +196 -0
- data/test/tc_generate_track.rb +38 -0
- data/test/tc_generate_tracklist.rb +72 -0
- data/test/tc_generate_xspf.rb +90 -0
- data/test/{tc_output_formats.rb → tc_parse_output_formats.rb} +124 -9
- data/test/{tc_playlist.rb → tc_parse_playlist.rb} +9 -1
- data/test/{tc_track.rb → tc_parse_track.rb} +1 -1
- data/test/{tc_tracklist.rb → tc_parse_tracklist.rb} +1 -1
- data/test/{tc_xspf.rb → tc_parse_xspf.rb} +4 -3
- data/test/ts_xspf.rb +12 -5
- data/xspf-expanded.rb +644 -76
- metadata +30 -16
@@ -3,7 +3,7 @@ $:.unshift File.join(File.dirname(__FILE__), "..", "lib")
|
|
3
3
|
require 'xspf'
|
4
4
|
require 'test/unit'
|
5
5
|
|
6
|
-
class
|
6
|
+
class TestParsePlaylist < Test::Unit::TestCase
|
7
7
|
|
8
8
|
def setup
|
9
9
|
@playlist_document = <<END_OF_PLAYLIST
|
@@ -88,3 +88,11 @@ END_OF_PLAYLIST
|
|
88
88
|
end
|
89
89
|
|
90
90
|
end
|
91
|
+
|
92
|
+
class TestError < Test::Unit::TestCase
|
93
|
+
|
94
|
+
def test_creation_error
|
95
|
+
assert_raise(TypeError) { XSPF::Playlist.new('error') }
|
96
|
+
end
|
97
|
+
|
98
|
+
end
|
@@ -3,7 +3,7 @@ $:.unshift File.join(File.dirname(__FILE__), "..", "lib")
|
|
3
3
|
require 'xspf'
|
4
4
|
require 'test/unit'
|
5
5
|
|
6
|
-
class
|
6
|
+
class TestParseXSPF < Test::Unit::TestCase
|
7
7
|
|
8
8
|
def setup
|
9
9
|
@playlist_document = <<END_OF_PLAYLIST
|
@@ -51,14 +51,15 @@ END_OF_PLAYLIST
|
|
51
51
|
end
|
52
52
|
|
53
53
|
def test_version
|
54
|
-
assert_equal(@xspf.version
|
54
|
+
assert_equal('1.0', @xspf.version)
|
55
55
|
end
|
56
56
|
|
57
57
|
def test_encoding
|
58
|
-
assert_equal(@xspf.encoding
|
58
|
+
assert_equal('UTF-8', @xspf.encoding)
|
59
59
|
end
|
60
60
|
|
61
61
|
def test_error
|
62
62
|
assert_raise(NoMethodError) {@xspf.inexistent_method }
|
63
63
|
end
|
64
|
+
|
64
65
|
end
|
data/test/ts_xspf.rb
CHANGED
@@ -1,9 +1,16 @@
|
|
1
1
|
$:.unshift File.join(File.dirname(__FILE__), "..", "test")
|
2
2
|
|
3
3
|
require 'test/unit'
|
4
|
-
require '
|
5
|
-
require '
|
6
|
-
require '
|
7
|
-
require '
|
8
|
-
require '
|
4
|
+
require 'tc_parse_xspf'
|
5
|
+
require 'tc_parse_playlist'
|
6
|
+
require 'tc_parse_tracklist'
|
7
|
+
require 'tc_parse_track'
|
8
|
+
require 'tc_generate_xspf'
|
9
|
+
require 'tc_generate_playlist'
|
10
|
+
require 'tc_generate_tracklist'
|
11
|
+
require 'tc_generate_track'
|
12
|
+
require 'tc_dogfood'
|
13
|
+
require 'tc_parse_output_formats'
|
14
|
+
require 'tc_generate_output_formats'
|
15
|
+
require 'tc_rdoc'
|
9
16
|
|
data/xspf-expanded.rb
CHANGED
@@ -1,152 +1,720 @@
|
|
1
1
|
class XSPF
|
2
|
-
|
3
|
-
|
2
|
+
# Version for the XML document or _nil_ if not defined
|
3
|
+
def version
|
4
|
+
@version
|
5
|
+
end
|
6
|
+
|
7
|
+
def version=(value)
|
8
|
+
@version = value
|
9
|
+
end
|
10
|
+
|
11
|
+
private
|
12
|
+
def parse_version
|
13
|
+
begin
|
14
|
+
@xspf.version
|
15
|
+
rescue NoMethodError
|
16
|
+
return nil
|
17
|
+
end
|
18
|
+
end
|
19
|
+
|
4
20
|
end
|
5
21
|
class XSPF
|
6
|
-
|
7
|
-
|
22
|
+
# Encoding of the XML document or _nil_ if not defined
|
23
|
+
def encoding
|
24
|
+
@encoding
|
25
|
+
end
|
26
|
+
|
27
|
+
def encoding=(value)
|
28
|
+
@encoding = value
|
29
|
+
end
|
30
|
+
|
31
|
+
private
|
32
|
+
def parse_encoding
|
33
|
+
begin
|
34
|
+
@xspf.encoding
|
35
|
+
rescue NoMethodError
|
36
|
+
return nil
|
37
|
+
end
|
38
|
+
end
|
39
|
+
|
8
40
|
end
|
9
41
|
class XSPF
|
10
|
-
|
11
|
-
|
42
|
+
# Creates a .m3u playlist from the XSPF document. This method makes use of the official XSPF to M3U XSLT transformation by Lucas Gonze.
|
43
|
+
def to_m3u
|
44
|
+
xslt = XML::XSLT.new
|
45
|
+
xslt.xml = self.to_xml
|
46
|
+
xslt.xsl = REXML::Document.new( File.new( './lib/xspf2m3u.xsl' ) )
|
47
|
+
xslt.serve
|
48
|
+
end
|
49
|
+
|
12
50
|
end
|
13
51
|
class XSPF
|
14
|
-
|
15
|
-
|
52
|
+
# Outputs the playlist as an HTML page. This method makes use of the official XSPF to HTML XSLT transformation by Lucas Gonze.
|
53
|
+
def to_html
|
54
|
+
xslt = XML::XSLT.new
|
55
|
+
xslt.xml = self.to_xml
|
56
|
+
xslt.xsl = REXML::Document.new( File.new( './lib/xspf2html.xsl' ) )
|
57
|
+
xslt.serve
|
58
|
+
end
|
59
|
+
|
16
60
|
end
|
17
61
|
class XSPF
|
18
|
-
|
19
|
-
|
62
|
+
# Creates a .smil playlist from the XSPF document. This method makes use of the official XSPF to SMIL XSLT transformation by Lucas Gonze.
|
63
|
+
def to_smil
|
64
|
+
xslt = XML::XSLT.new
|
65
|
+
xslt.xml = self.to_xml
|
66
|
+
xslt.xsl = REXML::Document.new( File.new( './lib/xspf2smil.xsl' ) )
|
67
|
+
xslt.serve
|
68
|
+
end
|
69
|
+
|
20
70
|
end
|
21
71
|
class XSPF
|
22
|
-
|
23
|
-
|
72
|
+
# Creates a SoundBlox playlist from the XSPF document. This method makes use of the official XSPF to SoundBlox XSLT tranformation by Lucas Gonze.
|
73
|
+
def to_soundblox
|
74
|
+
xslt = XML::XSLT.new
|
75
|
+
xslt.xml = self.to_xml
|
76
|
+
xslt.xsl = REXML::Document.new( File.new( './lib/xspf2soundblox.xsl' ) )
|
77
|
+
xslt.serve
|
78
|
+
end
|
79
|
+
|
24
80
|
end
|
25
81
|
class XSPF::Playlist
|
26
|
-
|
27
|
-
|
82
|
+
# The XML namespace. It must be http://xspf.org/ns/0/ for a valid XSPF document.
|
83
|
+
def xmlns
|
84
|
+
@xmlns
|
85
|
+
end
|
86
|
+
|
87
|
+
def xmlns=(value)
|
88
|
+
@xmlns = value
|
89
|
+
end
|
90
|
+
|
91
|
+
private
|
92
|
+
def parse_xmlns
|
93
|
+
begin
|
94
|
+
@playlist.root.attributes['xmlns']
|
95
|
+
rescue NoMethodError
|
96
|
+
return nil
|
97
|
+
end
|
98
|
+
end
|
99
|
+
|
28
100
|
end
|
29
101
|
class XSPF::Playlist
|
30
|
-
|
31
|
-
|
102
|
+
# The XSPF version. It may be 0 or 1, although 1 is strongly advised.
|
103
|
+
def version
|
104
|
+
@version
|
105
|
+
end
|
106
|
+
|
107
|
+
def version=(value)
|
108
|
+
@version = value
|
109
|
+
end
|
110
|
+
|
111
|
+
private
|
112
|
+
def parse_version
|
113
|
+
begin
|
114
|
+
@playlist.root.attributes['version']
|
115
|
+
rescue NoMethodError
|
116
|
+
return nil
|
117
|
+
end
|
118
|
+
end
|
119
|
+
|
32
120
|
end
|
33
121
|
class XSPF::Playlist
|
34
|
-
|
35
|
-
|
122
|
+
# A human-readable title for the playlist. xspf:playlist elements MAY contain exactly one.
|
123
|
+
def title
|
124
|
+
@title
|
125
|
+
end
|
126
|
+
|
127
|
+
def title=(value)
|
128
|
+
@title = value
|
129
|
+
end
|
130
|
+
|
131
|
+
private
|
132
|
+
def parse_title
|
133
|
+
begin
|
134
|
+
@playlist.elements['title'].text
|
135
|
+
rescue NoMethodError
|
136
|
+
return nil
|
137
|
+
end
|
138
|
+
end
|
139
|
+
|
36
140
|
end
|
37
141
|
class XSPF::Playlist
|
38
|
-
|
39
|
-
|
142
|
+
# Human-readable name of the entity (author, authors, group, company, etc) that authored the playlist. XSPF::Playlist objects MAY contain exactly one.
|
143
|
+
def creator
|
144
|
+
@creator
|
145
|
+
end
|
146
|
+
|
147
|
+
def creator=(value)
|
148
|
+
@creator = value
|
149
|
+
end
|
150
|
+
|
151
|
+
private
|
152
|
+
def parse_creator
|
153
|
+
begin
|
154
|
+
@playlist.elements['creator'].text
|
155
|
+
rescue NoMethodError
|
156
|
+
return nil
|
157
|
+
end
|
158
|
+
end
|
159
|
+
|
40
160
|
end
|
41
161
|
class XSPF::Playlist
|
42
|
-
|
43
|
-
|
162
|
+
# A human-readable comment on the playlist. This is character data, not HTML, and it may not contain markup. XSPF::Playlist objects elements MAY contain exactly one.
|
163
|
+
def annotation
|
164
|
+
@annotation
|
165
|
+
end
|
166
|
+
|
167
|
+
def annotation=(value)
|
168
|
+
@annotation = value
|
169
|
+
end
|
170
|
+
|
171
|
+
private
|
172
|
+
def parse_annotation
|
173
|
+
begin
|
174
|
+
@playlist.elements['annotation'].text
|
175
|
+
rescue NoMethodError
|
176
|
+
return nil
|
177
|
+
end
|
178
|
+
end
|
179
|
+
|
44
180
|
end
|
45
181
|
class XSPF::Playlist
|
46
|
-
|
47
|
-
|
182
|
+
# URL of a web page to find out more about this playlist. Likely to be homepage of the author, and would be used to find out more about the author and to find more playlists by the author. XSPF::Playlist objects MAY contain exactly one.
|
183
|
+
def info
|
184
|
+
@info
|
185
|
+
end
|
186
|
+
|
187
|
+
def info=(value)
|
188
|
+
@info = value
|
189
|
+
end
|
190
|
+
|
191
|
+
private
|
192
|
+
def parse_info
|
193
|
+
begin
|
194
|
+
@playlist.elements['info'].text
|
195
|
+
rescue NoMethodError
|
196
|
+
return nil
|
197
|
+
end
|
198
|
+
end
|
199
|
+
|
48
200
|
end
|
49
201
|
class XSPF::Playlist
|
50
|
-
|
51
|
-
|
202
|
+
# Source URL for this playlist. XSPF::Playlist objects MAY contain exactly one.
|
203
|
+
def location
|
204
|
+
@location
|
205
|
+
end
|
206
|
+
|
207
|
+
def location=(value)
|
208
|
+
@location = value
|
209
|
+
end
|
210
|
+
|
211
|
+
private
|
212
|
+
def parse_location
|
213
|
+
begin
|
214
|
+
@playlist.elements['location'].text
|
215
|
+
rescue NoMethodError
|
216
|
+
return nil
|
217
|
+
end
|
218
|
+
end
|
219
|
+
|
52
220
|
end
|
53
221
|
class XSPF::Playlist
|
54
|
-
|
55
|
-
|
222
|
+
# Canonical ID for this playlist. Likely to be a hash or other location-independent name. MUST be a legal URN. XSPF::Playlist objects MAY contain exactly one.
|
223
|
+
def identifier
|
224
|
+
@identifier
|
225
|
+
end
|
226
|
+
|
227
|
+
def identifier=(value)
|
228
|
+
@identifier = value
|
229
|
+
end
|
230
|
+
|
231
|
+
private
|
232
|
+
def parse_identifier
|
233
|
+
begin
|
234
|
+
@playlist.elements['identifier'].text
|
235
|
+
rescue NoMethodError
|
236
|
+
return nil
|
237
|
+
end
|
238
|
+
end
|
239
|
+
|
56
240
|
end
|
57
241
|
class XSPF::Playlist
|
58
|
-
|
59
|
-
|
242
|
+
# URL of an image to display if XSPF::Playlist#image return nil. XSPF::Playlist objects MAY contain exactly one.
|
243
|
+
def image
|
244
|
+
@image
|
245
|
+
end
|
246
|
+
|
247
|
+
def image=(value)
|
248
|
+
@image = value
|
249
|
+
end
|
250
|
+
|
251
|
+
private
|
252
|
+
def parse_image
|
253
|
+
begin
|
254
|
+
@playlist.elements['image'].text
|
255
|
+
rescue NoMethodError
|
256
|
+
return nil
|
257
|
+
end
|
258
|
+
end
|
259
|
+
|
60
260
|
end
|
61
261
|
class XSPF::Playlist
|
62
|
-
|
63
|
-
|
262
|
+
# Creation date (not last-modified date) of the playlist, formatted as a XML schema dateTime. XSPF::Playlist objects MAY contain exactly one.
|
263
|
+
def date
|
264
|
+
@date
|
265
|
+
end
|
266
|
+
|
267
|
+
def date=(value)
|
268
|
+
@date = value
|
269
|
+
end
|
270
|
+
|
271
|
+
private
|
272
|
+
def parse_date
|
273
|
+
begin
|
274
|
+
@playlist.elements['date'].text
|
275
|
+
rescue NoMethodError
|
276
|
+
return nil
|
277
|
+
end
|
278
|
+
end
|
279
|
+
|
64
280
|
end
|
65
281
|
class XSPF::Playlist
|
66
|
-
|
67
|
-
|
282
|
+
# URL of a resource that describes the license under which this playlist was released. XSPF::Playlist objects MAY contain zero or one license element.
|
283
|
+
def license
|
284
|
+
@license
|
285
|
+
end
|
286
|
+
|
287
|
+
def license=(value)
|
288
|
+
@license = value
|
289
|
+
end
|
290
|
+
|
291
|
+
private
|
292
|
+
def parse_license
|
293
|
+
begin
|
294
|
+
@playlist.elements['license'].text
|
295
|
+
rescue NoMethodError
|
296
|
+
return nil
|
297
|
+
end
|
298
|
+
end
|
299
|
+
|
68
300
|
end
|
69
301
|
class XSPF::Playlist
|
70
|
-
|
71
|
-
|
302
|
+
# An ordered list of URIs. The purpose is to satisfy licenses allowing modification but requiring attribution. If you modify such a playlist, move its XSPF::Playlist#location or XSPF::Playlist#identifier element to the top of the items in the XSPF::Playlist#attribution element. XSPF::Playlist objects MAY contain exactly one attribution element. Please note that currently XSPF for Ruby does not parse the contents of XSPF::Playlist#attribution.
|
303
|
+
def attribution
|
304
|
+
@attribution
|
305
|
+
end
|
306
|
+
|
307
|
+
def attribution=(value)
|
308
|
+
@attribution = value
|
309
|
+
end
|
310
|
+
|
311
|
+
private
|
312
|
+
def parse_attribution
|
313
|
+
begin
|
314
|
+
@playlist.elements['attribution'].text
|
315
|
+
rescue NoMethodError
|
316
|
+
return nil
|
317
|
+
end
|
318
|
+
end
|
319
|
+
|
72
320
|
end
|
73
321
|
class XSPF::Playlist
|
74
|
-
|
75
|
-
|
322
|
+
# The extension element allows non-XSPF XML to be included in XSPF documents without breaking XSPF validation. The purpose is to allow nested XML, which the meta and link elements do not. XSPF::Playlist objects MAY contain zero or more extension elements but currently XSPF for Ruby returns only the first one.
|
323
|
+
def extension
|
324
|
+
@extension
|
325
|
+
end
|
326
|
+
|
327
|
+
def extension=(value)
|
328
|
+
@extension = value
|
329
|
+
end
|
330
|
+
|
331
|
+
private
|
332
|
+
def parse_extension
|
333
|
+
begin
|
334
|
+
@playlist.elements['extension'].text
|
335
|
+
rescue NoMethodError
|
336
|
+
return nil
|
337
|
+
end
|
338
|
+
end
|
339
|
+
|
76
340
|
end
|
77
341
|
class XSPF::Playlist
|
78
|
-
|
79
|
-
|
342
|
+
# The link element allows non-XSPF web resources to be included in XSPF documents without breaking XSPF validation. A valid _link_ element has a _rel_ attribute and a _content_ element, obtained with XSPF::Playlist#link_rel and XSPF::Playlist#link_content respectively. XSPF::Playlist objects MAY contain zero or more meta elements, but currently XSPF for Ruby returns only the first one.
|
343
|
+
def link_content
|
344
|
+
@link_content
|
345
|
+
end
|
346
|
+
|
347
|
+
def link_content=(value)
|
348
|
+
@link_content = value
|
349
|
+
end
|
350
|
+
|
351
|
+
private
|
352
|
+
def parse_link_content
|
353
|
+
begin
|
354
|
+
@playlist.elements['link'].text
|
355
|
+
rescue NoMethodError
|
356
|
+
return nil
|
357
|
+
end
|
358
|
+
end
|
359
|
+
|
80
360
|
end
|
81
361
|
class XSPF::Playlist
|
82
|
-
|
83
|
-
|
362
|
+
# The link element allows non-XSPF web resources to be included in XSPF documents without breaking XSPF validation. A valid _link_ element has a _rel_ attribute and a _content_ element, obtained with XSPF::Playlist#link_rel and XSPF::Playlist#link_content respectively. XSPF::Playlist objects MAY contain zero or more link elements, but currently XSPF for Ruby returns only the first one.
|
363
|
+
def link_rel
|
364
|
+
@link_rel
|
365
|
+
end
|
366
|
+
|
367
|
+
def link_rel=(value)
|
368
|
+
@link_rel = value
|
369
|
+
end
|
370
|
+
|
371
|
+
private
|
372
|
+
def parse_link_rel
|
373
|
+
begin
|
374
|
+
@playlist.elements['link'].attributes['rel']
|
375
|
+
rescue NoMethodError
|
376
|
+
return nil
|
377
|
+
end
|
378
|
+
end
|
379
|
+
|
84
380
|
end
|
85
381
|
class XSPF::Playlist
|
86
|
-
|
87
|
-
|
382
|
+
# The meta element allows non-XSPF metadata to be included in XSPF documents without breaking XSPF validation. A valid _meta_ element has a _rel_ attribute and a _content_ element, obtained with XSPF::Playlist#meta_rel and XSPF::Playlist#meta_content respectively. XSPF::Playlist objects MAY contain zero or more meta elements, but currently XSPF for Ruby returns only the first one.
|
383
|
+
def meta_content
|
384
|
+
@meta_content
|
385
|
+
end
|
386
|
+
|
387
|
+
def meta_content=(value)
|
388
|
+
@meta_content = value
|
389
|
+
end
|
390
|
+
|
391
|
+
private
|
392
|
+
def parse_meta_content
|
393
|
+
begin
|
394
|
+
@playlist.elements['meta'].text
|
395
|
+
rescue NoMethodError
|
396
|
+
return nil
|
397
|
+
end
|
398
|
+
end
|
399
|
+
|
88
400
|
end
|
89
401
|
class XSPF::Playlist
|
90
|
-
|
91
|
-
|
402
|
+
# The meta element allows non-XSPF metadata to be included in XSPF documents without breaking XSPF validation. A valid _meta_ element has a _rel_ attribute and a _content_ element, obtained with XSPF::Playlist#meta_rel and XSPF::Playlist#meta_content respectively. XSPF::Playlist objects MAY contain zero or more meta elements, but currently XSPF for Ruby returns only the first one.
|
403
|
+
def meta_rel
|
404
|
+
@meta_rel
|
405
|
+
end
|
406
|
+
|
407
|
+
def meta_rel=(value)
|
408
|
+
@meta_rel = value
|
409
|
+
end
|
410
|
+
|
411
|
+
private
|
412
|
+
def parse_meta_rel
|
413
|
+
begin
|
414
|
+
@playlist.elements['meta'].attributes['rel']
|
415
|
+
rescue NoMethodError
|
416
|
+
return nil
|
417
|
+
end
|
418
|
+
end
|
419
|
+
|
92
420
|
end
|
93
421
|
class XSPF::Track
|
94
|
-
|
95
|
-
|
422
|
+
# URL of resource to be rendered. Probably an audio resource, but MAY be any type of resource with a well-known duration, such as video, a SMIL document, or an XSPF document. The duration of the resource defined in this element defines the duration of rendering. XSPF::Track objects MAY contain zero or more location elements, but a user-agent MUST NOT render more than one of the named resources. Currently, XSPF for Ruby returns only the first location.
|
423
|
+
def location
|
424
|
+
@location
|
425
|
+
end
|
426
|
+
|
427
|
+
def location=(value)
|
428
|
+
@location = value
|
429
|
+
end
|
430
|
+
|
431
|
+
private
|
432
|
+
def parse_location
|
433
|
+
begin
|
434
|
+
@track.elements['location'].text
|
435
|
+
rescue NoMethodError
|
436
|
+
return nil
|
437
|
+
end
|
438
|
+
end
|
439
|
+
|
96
440
|
end
|
97
441
|
class XSPF::Track
|
98
|
-
|
99
|
-
|
442
|
+
# Canonical ID for this resource. Likely to be a hash or other location-independent name, such as a MusicBrainz identifier or isbn URN (if there existed isbn numbers for audio). MUST be a legal URN. XSPF::Track objects elements MAY contain zero or more identifier elements, but currently XSPF for Ruby returns only the first one.
|
443
|
+
def identifier
|
444
|
+
@identifier
|
445
|
+
end
|
446
|
+
|
447
|
+
def identifier=(value)
|
448
|
+
@identifier = value
|
449
|
+
end
|
450
|
+
|
451
|
+
private
|
452
|
+
def parse_identifier
|
453
|
+
begin
|
454
|
+
@track.elements['identifier'].text
|
455
|
+
rescue NoMethodError
|
456
|
+
return nil
|
457
|
+
end
|
458
|
+
end
|
459
|
+
|
100
460
|
end
|
101
461
|
class XSPF::Track
|
102
|
-
|
103
|
-
|
462
|
+
# Human-readable name of the track that authored the resource which defines the duration of track rendering. This value is primarily for fuzzy lookups, though a user-agent may display it. XSPF::Track objects MAY contain exactly one.
|
463
|
+
def title
|
464
|
+
@title
|
465
|
+
end
|
466
|
+
|
467
|
+
def title=(value)
|
468
|
+
@title = value
|
469
|
+
end
|
470
|
+
|
471
|
+
private
|
472
|
+
def parse_title
|
473
|
+
begin
|
474
|
+
@track.elements['title'].text
|
475
|
+
rescue NoMethodError
|
476
|
+
return nil
|
477
|
+
end
|
478
|
+
end
|
479
|
+
|
104
480
|
end
|
105
481
|
class XSPF::Track
|
106
|
-
|
107
|
-
|
482
|
+
# Human-readable name of the entity (author, authors, group, company, etc) that authored the resource which defines the duration of track rendering. This value is primarily for fuzzy lookups, though a user-agent may display it. XSPF::Track objects MAY contain exactly one.
|
483
|
+
def creator
|
484
|
+
@creator
|
485
|
+
end
|
486
|
+
|
487
|
+
def creator=(value)
|
488
|
+
@creator = value
|
489
|
+
end
|
490
|
+
|
491
|
+
private
|
492
|
+
def parse_creator
|
493
|
+
begin
|
494
|
+
@track.elements['creator'].text
|
495
|
+
rescue NoMethodError
|
496
|
+
return nil
|
497
|
+
end
|
498
|
+
end
|
499
|
+
|
108
500
|
end
|
109
501
|
class XSPF::Track
|
110
|
-
|
111
|
-
|
502
|
+
# A human-readable comment on the track. This is character data, not HTML, and it may not contain markup. XSPF::Track objects MAY contain exactly one.
|
503
|
+
def annotation
|
504
|
+
@annotation
|
505
|
+
end
|
506
|
+
|
507
|
+
def annotation=(value)
|
508
|
+
@annotation = value
|
509
|
+
end
|
510
|
+
|
511
|
+
private
|
512
|
+
def parse_annotation
|
513
|
+
begin
|
514
|
+
@track.elements['annotation'].text
|
515
|
+
rescue NoMethodError
|
516
|
+
return nil
|
517
|
+
end
|
518
|
+
end
|
519
|
+
|
112
520
|
end
|
113
521
|
class XSPF::Track
|
114
|
-
|
115
|
-
|
522
|
+
# URL of a place where this resource can be bought or more info can be found.
|
523
|
+
def info
|
524
|
+
@info
|
525
|
+
end
|
526
|
+
|
527
|
+
def info=(value)
|
528
|
+
@info = value
|
529
|
+
end
|
530
|
+
|
531
|
+
private
|
532
|
+
def parse_info
|
533
|
+
begin
|
534
|
+
@track.elements['info'].text
|
535
|
+
rescue NoMethodError
|
536
|
+
return nil
|
537
|
+
end
|
538
|
+
end
|
539
|
+
|
116
540
|
end
|
117
541
|
class XSPF::Track
|
118
|
-
|
119
|
-
|
542
|
+
# URL of an image to display for the duration of the track. XSPF::Track objects MAY contain exactly one.
|
543
|
+
def image
|
544
|
+
@image
|
545
|
+
end
|
546
|
+
|
547
|
+
def image=(value)
|
548
|
+
@image = value
|
549
|
+
end
|
550
|
+
|
551
|
+
private
|
552
|
+
def parse_image
|
553
|
+
begin
|
554
|
+
@track.elements['image'].text
|
555
|
+
rescue NoMethodError
|
556
|
+
return nil
|
557
|
+
end
|
558
|
+
end
|
559
|
+
|
120
560
|
end
|
121
561
|
class XSPF::Track
|
122
|
-
|
123
|
-
|
562
|
+
# Human-readable name of the collection from which the resource which defines the duration of track rendering comes. For a song originally published as a part of a CD or LP, this would be the title of the original release. This value is primarily for fuzzy lookups, though a user-agent may display it. XSPF::Track objects MAY contain exactly one.
|
563
|
+
def album
|
564
|
+
@album
|
565
|
+
end
|
566
|
+
|
567
|
+
def album=(value)
|
568
|
+
@album = value
|
569
|
+
end
|
570
|
+
|
571
|
+
private
|
572
|
+
def parse_album
|
573
|
+
begin
|
574
|
+
@track.elements['album'].text
|
575
|
+
rescue NoMethodError
|
576
|
+
return nil
|
577
|
+
end
|
578
|
+
end
|
579
|
+
|
124
580
|
end
|
125
581
|
class XSPF::Track
|
126
|
-
|
127
|
-
|
582
|
+
# Integer with value greater than zero giving the ordinal position of the media on the XSPF::Track#album. This value is primarily for fuzzy lookups, though a user-agent may display it. XSPF::Track objects MAY contain exactly one. It MUST be a valid XML Schema nonNegativeInteger.
|
583
|
+
def tracknum
|
584
|
+
@trackNum
|
585
|
+
end
|
586
|
+
|
587
|
+
def tracknum=(value)
|
588
|
+
@tracknum = value
|
589
|
+
end
|
590
|
+
|
591
|
+
private
|
592
|
+
def parse_tracknum
|
593
|
+
begin
|
594
|
+
@track.elements['trackNum'].text
|
595
|
+
rescue NoMethodError
|
596
|
+
return nil
|
597
|
+
end
|
598
|
+
end
|
599
|
+
|
128
600
|
end
|
129
601
|
class XSPF::Track
|
130
|
-
|
131
|
-
|
602
|
+
# The time to render a resource, in milliseconds. It MUST be a valid XML Schema nonNegativeInteger. This value is only a hint -- different XSPF generators will generate slightly different values. A user-agent MUST NOT use this value to determine the rendering duration, since the data will likely be low quality. XSPF::Track objects MAY contain exactly one duration element.
|
603
|
+
def duration
|
604
|
+
@duration
|
605
|
+
end
|
606
|
+
|
607
|
+
def duration=(value)
|
608
|
+
@duration = value
|
609
|
+
end
|
610
|
+
|
611
|
+
private
|
612
|
+
def parse_duration
|
613
|
+
begin
|
614
|
+
@track.elements['duration'].text
|
615
|
+
rescue NoMethodError
|
616
|
+
return nil
|
617
|
+
end
|
618
|
+
end
|
619
|
+
|
132
620
|
end
|
133
621
|
class XSPF::Track
|
134
|
-
|
135
|
-
|
622
|
+
# The extension element allows non-XSPF XML to be included in XSPF documents without breaking XSPF validation. The purpose is to allow nested XML, which the meta and link elements do not. XSPF::Track objects MAY contain zero or more extension elements, but currently XSPF for Ruby returns only the first one.
|
623
|
+
def extension
|
624
|
+
@extension
|
625
|
+
end
|
626
|
+
|
627
|
+
def extension=(value)
|
628
|
+
@extension = value
|
629
|
+
end
|
630
|
+
|
631
|
+
private
|
632
|
+
def parse_extension
|
633
|
+
begin
|
634
|
+
@track.elements['extension'].text
|
635
|
+
rescue NoMethodError
|
636
|
+
return nil
|
637
|
+
end
|
638
|
+
end
|
639
|
+
|
136
640
|
end
|
137
641
|
class XSPF::Track
|
138
|
-
|
139
|
-
|
642
|
+
# The link element allows non-XSPF web resources to be included in XSPF documents without breaking XSPF validation. A valid _link_ element has a _rel_ attribute and a _content_ element, obtained with XSPF::Track#link_rel and XSPF::Track#link_content respectively. XSPF::Track objects MAY contain zero or more meta elements, but currently XSPF for Ruby returns only the first one.
|
643
|
+
def link_content
|
644
|
+
@link_content
|
645
|
+
end
|
646
|
+
|
647
|
+
def link_content=(value)
|
648
|
+
@link_content = value
|
649
|
+
end
|
650
|
+
|
651
|
+
private
|
652
|
+
def parse_link_content
|
653
|
+
begin
|
654
|
+
@track.elements['link'].text
|
655
|
+
rescue NoMethodError
|
656
|
+
return nil
|
657
|
+
end
|
658
|
+
end
|
659
|
+
|
140
660
|
end
|
141
661
|
class XSPF::Track
|
142
|
-
|
143
|
-
|
662
|
+
# The link element allows non-XSPF web resources to be included in XSPF documents without breaking XSPF validation. A valid _link_ element has a _rel_ attribute and a _content_ element, obtained with XSPF::Track#link_rel and XSPF::Track#link_content respectively. XSPF::Track objects MAY contain zero or more link elements, but currently XSPF for Ruby returns only the first one.
|
663
|
+
def link_rel
|
664
|
+
@link_rel
|
665
|
+
end
|
666
|
+
|
667
|
+
def link_rel=(value)
|
668
|
+
@link_rel = value
|
669
|
+
end
|
670
|
+
|
671
|
+
private
|
672
|
+
def parse_link_rel
|
673
|
+
begin
|
674
|
+
@track.elements['link'].attributes['rel']
|
675
|
+
rescue NoMethodError
|
676
|
+
return nil
|
677
|
+
end
|
678
|
+
end
|
679
|
+
|
144
680
|
end
|
145
681
|
class XSPF::Track
|
146
|
-
|
147
|
-
|
682
|
+
# The meta element allows non-XSPF metadata to be included in XSPF documents without breaking XSPF validation. A valid _meta_ element has a _rel_ attribute and a _content_ element, obtained with XSPF::Track#meta_rel and XSPF::Track#meta_content respectively. XSPF::Track objects MAY contain zero or more meta elements, but currently XSPF for Ruby returns only the first one.
|
683
|
+
def meta_content
|
684
|
+
@meta_content
|
685
|
+
end
|
686
|
+
|
687
|
+
def meta_content=(value)
|
688
|
+
@meta_content = value
|
689
|
+
end
|
690
|
+
|
691
|
+
private
|
692
|
+
def parse_meta_content
|
693
|
+
begin
|
694
|
+
@track.elements['meta'].text
|
695
|
+
rescue NoMethodError
|
696
|
+
return nil
|
697
|
+
end
|
698
|
+
end
|
699
|
+
|
148
700
|
end
|
149
701
|
class XSPF::Track
|
150
|
-
|
151
|
-
|
702
|
+
# The meta element allows non-XSPF metadata to be included in XSPF documents without breaking XSPF validation. A valid _meta_ element has a _rel_ attribute and a _content_ element, obtained with XSPF::Track#meta_rel and XSPF::Track#meta_content respectively. XSPF::Track objects MAY contain zero or more meta elements, but currently XSPF for Ruby returns only the first one.
|
703
|
+
def meta_rel
|
704
|
+
@meta_rel
|
705
|
+
end
|
706
|
+
|
707
|
+
def meta_rel=(value)
|
708
|
+
@meta_rel = value
|
709
|
+
end
|
710
|
+
|
711
|
+
private
|
712
|
+
def parse_meta_rel
|
713
|
+
begin
|
714
|
+
@track.elements['meta'].attributes['rel']
|
715
|
+
rescue NoMethodError
|
716
|
+
return nil
|
717
|
+
end
|
718
|
+
end
|
719
|
+
|
152
720
|
end
|