renamed command line parameters

This commit is contained in:
badaix 2016-01-24 15:12:27 +01:00
parent a9015edb22
commit f89ae0d501
5 changed files with 31 additions and 25 deletions

View file

@ -159,9 +159,9 @@ void Controller::worker()
else if (headerChunk->codec == "flac")
decoder_ = new FlacDecoder();
sampleFormat_ = decoder_->setHeader(headerChunk.get());
logO << "sample rate : " << sampleFormat_.rate << "Hz\n";
logO << "bits per sample: " << sampleFormat_.bits << "\n";
logO << "channels : " << sampleFormat_.channels << "\n";
logO << "sample rate: " << sampleFormat_.rate << "Hz\n";
logO << "bits/sample: " << sampleFormat_.bits << "\n";
logO << "channels : " << sampleFormat_.channels << "\n";
msg::Request timeReq(kTime);
for (size_t n=0; n<50 && active_; ++n)

View file

@ -2,12 +2,16 @@ snapserver (0.5.0-beta-1) unstable; urgency=low
* Features
-Added .default file
-Remote control API
-Remote control API (JSON)
-Android Snapclient with remote control
-PCM reader is configured by URI: path, name, codec, sample format, ...
* Bugfixes
-TODO
* General
-TODO
-SnapCast is renamed to Snapcast, SnapClient => Snapclient, SnapServer => Snapserver
-Snapcast protocol:
Less messaging: SampleFormat, Command, Ack, String
-Removed dependency to boost
-- Johannes Pohl <johannes.pohl@badaix.de> Tue, 29 Dec 2015 12:00:00 +0200

View file

@ -49,28 +49,30 @@ int main(int argc, char* argv[])
std::string pcmStream = "pipe:///tmp/snapfifo?name=default";
int processPriority(-3);
Switch helpSwitch("h", "help", "produce help message");
Switch versionSwitch("v", "version", "show version number");
Value<size_t> portValue("p", "port", "server port", settings.port, &settings.port);
Switch helpSwitch("h", "help", "Produce help message");
Switch versionSwitch("v", "version", "Show version number");
Value<size_t> portValue("p", "port", "Server port", settings.port, &settings.port);
Value<size_t> controlPortValue("", "controlPort", "Remote control port", settings.controlPort, &settings.controlPort);
Value<string> sampleFormatValue("s", "sampleformat", "sample format", settings.sampleFormat);
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", 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);
Value<string> streamValue("s", "stream", "URI of the PCM input stream.\nFormat: TYPE://host/path?name=NAME\n[&codec=CODEC]\n[&sampleformat=SAMPLEFORMAT]", pcmStream, &pcmStream);
Value<string> sampleFormatValue("", "sampleformat", "Default sample format", settings.sampleFormat);
Value<string> codecValue("", "codec", "Default transport codec\n(flac|ogg|pcm)[:options]\nType codec:? to get codec specific options", settings.codec, &settings.codec);
Value<size_t> streamBufferValue("", "streamBuffer", "Default stream read buffer [ms]", settings.streamReadMs, &settings.streamReadMs);
Value<int> bufferValue("b", "buffer", "Buffer [ms]", settings.bufferMs, &settings.bufferMs);
Implicit<int> daemonOption("d", "daemon", "Daemonize\noptional process priority [-20..19]", 0, &processPriority);
OptionParser op("Allowed options");
op.add(helpSwitch)
.add(versionSwitch)
.add(portValue)
.add(controlPortValue)
.add(streamValue)
.add(sampleFormatValue)
.add(codecValue)
.add(fifoValue)
.add(daemonOption)
.add(streamBufferValue)
.add(bufferValue)
.add(pipeBufferValue);
.add(daemonOption);
try
{
@ -100,13 +102,13 @@ int main(int argc, char* argv[])
exit(EXIT_SUCCESS);
}
if (!fifoValue.isSet())
settings.pcmStreams.push_back(fifoValue.getValue());
if (!streamValue.isSet())
settings.pcmStreams.push_back(streamValue.getValue());
for (size_t n=0; n<fifoValue.count(); ++n)
for (size_t n=0; n<streamValue.count(); ++n)
{
cout << fifoValue.getValue(n) << "\n";
settings.pcmStreams.push_back(fifoValue.getValue(n));
cout << streamValue.getValue(n) << "\n";
settings.pcmStreams.push_back(streamValue.getValue(n));
}
if (settings.codec.find(":?") != string::npos)

View file

@ -343,7 +343,7 @@ void StreamServer::start()
for (auto& streamUri: settings_.pcmStreams)
{
shared_ptr<PcmReader> reader(PcmReaderFactory::createPcmReader(this, streamUri, settings_.sampleFormat, settings_.codec, settings_.pipeReadMs));
shared_ptr<PcmReader> reader(PcmReaderFactory::createPcmReader(this, streamUri, settings_.sampleFormat, settings_.codec, settings_.streamReadMs));
pcmReader_.push_back(reader);
pcmReader_.back()->start();
}

View file

@ -49,7 +49,7 @@ struct StreamServerSettings
codec("flac"),
bufferMs(1000),
sampleFormat("48000:16:2"),
pipeReadMs(20)
streamReadMs(20)
{
}
size_t port;
@ -58,7 +58,7 @@ struct StreamServerSettings
std::string codec;
int32_t bufferMs;
std::string sampleFormat;
size_t pipeReadMs;
size_t streamReadMs;
};