|
1 | 1 | /***
|
2 | 2 | This file is part of snapcast
|
3 |
| - Copyright (C) 2014-2022 Johannes Pohl |
| 3 | + Copyright (C) 2014-2024 Johannes Pohl |
4 | 4 |
|
5 | 5 | This program is free software: you can redistribute it and/or modify
|
6 | 6 | it under the terms of the GNU General Public License as published by
|
@@ -172,10 +172,14 @@ int main(int argc, char** argv)
|
172 | 172 | hw_mixer_supported = true;
|
173 | 173 | #endif
|
174 | 174 | std::shared_ptr<popl::Value<std::string>> mixer_mode;
|
| 175 | + |
| 176 | + std::string mixers = "software"; |
175 | 177 | if (hw_mixer_supported)
|
176 |
| - mixer_mode = op.add<Value<string>>("", "mixer", "software|hardware|script|none|?[:<options>]", "software"); |
177 |
| - else |
178 |
| - mixer_mode = op.add<Value<string>>("", "mixer", "software|script|none|?[:<options>]", "software"); |
| 178 | + mixers += "|hardware"; |
| 179 | +#ifdef SUPPORTS_VOLUME_SCRIPT |
| 180 | + mixers += "|script"; |
| 181 | +#endif |
| 182 | + mixer_mode = op.add<Value<string>>("", "mixer", mixers + "|none|?[:<options>]", "software"); |
179 | 183 |
|
180 | 184 | // daemon settings
|
181 | 185 | #ifdef HAS_DAEMON
|
@@ -400,16 +404,26 @@ int main(int argc, char** argv)
|
400 | 404 | settings.player.mixer.mode = ClientSettings::Mixer::Mode::software;
|
401 | 405 | else if ((mode == "hardware") && hw_mixer_supported)
|
402 | 406 | settings.player.mixer.mode = ClientSettings::Mixer::Mode::hardware;
|
| 407 | +#ifdef SUPPORTS_VOLUME_SCRIPT |
403 | 408 | else if (mode == "script")
|
404 | 409 | settings.player.mixer.mode = ClientSettings::Mixer::Mode::script;
|
| 410 | +#endif |
405 | 411 | else if (mode == "none")
|
406 | 412 | settings.player.mixer.mode = ClientSettings::Mixer::Mode::none;
|
407 | 413 | else if ((mode == "?") || (mode == "help"))
|
408 | 414 | {
|
409 |
| - cout << "mixer can be one of 'software', " << (hw_mixer_supported ? "'hardware', " : "") << "'script', 'none'\n" |
| 415 | + cout << "mixer can be one of 'software', " << (hw_mixer_supported ? "'hardware', " : "") |
| 416 | +#ifdef SUPPORTS_VOLUME_SCRIPT |
| 417 | + << "'script', " |
| 418 | +#endif |
| 419 | + << "'none'\n" |
410 | 420 | << "followed by optional parameters:\n"
|
411 | 421 | << " * software[:poly[:<exponent>]|exp[:<base>]]\n"
|
412 |
| - << (hw_mixer_supported ? " * hardware[:<mixer name>]\n" : "") << " * script[:<script filename>]\n"; |
| 422 | + << (hw_mixer_supported ? " * hardware[:<mixer name>]\n" : "") |
| 423 | +#ifdef SUPPORTS_VOLUME_SCRIPT |
| 424 | + << " * script[:<script filename>]" |
| 425 | +#endif |
| 426 | + << "\n"; |
413 | 427 | exit(EXIT_SUCCESS);
|
414 | 428 | }
|
415 | 429 | else
|
|
0 commit comments