mirror of
https://github.com/badaix/snapcast.git
synced 2025-06-10 23:01:45 +02:00
Fix some TODOs
This commit is contained in:
parent
775fd21f32
commit
fce34d82c8
3 changed files with 14 additions and 9 deletions
|
@ -155,9 +155,9 @@ int main(int argc, char** argv)
|
||||||
#endif
|
#endif
|
||||||
std::shared_ptr<popl::Value<std::string>> mixer_mode;
|
std::shared_ptr<popl::Value<std::string>> mixer_mode;
|
||||||
if (hw_mixer_supported)
|
if (hw_mixer_supported)
|
||||||
mixer_mode = op.add<Value<string>>("", "mixer", "<software|hardware|script|none>[:<options>]", "software");
|
mixer_mode = op.add<Value<string>>("", "mixer", "software|hardware|script|none|?[:<options>]", "software");
|
||||||
else
|
else
|
||||||
mixer_mode = op.add<Value<string>>("", "mixer", "<software|script|none>[:<options>]", "software");
|
mixer_mode = op.add<Value<string>>("", "mixer", "software|script|none|?[:<options>]", "software");
|
||||||
|
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
|
@ -314,6 +314,15 @@ int main(int argc, char** argv)
|
||||||
settings.player.mixer.mode = ClientSettings::Mixer::Mode::script;
|
settings.player.mixer.mode = ClientSettings::Mixer::Mode::script;
|
||||||
else if (mode == "none")
|
else if (mode == "none")
|
||||||
settings.player.mixer.mode = ClientSettings::Mixer::Mode::none;
|
settings.player.mixer.mode = ClientSettings::Mixer::Mode::none;
|
||||||
|
else if ((mode == "?") || (mode == "help"))
|
||||||
|
{
|
||||||
|
cout << "mixer can be one of 'software', " << (hw_mixer_supported ? "'hardware', " : "") << "'script', 'none'\n"
|
||||||
|
<< "followed by optional parameters:\n"
|
||||||
|
<< " * software[:poly[:<exponent>]|exp[:<base>]]\n"
|
||||||
|
<< (hw_mixer_supported ? " * hardware[:<mixer name>]\n":"")
|
||||||
|
<< " * script[:<script filename>]\n";
|
||||||
|
exit(EXIT_SUCCESS);
|
||||||
|
}
|
||||||
else
|
else
|
||||||
throw SnapException("Mixer mode not supported: " + mode);
|
throw SnapException("Mixer mode not supported: " + mode);
|
||||||
|
|
||||||
|
|
|
@ -90,7 +90,7 @@ void Config::init(const std::string& root_directory, const std::string& user, co
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
ifstream ifs(filename_, std::ifstream::in);
|
ifstream ifs(filename_, std::ifstream::in);
|
||||||
if ((ifs.good()) && (ifs.peek() != std::ifstream::traits_type::eof()))
|
if (ifs.good() && (ifs.peek() != std::ifstream::traits_type::eof()))
|
||||||
{
|
{
|
||||||
json j;
|
json j;
|
||||||
ifs >> j;
|
ifs >> j;
|
||||||
|
|
|
@ -221,10 +221,6 @@ int main(int argc, char* argv[])
|
||||||
else
|
else
|
||||||
throw SnapException("Invalid log sink: " + settings.logging.sink);
|
throw SnapException("Invalid log sink: " + settings.logging.sink);
|
||||||
|
|
||||||
// TODO: op vs conf
|
|
||||||
for (const auto& opt : conf.unknown_options())
|
|
||||||
LOG(WARNING) << "unknown configuration option: " << opt << "\n";
|
|
||||||
|
|
||||||
if (!streamValue->is_set())
|
if (!streamValue->is_set())
|
||||||
settings.stream.pcmStreams.push_back(streamValue->value());
|
settings.stream.pcmStreams.push_back(streamValue->value());
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue