mirror of
https://github.com/badaix/snapcast.git
synced 2025-05-10 23:56:43 +02:00
added pcmReaderFactory
This commit is contained in:
parent
48627f2ec0
commit
b46b5efde4
10 changed files with 172 additions and 7 deletions
|
@ -46,6 +46,7 @@ int main(int argc, char* argv[])
|
|||
try
|
||||
{
|
||||
StreamServerSettings settings;
|
||||
std::string pcmStream = "pipe:///tmp/snapfifo";
|
||||
int processPriority(-3);
|
||||
|
||||
Switch helpSwitch("h", "help", "produce help message");
|
||||
|
@ -54,7 +55,7 @@ int main(int argc, char* argv[])
|
|||
Value<size_t> controlPortValue("", "controlPort", "Remote control port", settings.controlPort, &settings.controlPort);
|
||||
Value<string> sampleFormatValue("s", "sampleformat", "sample format", settings.sampleFormat.getFormat());
|
||||
Value<string> codecValue("c", "codec", "transport codec [flac|ogg|pcm][:options]\nType codec:? to get codec specific options", settings.codec, &settings.codec);
|
||||
Value<string> fifoValue("f", "fifo", "name of the input fifo file", settings.fifoName, &settings.fifoName);
|
||||
Value<string> fifoValue("f", "fifo", "name of the input fifo file", pcmStream, &pcmStream);
|
||||
Implicit<int> daemonOption("d", "daemon", "daemonize\noptional process priority [-20..19]", 0, &processPriority);
|
||||
Value<int> bufferValue("b", "buffer", "buffer [ms]", settings.bufferMs, &settings.bufferMs);
|
||||
Value<size_t> pipeBufferValue("", "pipeReadBuffer", "pipe read buffer [ms]", settings.pipeReadMs, &settings.pipeReadMs);
|
||||
|
@ -99,6 +100,15 @@ int main(int argc, char* argv[])
|
|||
exit(EXIT_SUCCESS);
|
||||
}
|
||||
|
||||
if (!fifoValue.isSet())
|
||||
settings.pcmStreams.push_back(fifoValue.getValue());
|
||||
|
||||
for (size_t n=0; n<fifoValue.count(); ++n)
|
||||
{
|
||||
cout << fifoValue.getValue(n) << "\n";
|
||||
settings.pcmStreams.push_back(fifoValue.getValue(n));
|
||||
}
|
||||
|
||||
if (settings.codec.find(":?") != string::npos)
|
||||
{
|
||||
EncoderFactory encoderFactory;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue