Switch to unified view

a/doc/upmpdcli-manual.txt b/doc/upmpdcli-manual.txt
...
...
268
the radio links to work.
268
the radio links to work.
269
269
270
Radio stations can be defined in the configuration (at the end because of
270
Radio stations can be defined in the configuration (at the end because of
271
the use of section indicators), or in in a separate file by setting the
271
the use of section indicators), or in in a separate file by setting the
272
<<ohproductroom,+radiolist+>> parameter in the main configuration.
272
<<ohproductroom,+radiolist+>> parameter in the main configuration.
273
274
Radio channels can be accessed by selecting the _Radio_ Source from an
275
OpenHome Control Point.
276
273
Example entry:
277
Example entry:
274
278
275
----
279
----
276
[radio Radio Teddy]
280
[radio Radio Teddy]
277
url = http://opml.radiotime.com/Tune.ashx?id=s80044
281
url = http://opml.radiotime.com/Tune.ashx?id=s80044
278
artUrl = http://cdn-radiotime-logos.tunein.com/s80044q.png
282
artUrl = http://cdn-radiotime-logos.tunein.com/s80044q.png
279
artScript = /path/to/some/script
283
artScript = /path/to/some/script
284
metaScript = /path/to/some/other/script
280
----
285
----
281
286
282
The section name must begin with +radio+, the rest will be displayed as the
287
The section name must begin with +radio+, the rest will be displayed as the
283
station name. +url+ and +artUrl+ designate the playlist or stream, and an
288
station name. The section has several possible entries. Only +url+ is
284
icon. +artUrl+ is optional.
289
mandatory, it points to the playlist or stream.
285
290
286
Radio channels can be accessed by selecting the _Radio_ Source from an
291
If set, +artUrl+ is a link to a static icon for the radio (displayed as
287
OpenHome Control Point.
292
album art).
293
294
If set, +artScript+ is the path to an executable script which can retrieve
295
the image for the currently playing title.
288
296
289
Some radios (e.g.  link:https://www.radioparadise.com/rp_2.php?#[Radio
297
Some radios (e.g.  link:https://www.radioparadise.com/rp_2.php?#[Radio
290
Paradise]) publish the album art for the currently playing title. The
298
Paradise]) publish the album art for the currently playing title. The
291
details vary. The +artScript+ parameter, if set, should point to an
299
details vary. The +artScript+ parameter, if set, should point to an
292
executable script which prints this dynamic art Uri to stdout. The image
300
executable script which prints this dynamic art Uri to stdout. The image
...
...
298
approach would use an XML parser of course):
306
approach would use an XML parser of course):
299
307
300
    curl --max-time 5 -s http://radioparadise.com/xml/now.xml | \
308
    curl --max-time 5 -s http://radioparadise.com/xml/now.xml | \
301
         grep '<coverart>' | sed -e 's/<coverart>//' -e 's!</coverart>!!'
309
         grep '<coverart>' | sed -e 's/<coverart>//' -e 's!</coverart>!!'
302
310
303
Also note that upmpdcli does not set a timeout for executing the
311
Also note that upmpdcli does not set a timeout for the +artScript+
304
+artScript+. A reasonable value should be used inside the script.
312
execution. A reasonable value should be used inside the script, to avoid
313
freezing upmpdcli forever.
314
315
If set, +metaScript+ is the path to an executable script which can retrieve
316
the metadata (possibly including art Url) for the currently playing title.
317
318
The script should output the metadata in JSON format. Example output
319
(the newlines and blank space are just here for readability):
320
321
----
322
{
323
    "title":"The title of the current track",
324
    "artist":"The artist playing",
325
    "artUrl":"https://www.somesite.com/path/to/image.jpg",
326
    "reload":103
327
}
328
----
329
330
The +reload+ value gives the time after which the script should be
331
re-executed (the clever radio sets this to the remaining song time). By
332
default, the script is executed every 10 S.
333
334
Complete exemple with metadata script:
335
336
----
337
[radio FIP (Paris)]
338
url = http://direct.fipradio.fr/live/fip-midfi.mp3
339
artUrl = http://www.fipradio.fr/sites/default/files/fip-quadri-filet.png
340
metaScript = /usr/local/bin/fip-paris-meta.rb
341
----
342
343
And the script (this one in Ruby, thanks to
344
link:https://github.com/distler[Jacques Distler]): 
345
346
----
347
#!/usr/bin/ruby
348
require 'net/http'
349
require 'json'
350
351
uri = URI('http://www.fipradio.fr/livemeta/7')
352
response = Net::HTTP.get(uri)
353
songs = JSON.parse(response)['steps'].values
354
now = Time.now
355
metadata = {}
356
songs.each do |song|
357
  song_end = Time.at(song['end'])
358
  if (song_end >= now && Time.at(song['start']) <= now)
359
    metadata = {'title' => song['title'], 'artist' => song['performers'],
360
       'artUrl' => song['visual'], 'reload' => (song_end - now + 1).to_i}
361
    break
362
  end
363
end
364
puts JSON.generate(metadata)
365
----
366
305
367
306
[[UPMPDCLI-SONGCAST]]
368
[[UPMPDCLI-SONGCAST]]
307
== Upmpdcli and Songcast
369
== Upmpdcli and Songcast
308
370
309
Upmpdcli implements the Receiver UPnP service, and uses an auxiliary
371
Upmpdcli implements the Receiver UPnP service, and uses an auxiliary
...
...
330
=== Upmpdcli Songcast Control Point compatibility
392
=== Upmpdcli Songcast Control Point compatibility
331
393
332
Upmpdcli Senders and Receivers can be mixed with Linn ones and controlled
394
Upmpdcli Senders and Receivers can be mixed with Linn ones and controlled
333
from Upplay or Bubble DS (an maybe other control points).
395
from Upplay or Bubble DS (an maybe other control points).
334
396
335
Upmpdcli Senders can't be controlled by Linn Kazoo (tested with release
397
Upmpdcli Senders can't be used by Linn Kazoo (tested with release
336
4.11.226), reason unknown.
398
4.11.226), the reason unknown, but neither Linn nor upmpdcli receivers can
399
be linked to an upmpdcli Sender using Kazoo.
337
400
338
Upmpdcli Receivers before release 1.2.14 are not visible in Linn Kazoo.
401
Upmpdcli Receivers before release 1.2.14 are not visible in Linn
402
Kazoo. Later versions can be linked, and stream, from a Linn Sender.
339
403
340
404
341
405
342
[[UPMPDCLI-RECEIVER]]
406
[[UPMPDCLI-RECEIVER]]
343
=== Upmpdcli Songcast Receiver
407
=== Upmpdcli Songcast Receiver