mirror of
https://github.com/Lime3DS/Lime3DS.git
synced 2026-04-08 02:11:29 -06:00
Some checks are pending
citra-build / source (push) Waiting to run
citra-build / linux (appimage) (push) Waiting to run
citra-build / linux (appimage-wayland) (push) Waiting to run
citra-build / linux (fresh) (push) Waiting to run
citra-build / macos (arm64) (push) Waiting to run
citra-build / macos (x86_64) (push) Waiting to run
citra-build / macos-universal (push) Blocked by required conditions
citra-build / windows (msvc) (push) Waiting to run
citra-build / windows (msys2) (push) Waiting to run
citra-build / android (googleplay) (push) Waiting to run
citra-build / android (vanilla) (push) Waiting to run
citra-build / docker (push) Waiting to run
citra-format / clang-format (push) Waiting to run
citra-libretro / android (push) Waiting to run
citra-libretro / linux (push) Waiting to run
citra-libretro / windows (push) Waiting to run
citra-libretro / macos (arm64) (push) Waiting to run
citra-libretro / macos (x86_64) (push) Waiting to run
citra-libretro / ios (push) Waiting to run
citra-libretro / tvos (push) Waiting to run
citra-transifex / transifex (push) Waiting to run
* libretro core * Bringing citra libretro implementation over * libretro: hook up vulkan renderer * libretro: github actions * libretro: gyro * libretro: core options v2 * libretro: on ios turn off shader jit if unavailable * moltenvk 1.3.0 introduces 8-bit indexes but allocates 16-bit for metal; this ends up allocating stream buffer * 2 = 132MiB. Instead, just use 16-bit indexes. (This will be necessary for standalone when bumping moltenvk version.) * libretro core: address review feedback * libretro: microphone support * cmake: Add ENABLE_ROOM_STANDALONE to list of incompatible libretro flags * libretro: proper initial geometry * libretro: fix software renderer * libretro: address review feedback * .github/libretro.yml: Pin macOS runners at macOS 26 * ci: Remove explicit selection of Xcode 16.0 * .github/libretro.yml: remove unnecessary windows builder apt commands * .github/libretro.yml: bump min macos version to 11.0 * ci: Re-enable CI jobs for all libretro cores This is under the condition that we don't introduce build cache for these builds --------- Co-authored-by: OpenSauce04 <opensauce04@gmail.com> Co-authored-by: PabloMK7 <hackyglitch2@gmail.com>
87 lines
2.8 KiB
C++
87 lines
2.8 KiB
C++
// Copyright Citra Emulator Project / Azahar Emulator Project
|
|
// Licensed under GPLv2 or any later version
|
|
// Refer to the license.txt file included.
|
|
|
|
#include <algorithm>
|
|
#include <memory>
|
|
#include <string>
|
|
#include <vector>
|
|
#include "audio_core/null_sink.h"
|
|
#include "audio_core/sink_details.h"
|
|
#ifdef HAVE_SDL2
|
|
#include "audio_core/sdl2_sink.h"
|
|
#endif
|
|
#ifdef HAVE_LIBRETRO
|
|
#include "audio_core/libretro_sink.h"
|
|
#endif
|
|
#ifdef HAVE_CUBEB
|
|
#include "audio_core/cubeb_sink.h"
|
|
#endif
|
|
#ifdef HAVE_OPENAL
|
|
#include "audio_core/openal_sink.h"
|
|
#endif
|
|
#include "common/logging/log.h"
|
|
|
|
namespace AudioCore {
|
|
namespace {
|
|
// sink_details is ordered in terms of desirability, with the best choice at the top.
|
|
constexpr std::array sink_details = {
|
|
#ifdef HAVE_LIBRETRO
|
|
SinkDetails{SinkType::LibRetro, "libretro",
|
|
[](std::string_view device_id) -> std::unique_ptr<Sink> {
|
|
return std::make_unique<LibRetroSink>(std::string(device_id));
|
|
},
|
|
&ListLibretroSinkDevices},
|
|
#endif
|
|
#ifdef HAVE_CUBEB
|
|
SinkDetails{SinkType::Cubeb, "Cubeb",
|
|
[](std::string_view device_id) -> std::unique_ptr<Sink> {
|
|
return std::make_unique<CubebSink>(device_id);
|
|
},
|
|
&ListCubebSinkDevices},
|
|
#endif
|
|
#ifdef HAVE_OPENAL
|
|
SinkDetails{SinkType::OpenAL, "OpenAL",
|
|
[](std::string_view device_id) -> std::unique_ptr<Sink> {
|
|
return std::make_unique<OpenALSink>(std::string(device_id));
|
|
},
|
|
&ListOpenALSinkDevices},
|
|
#endif
|
|
#ifdef HAVE_SDL2
|
|
SinkDetails{SinkType::SDL2, "SDL2",
|
|
[](std::string_view device_id) -> std::unique_ptr<Sink> {
|
|
return std::make_unique<SDL2Sink>(std::string(device_id));
|
|
},
|
|
&ListSDL2SinkDevices},
|
|
#endif
|
|
SinkDetails{SinkType::Null, "None",
|
|
[](std::string_view device_id) -> std::unique_ptr<Sink> {
|
|
return std::make_unique<NullSink>(device_id);
|
|
},
|
|
[] { return std::vector<std::string>{"None"}; }},
|
|
};
|
|
} // Anonymous namespace
|
|
|
|
std::vector<SinkDetails> ListSinks() {
|
|
return {sink_details.begin(), sink_details.end()};
|
|
}
|
|
|
|
const SinkDetails& GetSinkDetails(SinkType sink_type) {
|
|
auto iter = std::find_if(
|
|
sink_details.begin(), sink_details.end(),
|
|
[sink_type](const auto& sink_detail) { return sink_detail.type == sink_type; });
|
|
|
|
if (sink_type == SinkType::Auto || iter == sink_details.end()) {
|
|
if (sink_type != SinkType::Auto) {
|
|
LOG_ERROR(Audio, "AudioCore::GetSinkDetails given invalid sink_type {}", sink_type);
|
|
}
|
|
// Auto-select.
|
|
// sink_details is ordered in terms of desirability, with the best choice at the front.
|
|
iter = sink_details.begin();
|
|
}
|
|
|
|
return *iter;
|
|
}
|
|
|
|
} // namespace AudioCore
|