Skip to content

Commit

Permalink
implement audio backend fallbacks (HarbourMasters#1857)
Browse files Browse the repository at this point in the history
* 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 e94a7ff.

* revert lus changes

* moved fallback function to LUS

* use audioplayerbridge
  • Loading branch information
Alto1772 authored Jan 21, 2023
1 parent 643a982 commit 52a9764
Showing 1 changed file with 4 additions and 14 deletions.
18 changes: 4 additions & 14 deletions soh/soh/OTRGlobals.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1242,29 +1242,19 @@ extern "C" int16_t OTRGetRectDimensionFromRightEdge(float v) {
}

extern "C" bool AudioPlayer_Init(void) {
if (OTRGlobals::Instance->context->GetAudioPlayer() != nullptr) {
return OTRGlobals::Instance->context->GetAudioPlayer()->Init();
}

return false;
return AudioPlayerInit();
}

extern "C" int AudioPlayer_Buffered(void) {
if (OTRGlobals::Instance->context->GetAudioPlayer() != nullptr) {
return OTRGlobals::Instance->context->GetAudioPlayer()->Buffered();
}
return AudioPlayerBuffered();
}

extern "C" int AudioPlayer_GetDesiredBuffered(void) {
if (OTRGlobals::Instance->context->GetAudioPlayer() != nullptr) {
return OTRGlobals::Instance->context->GetAudioPlayer()->GetDesiredBuffered();
}
return AudioPlayerGetDesiredBuffered();
}

extern "C" void AudioPlayer_Play(const uint8_t* buf, uint32_t len) {
if (OTRGlobals::Instance->context->GetAudioPlayer() != nullptr) {
OTRGlobals::Instance->context->GetAudioPlayer()->Play(buf, len);
}
AudioPlayerPlayFrame(buf, len);
}

extern "C" int Controller_ShouldRumble(size_t slot) {
Expand Down

0 comments on commit 52a9764

Please sign in to comment.