-
Notifications
You must be signed in to change notification settings - Fork 353
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
output/Registry: replace output_plugins_for_each() with a container c…
…lass
- Loading branch information
1 parent
29747a2
commit cf5970a
Showing
4 changed files
with
22 additions
and
19 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,20 +1,21 @@ | ||
// SPDX-License-Identifier: GPL-2.0-or-later | ||
// Copyright The Music Player Daemon Project | ||
|
||
#ifndef MPD_OUTPUT_LIST_HXX | ||
#define MPD_OUTPUT_LIST_HXX | ||
#pragma once | ||
|
||
#include "util/DereferenceIterator.hxx" | ||
#include "util/TerminatedArray.hxx" | ||
|
||
struct AudioOutputPlugin; | ||
|
||
extern const AudioOutputPlugin *const audio_output_plugins[]; | ||
|
||
static inline auto | ||
GetAllAudioOutputPlugins() noexcept | ||
{ | ||
return DereferenceContainerAdapter{TerminatedArray<const AudioOutputPlugin *const, nullptr>{audio_output_plugins}}; | ||
} | ||
|
||
[[gnu::pure]] | ||
const AudioOutputPlugin * | ||
GetAudioOutputPluginByName(const char *name) noexcept; | ||
|
||
#define audio_output_plugins_for_each(plugin) \ | ||
for (const AudioOutputPlugin *plugin, \ | ||
*const*output_plugin_iterator = &audio_output_plugins[0]; \ | ||
(plugin = *output_plugin_iterator) != nullptr; ++output_plugin_iterator) | ||
|
||
#endif |