mirror of
https://github.com/HarbourMasters/Shipwright.git
synced 2024-12-23 00:28:51 -05:00
implement audio backend fallbacks (#1857)
* audio & rendering backend option greyed out if theres only one
* add audio fallback code
* InitializeAudioPlayer/WindowManager add param
* string -> string_view
* Revert "audio & rendering backend option greyed out if theres only one"
This reverts commit e94a7fff50
.
* revert lus changes
* moved fallback function to LUS
* use audioplayerbridge
This commit is contained in:
parent
643a98244b
commit
52a976489b
@ -1242,29 +1242,19 @@ extern "C" int16_t OTRGetRectDimensionFromRightEdge(float v) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
extern "C" bool AudioPlayer_Init(void) {
|
extern "C" bool AudioPlayer_Init(void) {
|
||||||
if (OTRGlobals::Instance->context->GetAudioPlayer() != nullptr) {
|
return AudioPlayerInit();
|
||||||
return OTRGlobals::Instance->context->GetAudioPlayer()->Init();
|
|
||||||
}
|
|
||||||
|
|
||||||
return false;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
extern "C" int AudioPlayer_Buffered(void) {
|
extern "C" int AudioPlayer_Buffered(void) {
|
||||||
if (OTRGlobals::Instance->context->GetAudioPlayer() != nullptr) {
|
return AudioPlayerBuffered();
|
||||||
return OTRGlobals::Instance->context->GetAudioPlayer()->Buffered();
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
extern "C" int AudioPlayer_GetDesiredBuffered(void) {
|
extern "C" int AudioPlayer_GetDesiredBuffered(void) {
|
||||||
if (OTRGlobals::Instance->context->GetAudioPlayer() != nullptr) {
|
return AudioPlayerGetDesiredBuffered();
|
||||||
return OTRGlobals::Instance->context->GetAudioPlayer()->GetDesiredBuffered();
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
extern "C" void AudioPlayer_Play(const uint8_t* buf, uint32_t len) {
|
extern "C" void AudioPlayer_Play(const uint8_t* buf, uint32_t len) {
|
||||||
if (OTRGlobals::Instance->context->GetAudioPlayer() != nullptr) {
|
AudioPlayerPlayFrame(buf, len);
|
||||||
OTRGlobals::Instance->context->GetAudioPlayer()->Play(buf, len);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
extern "C" int Controller_ShouldRumble(size_t slot) {
|
extern "C" int Controller_ShouldRumble(size_t slot) {
|
||||||
|
Loading…
Reference in New Issue
Block a user