mirror of
https://github.com/badaix/snapcast.git
synced 2025-05-28 08:26:16 +02:00
Add autoplay option for librespot
This commit is contained in:
parent
bcf48a2b4e
commit
0256409189
2 changed files with 11 additions and 4 deletions
|
@ -14,6 +14,9 @@
|
||||||
# default values are commented
|
# default values are commented
|
||||||
# uncomment and edit to change them
|
# uncomment and edit to change them
|
||||||
|
|
||||||
|
# Settings can be overwritten on command line with:
|
||||||
|
# "--<section>.<name>=<value>", e.g. --server.threads=4
|
||||||
|
|
||||||
|
|
||||||
# General server settings #####################################################
|
# General server settings #####################################################
|
||||||
#
|
#
|
||||||
|
@ -103,14 +106,15 @@
|
||||||
# parameters have the form "key=value", they are concatenated with an "&" character
|
# parameters have the form "key=value", they are concatenated with an "&" character
|
||||||
# parameter "name" is mandatory for all streams, while codec, sampleformat and chunk_ms are optional
|
# parameter "name" is mandatory for all streams, while codec, sampleformat and chunk_ms are optional
|
||||||
# and will override the default codec, sampleformat or chunk_ms settings
|
# and will override the default codec, sampleformat or chunk_ms settings
|
||||||
|
# Non blocking streams support the dryout_ms parameter: when no new data is read from the stream, send silence to the clients
|
||||||
# Available types are:
|
# Available types are:
|
||||||
# pipe: pipe:///<path/to/pipe>?name=<name>
|
# pipe: pipe:///<path/to/pipe>?name=<name>[&mode=create][&dryout_ms=2000], mode can be "create" or "read"
|
||||||
# librespot: librespot:///<path/to/librespot>?name=<name>[&username=<my username>&password=<my password>][&devicename=Snapcast][&bitrate=320][&wd_timeout=7800][&volume=100][&onevent=""][&nomalize=false]
|
# librespot: librespot:///<path/to/librespot>?name=<name>[&dryout_ms=2000][&username=<my username>&password=<my password>][&devicename=Snapcast][&bitrate=320][&wd_timeout=7800][&volume=100][&onevent=""][&nomalize=false][&autoplay=false]
|
||||||
# note that you need to have the librespot binary on your machine
|
# note that you need to have the librespot binary on your machine
|
||||||
# sampleformat will be set to "44100:16:2"
|
# sampleformat will be set to "44100:16:2"
|
||||||
# file: file:///<path/to/PCM/file>?name=<name>
|
# file: file:///<path/to/PCM/file>?name=<name>
|
||||||
# process: process:///<path/to/process>?name=<name>[&wd_timeout=0][&log_stderr=false][¶ms=<process arguments>]
|
# process: process:///<path/to/process>?name=<name>[&dryout_ms=2000][&wd_timeout=0][&log_stderr=false][¶ms=<process arguments>]
|
||||||
# airplay: airplay:///<path/to/airplay>?name=<name>[&port=5000]
|
# airplay: airplay:///<path/to/airplay>?name=<name>[&dryout_ms=2000][&port=5000]
|
||||||
# note that you need to have the airplay binary on your machine
|
# note that you need to have the airplay binary on your machine
|
||||||
# sampleformat will be set to "44100:16:2"
|
# sampleformat will be set to "44100:16:2"
|
||||||
# tcp server: tcp://<listen IP, e.g. 127.0.0.1>:<port>?name=<name>[&mode=server]
|
# tcp server: tcp://<listen IP, e.g. 127.0.0.1>:<port>?name=<name>[&mode=server]
|
||||||
|
|
|
@ -44,6 +44,7 @@ LibrespotStream::LibrespotStream(PcmListener* pcmListener, boost::asio::io_conte
|
||||||
string devicename = uri_.getQuery("devicename", "Snapcast");
|
string devicename = uri_.getQuery("devicename", "Snapcast");
|
||||||
string onevent = uri_.getQuery("onevent", "");
|
string onevent = uri_.getQuery("onevent", "");
|
||||||
bool normalize = (uri_.getQuery("normalize", "false") == "true");
|
bool normalize = (uri_.getQuery("normalize", "false") == "true");
|
||||||
|
bool autoplay = (uri_.getQuery("autoplay", "false") == "true");
|
||||||
killall_ = (uri_.getQuery("killall", "true") == "true");
|
killall_ = (uri_.getQuery("killall", "true") == "true");
|
||||||
|
|
||||||
if (username.empty() != password.empty())
|
if (username.empty() != password.empty())
|
||||||
|
@ -61,6 +62,8 @@ LibrespotStream::LibrespotStream(PcmListener* pcmListener, boost::asio::io_conte
|
||||||
params_ += " --onevent \"" + onevent + "\"";
|
params_ += " --onevent \"" + onevent + "\"";
|
||||||
if (normalize)
|
if (normalize)
|
||||||
params_ += " --enable-volume-normalisation";
|
params_ += " --enable-volume-normalisation";
|
||||||
|
if (autoplay)
|
||||||
|
params_ += " --autoplay";
|
||||||
params_ += " --verbose";
|
params_ += " --verbose";
|
||||||
|
|
||||||
if (uri_.query.find("username") != uri_.query.end())
|
if (uri_.query.find("username") != uri_.query.end())
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue