remove unused option variables

This commit is contained in:
badaix 2017-09-19 23:47:58 +02:00
parent d9a499fb5b
commit 9893a79b26
2 changed files with 13 additions and 14 deletions

View file

@ -85,17 +85,17 @@ int main (int argc, char **argv)
auto versionSwitch = op.add<Switch>("v", "version", "show version number"); auto versionSwitch = op.add<Switch>("v", "version", "show version number");
#if defined(HAS_ALSA) #if defined(HAS_ALSA)
auto listSwitch = op.add<Switch>("l", "list", "list pcm devices"); auto listSwitch = op.add<Switch>("l", "list", "list pcm devices");
auto soundcardValue = op.add<Value<string>>("s", "soundcard", "index or name of the soundcard", "default", &soundcard); /*auto soundcardValue =*/ op.add<Value<string>>("s", "soundcard", "index or name of the soundcard", "default", &soundcard);
#endif #endif
auto hostValue = op.add<Value<string>>("h", "host", "server hostname or ip address", "", &host); /*auto hostValue =*/ op.add<Value<string>>("h", "host", "server hostname or ip address", "", &host);
auto portValue = op.add<Value<size_t>>("p", "port", "server port", 1704, &port); /*auto portValue =*/ op.add<Value<size_t>>("p", "port", "server port", 1704, &port);
#ifdef HAS_DAEMON #ifdef HAS_DAEMON
int processPriority(-3); int processPriority(-3);
auto daemonOption = op.add<Implicit<int>>("d", "daemon", "daemonize, optional process priority [-20..19]", -3, &processPriority); auto daemonOption = op.add<Implicit<int>>("d", "daemon", "daemonize, optional process priority [-20..19]", -3, &processPriority);
auto userValue = op.add<Value<string>>("", "user", "the user[:group] to run snapclient as when daemonized"); auto userValue = op.add<Value<string>>("", "user", "the user[:group] to run snapclient as when daemonized");
#endif #endif
auto latencyValue = op.add<Value<int>>("", "latency", "latency of the soundcard", 0, &latency); /*auto latencyValue =*/ op.add<Value<int>>("", "latency", "latency of the soundcard", 0, &latency);
auto instanceValue = op.add<Value<size_t>>("i", "instance", "instance id", 1, &instance); /*auto instanceValue =*/ op.add<Value<size_t>>("i", "instance", "instance id", 1, &instance);
auto hostIdValue = op.add<Value<string>>("", "hostID", "unique host id", ""); auto hostIdValue = op.add<Value<string>>("", "hostID", "unique host id", "");
try try

View file

@ -57,22 +57,22 @@ int main(int argc, char* argv[])
{ {
StreamServerSettings settings; StreamServerSettings settings;
std::string pcmStream = "pipe:///tmp/snapfifo?name=default"; std::string pcmStream = "pipe:///tmp/snapfifo?name=default";
int processPriority(0);
OptionParser op("Allowed options"); OptionParser op("Allowed options");
auto helpSwitch = op.add<Switch>("h", "help", "Produce help message"); auto helpSwitch = op.add<Switch>("h", "help", "Produce help message");
auto debugSwitch = op.add<Switch, Attribute::hidden>("", "debug", "enable debug logging"); auto debugSwitch = op.add<Switch, Attribute::hidden>("", "debug", "enable debug logging");
auto versionSwitch = op.add<Switch>("v", "version", "Show version number"); auto versionSwitch = op.add<Switch>("v", "version", "Show version number");
auto portValue = op.add<Value<size_t>>("p", "port", "Server port", settings.port, &settings.port); /*auto portValue =*/ op.add<Value<size_t>>("p", "port", "Server port", settings.port, &settings.port);
auto controlPortValue = op.add<Value<size_t>>("", "controlPort", "Remote control port", settings.controlPort, &settings.controlPort); /*auto controlPortValue =*/ op.add<Value<size_t>>("", "controlPort", "Remote control port", settings.controlPort, &settings.controlPort);
auto streamValue = op.add<Value<string>>("s", "stream", "URI of the PCM input stream.\nFormat: TYPE://host/path?name=NAME\n[&codec=CODEC]\n[&sampleformat=SAMPLEFORMAT]", pcmStream, &pcmStream); auto streamValue = op.add<Value<string>>("s", "stream", "URI of the PCM input stream.\nFormat: TYPE://host/path?name=NAME\n[&codec=CODEC]\n[&sampleformat=SAMPLEFORMAT]", pcmStream, &pcmStream);
auto sampleFormatValue = op.add<Value<string>>("", "sampleformat", "Default sample format", settings.sampleFormat); /*auto sampleFormatValue =*/ op.add<Value<string>>("", "sampleformat", "Default sample format", settings.sampleFormat, &settings.sampleFormat);
auto codecValue = op.add<Value<string>>("c", "codec", "Default transport codec\n(flac|ogg|pcm)[:options]\nType codec:? to get codec specific options", settings.codec, &settings.codec); /*auto codecValue =*/ op.add<Value<string>>("c", "codec", "Default transport codec\n(flac|ogg|pcm)[:options]\nType codec:? to get codec specific options", settings.codec, &settings.codec);
auto streamBufferValue = op.add<Value<size_t>>("", "streamBuffer", "Default stream read buffer [ms]", settings.streamReadMs, &settings.streamReadMs); /*auto streamBufferValue =*/ op.add<Value<size_t>>("", "streamBuffer", "Default stream read buffer [ms]", settings.streamReadMs, &settings.streamReadMs);
auto bufferValue = op.add<Value<int>>("b", "buffer", "Buffer [ms]", settings.bufferMs, &settings.bufferMs); /*auto bufferValue =*/ op.add<Value<int>>("b", "buffer", "Buffer [ms]", settings.bufferMs, &settings.bufferMs);
auto muteSwitch = op.add<Switch>("", "sendToMuted", "Send audio to muted clients", &settings.sendAudioToMutedClients); /*auto muteSwitch =*/ op.add<Switch>("", "sendToMuted", "Send audio to muted clients", &settings.sendAudioToMutedClients);
#ifdef HAS_DAEMON #ifdef HAS_DAEMON
int processPriority(0);
auto daemonOption = op.add<Implicit<int>>("d", "daemon", "Daemonize\noptional process priority [-20..19]", 0, &processPriority); auto daemonOption = op.add<Implicit<int>>("d", "daemon", "Daemonize\noptional process priority [-20..19]", 0, &processPriority);
auto userValue = op.add<Value<string>>("", "user", "the user[:group] to run snapserver as when daemonized", ""); auto userValue = op.add<Value<string>>("", "user", "the user[:group] to run snapserver as when daemonized", "");
#endif #endif
@ -177,7 +177,6 @@ int main(int argc, char* argv[])
if (settings.bufferMs < 400) if (settings.bufferMs < 400)
settings.bufferMs = 400; settings.bufferMs = 400;
settings.sampleFormat = sampleFormatValue->value();
asio::io_service io_service; asio::io_service io_service;
std::unique_ptr<StreamServer> streamServer(new StreamServer(&io_service, settings)); std::unique_ptr<StreamServer> streamServer(new StreamServer(&io_service, settings));