48 lines
1.8 KiB
Racket
48 lines
1.8 KiB
Racket
#lang scribble/manual
|
|
|
|
@(require (for-label racket/base
|
|
racket/contract
|
|
rkt-web-player
|
|
rkt-web-player/player-agent))
|
|
|
|
@title{RKT Web Player}
|
|
@author{Hans van Dijkema}
|
|
|
|
@defmodule[rkt-web-player]
|
|
|
|
RKT Web Player combines local playback through @tt{racket-audio}
|
|
with UPnP and Sonos discovery and playback through
|
|
@tt{racket-audio-dlna}. The user interface is served to a web
|
|
browser by Racket's web server.
|
|
|
|
@defproc[(run-web-player
|
|
[music-paths (listof path-string?)]
|
|
[#:listen-ip listen-ip string? "127.0.0.1"]
|
|
[#:port port exact-positive-integer? 8080]
|
|
[#:dlna-port dlna-port exact-positive-integer? 8734]
|
|
[#:launch-browser? launch-browser? boolean? #t]) any/c] {
|
|
|
|
Treats every entry in @racket[music-paths] as a separate music library and
|
|
starts the web interface on @racket[listen-ip] and @racket[port]. Directory
|
|
contents are browsed one level at a time. Metadata and recursive contents are
|
|
only read when the user adds or plays a selected item.
|
|
|
|
The @racket[dlna-port] is used to publish local audio files to a selected
|
|
network renderer. Player resources are closed when the web server exits.
|
|
|
|
The default listen address only exposes the interface to the local computer.
|
|
Use a LAN address deliberately if other devices should control the player.
|
|
}
|
|
|
|
@defmodule[rkt-web-player/player-agent]
|
|
|
|
@defproc[(run-player-agent) any/c] {
|
|
|
|
Starts the graphical polling playback agent. The agent keeps a generated
|
|
256-bit application identifier in a user-specific INI file, registers with the
|
|
configured RKT Web Player server, downloads assigned tracks over HTTP, and
|
|
plays them with @tt{racket-audio}. Its configured display name is authoritative
|
|
and is followed by the server. Importing the module does not start the GUI; the
|
|
function must be called explicitly.
|
|
}
|