Commit f616bfe3 authored by Max Kellermann's avatar Max Kellermann

output/MultipleOutputs: add method HasName()

parent f2c3d866
...@@ -98,7 +98,7 @@ MultipleOutputs::Configure(EventLoop &event_loop, ...@@ -98,7 +98,7 @@ MultipleOutputs::Configure(EventLoop &event_loop,
mixer_listener, mixer_listener,
client, block, defaults, client, block, defaults,
&filter_factory); &filter_factory);
if (FindByName(output->GetName()) != nullptr) if (HasName(output->GetName()))
throw FormatRuntimeError("output devices with identical " throw FormatRuntimeError("output devices with identical "
"names: %s", output->GetName()); "names: %s", output->GetName());
......
...@@ -113,6 +113,14 @@ public: ...@@ -113,6 +113,14 @@ public:
gcc_pure gcc_pure
AudioOutputControl *FindByName(const char *name) noexcept; AudioOutputControl *FindByName(const char *name) noexcept;
/**
* Does an audio output device with this name exist?
*/
gcc_pure
bool HasName(const char *name) noexcept {
return FindByName(name) != nullptr;
}
void SetReplayGainMode(ReplayGainMode mode) noexcept; void SetReplayGainMode(ReplayGainMode mode) noexcept;
/** /**
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment