Everywhere: Hoist the Libraries folder to the top-level

This commit is contained in:
Timothy Flynn 2024-11-09 12:25:08 -05:00 committed by Andreas Kling
commit 93712b24bf
Notes: github-actions[bot] 2024-11-10 11:51:52 +00:00
4547 changed files with 104 additions and 113 deletions

View file

@ -0,0 +1,38 @@
/*
* Copyright (c) 2023, Gregory Bertilson <zaggy1024@gmail.com>
*
* SPDX-License-Identifier: BSD-2-Clause
*/
#include "PlaybackStream.h"
#include <AK/Platform.h>
#include <LibCore/ThreadedPromise.h>
#if defined(HAVE_PULSEAUDIO)
# include "PlaybackStreamPulseAudio.h"
#elif defined(AK_OS_MACOS)
# include "PlaybackStreamAudioUnit.h"
#elif defined(AK_OS_ANDROID)
# include "PlaybackStreamOboe.h"
#endif
namespace Audio {
ErrorOr<NonnullRefPtr<PlaybackStream>> PlaybackStream::create(OutputState initial_output_state, u32 sample_rate, u8 channels, u32 target_latency_ms, AudioDataRequestCallback&& data_request_callback)
{
VERIFY(data_request_callback);
// Create the platform-specific implementation for this stream.
#if defined(HAVE_PULSEAUDIO)
return PlaybackStreamPulseAudio::create(initial_output_state, sample_rate, channels, target_latency_ms, move(data_request_callback));
#elif defined(AK_OS_MACOS)
return PlaybackStreamAudioUnit::create(initial_output_state, sample_rate, channels, target_latency_ms, move(data_request_callback));
#elif defined(AK_OS_ANDROID)
return PlaybackStreamOboe::create(initial_output_state, sample_rate, channels, target_latency_ms, move(data_request_callback));
#else
(void)initial_output_state, (void)sample_rate, (void)channels, (void)target_latency_ms;
return Error::from_string_literal("Audio output is not available for this platform");
#endif
}
}