don't show DAC list option if unavailable

This commit is contained in:
Johannes Pohl 2016-09-20 14:15:29 +02:00
parent 24f432acdc
commit 2d89a08691

View file

@ -86,10 +86,12 @@ int main (int argc, char **argv)
OptionParser op("Allowed options"); OptionParser op("Allowed options");
op.add(helpSwitch) op.add(helpSwitch)
.add(versionSwitch) .add(versionSwitch)
.add(listSwitch)
.add(hostValue) .add(hostValue)
.add(portValue) .add(portValue)
#if defined(HAS_ALSA)
.add(listSwitch)
.add(soundcardValue) .add(soundcardValue)
#endif
#ifdef HAS_DAEMON #ifdef HAS_DAEMON
.add(daemonOption) .add(daemonOption)
#endif #endif
@ -157,11 +159,13 @@ int main (int argc, char **argv)
} }
PcmDevice pcmDevice = getPcmDevice(soundcard); PcmDevice pcmDevice = getPcmDevice(soundcard);
#if defined(HAS_ALSA)
if (pcmDevice.idx == -1) if (pcmDevice.idx == -1)
{ {
cout << "soundcard \"" << soundcard << "\" not found\n"; cout << "soundcard \"" << soundcard << "\" not found\n";
// exit(EXIT_FAILURE); // exit(EXIT_FAILURE);
} }
#endif
if (host.empty()) if (host.empty())
{ {