diff --git a/src/input/plugins/AlsaInputPlugin.cxx b/src/input/plugins/AlsaInputPlugin.cxx index 6a98a212e..5a14d43c3 100644 --- a/src/input/plugins/AlsaInputPlugin.cxx +++ b/src/input/plugins/AlsaInputPlugin.cxx @@ -62,7 +62,7 @@ class AlsaInputStream final snd_pcm_t *capture_handle; const size_t frame_size; - AlsaNonBlockPcm non_block; + Alsa::NonBlockPcm non_block; InjectEvent defer_invalidate_sockets; diff --git a/src/lib/alsa/NonBlock.cxx b/src/lib/alsa/NonBlock.cxx index a9e8f0506..800bc4886 100644 --- a/src/lib/alsa/NonBlock.cxx +++ b/src/lib/alsa/NonBlock.cxx @@ -5,8 +5,10 @@ #include "Error.hxx" #include "event/MultiSocketMonitor.hxx" +namespace Alsa { + Event::Duration -AlsaNonBlockPcm::PrepareSockets(MultiSocketMonitor &m, snd_pcm_t *pcm) +NonBlockPcm::PrepareSockets(MultiSocketMonitor &m, snd_pcm_t *pcm) { int count = snd_pcm_poll_descriptors_count(pcm); if (count <= 0) { @@ -31,8 +33,7 @@ AlsaNonBlockPcm::PrepareSockets(MultiSocketMonitor &m, snd_pcm_t *pcm) } void -AlsaNonBlockPcm::DispatchSockets(MultiSocketMonitor &m, - snd_pcm_t *pcm) +NonBlockPcm::DispatchSockets(MultiSocketMonitor &m, snd_pcm_t *pcm) { int count = snd_pcm_poll_descriptors_count(pcm); if (count <= 0) @@ -57,7 +58,7 @@ AlsaNonBlockPcm::DispatchSockets(MultiSocketMonitor &m, } Event::Duration -AlsaNonBlockMixer::PrepareSockets(MultiSocketMonitor &m, snd_mixer_t *mixer) noexcept +NonBlockMixer::PrepareSockets(MultiSocketMonitor &m, snd_mixer_t *mixer) noexcept { int count = snd_mixer_poll_descriptors_count(mixer); if (count <= 0) { @@ -76,8 +77,7 @@ AlsaNonBlockMixer::PrepareSockets(MultiSocketMonitor &m, snd_mixer_t *mixer) noe } void -AlsaNonBlockMixer::DispatchSockets(MultiSocketMonitor &m, - snd_mixer_t *mixer) noexcept +NonBlockMixer::DispatchSockets(MultiSocketMonitor &m, snd_mixer_t *mixer) noexcept { int count = snd_mixer_poll_descriptors_count(mixer); if (count <= 0) @@ -98,3 +98,5 @@ AlsaNonBlockMixer::DispatchSockets(MultiSocketMonitor &m, unsigned short dummy; snd_mixer_poll_descriptors_revents(mixer, pfds, i - pfds, &dummy); } + +} // namespace Alsa diff --git a/src/lib/alsa/NonBlock.hxx b/src/lib/alsa/NonBlock.hxx index 7c8eade59..aae992f50 100644 --- a/src/lib/alsa/NonBlock.hxx +++ b/src/lib/alsa/NonBlock.hxx @@ -10,11 +10,13 @@ class MultiSocketMonitor; +namespace Alsa { + /** * Helper class for #MultiSocketMonitor's virtual methods which * manages the file descriptors for a #snd_pcm_t. */ -class AlsaNonBlockPcm { +class NonBlockPcm { ReusableArray pfd_buffer; public: @@ -37,7 +39,7 @@ public: * Helper class for #MultiSocketMonitor's virtual methods which * manages the file descriptors for a #snd_mixer_t. */ -class AlsaNonBlockMixer { +class NonBlockMixer { ReusableArray pfd_buffer; public: @@ -50,3 +52,5 @@ public: */ void DispatchSockets(MultiSocketMonitor &m, snd_mixer_t *mixer) noexcept; }; + +} // namespace Alsa diff --git a/src/mixer/plugins/AlsaMixerPlugin.cxx b/src/mixer/plugins/AlsaMixerPlugin.cxx index 25c6b1664..cc849ac30 100644 --- a/src/mixer/plugins/AlsaMixerPlugin.cxx +++ b/src/mixer/plugins/AlsaMixerPlugin.cxx @@ -29,7 +29,7 @@ class AlsaMixerMonitor final : MultiSocketMonitor { snd_mixer_t *mixer; - AlsaNonBlockMixer non_block; + Alsa::NonBlockMixer non_block; public: AlsaMixerMonitor(EventLoop &_loop, snd_mixer_t *_mixer) noexcept diff --git a/src/output/plugins/AlsaOutputPlugin.cxx b/src/output/plugins/AlsaOutputPlugin.cxx index f1ad85626..a67a91478 100644 --- a/src/output/plugins/AlsaOutputPlugin.cxx +++ b/src/output/plugins/AlsaOutputPlugin.cxx @@ -210,7 +210,7 @@ class AlsaOutput final */ std::byte *silence; - AlsaNonBlockPcm non_block; + Alsa::NonBlockPcm non_block; /** * For copying data from OutputThread to IOThread.