diff --git a/soh/soh/Enhancements/accessible-actors/miniaudio.h b/soh/include/miniaudio.h similarity index 100% rename from soh/soh/Enhancements/accessible-actors/miniaudio.h rename to soh/include/miniaudio.h diff --git a/soh/soh/Enhancements/accessible-actors/SfxExtractor.h b/soh/soh/Enhancements/accessible-actors/SfxExtractor.h index 59795a6b5..0f4deefcd 100644 --- a/soh/soh/Enhancements/accessible-actors/SfxExtractor.h +++ b/soh/soh/Enhancements/accessible-actors/SfxExtractor.h @@ -10,7 +10,7 @@ class SfxExtractor { s16 currentSfx; std::vector tempStorage; // Stores raw audio data for the sfx currently being ripped. int16_t* tempBuffer; // Raw pointer to the above vector. - int progressMilestones[9]; // Implements progress reports after every 10 percent. + int progressMilestones[9]; // Implements progress reports after every 10 percent. // Check if a buffer contains meaningful audio output. bool isAllZero(int16_t* buffer, size_t count); // Find the beginning of a captured signal. @@ -19,8 +19,9 @@ class SfxExtractor { void renderOutput(); void setup(); void ripNextSfx(); - void finished();// Also handles failure. + void finished(); // Also handles failure. void maybeGiveProgressReport(); + public: SfxExtractor(); diff --git a/soh/soh/OTRGlobals.cpp b/soh/soh/OTRGlobals.cpp index 1a4559a9e..0e0e97ded 100644 --- a/soh/soh/OTRGlobals.cpp +++ b/soh/soh/OTRGlobals.cpp @@ -127,7 +127,7 @@ Sail* Sail::Instance; #include "soh/resource/importer/BackgroundFactory.h" #include "soh/config/ConfigUpdaters.h" -#include "soh/ShipInit.hpp" +#include "soh/ShipInit.hpp" #if !defined(__SWITCH__) && !defined(__WIIU__) #include "Enhancements/accessible-actors/ActorAccessibility.h" #endif @@ -294,10 +294,10 @@ OTRGlobals::OTRGlobals() { } } - std::string sohAccessibilityPath = Ship::Context::GetPathRelativeToAppDirectory("accessibility.otr"); - if (std::filesystem::exists(sohAccessibilityPath)) { - OTRFiles.push_back(sohAccessibilityPath); - } + std::string sohAccessibilityPath = Ship::Context::GetPathRelativeToAppDirectory("accessibility.otr"); + if (std::filesystem::exists(sohAccessibilityPath)) { + OTRFiles.push_back(sohAccessibilityPath); + } std::sort(patchOTRs.begin(), patchOTRs.end(), [](const std::string& a, const std::string& b) { return std::lexicographical_compare(a.begin(), a.end(), b.begin(), b.end(), @@ -587,7 +587,8 @@ void OTRAudio_Thread() { // 3 is the maximum authentic frame divisor. s16 audio_buffer[SAMPLES_HIGH * NUM_AUDIO_CHANNELS * 3]; for (int i = 0; i < AUDIO_FRAMES_PER_UPDATE; i++) { - AudioMgr_CreateNextAudioBuffer(audio_buffer + i * (num_audio_samples * NUM_AUDIO_CHANNELS), num_audio_samples); + AudioMgr_CreateNextAudioBuffer(audio_buffer + i * (num_audio_samples * NUM_AUDIO_CHANNELS), + num_audio_samples); #if !defined(__SWITCH__) && !defined(__WIIU__) // Give accessibility a chance to merge its own audio in. ActorAccessibility_MixAccessibleAudioWithGameAudio( @@ -1252,9 +1253,9 @@ extern "C" void InitOTR() { #endif OTRMessage_Init(); - #if !defined(__SWITCH__) && !defined(__WIIU__) +#if !defined(__SWITCH__) && !defined(__WIIU__) ActorAccessibility_Init(); - #endif +#endif OTRAudio_Init(); OTRExtScanner(); VanillaItemTable_Init(); @@ -1537,7 +1538,7 @@ extern "C" void Graph_ProcessGfxCommands(Gfx* commands) { last_update_rate = R_UPDATE_RATE; { - std::unique_lock Lock(audio.mutex); + std::unique_lock Lock(audio.mutex); while (audio.processing) { audio.cv_from_thread.wait(Lock); } @@ -2553,24 +2554,21 @@ void OTRAudio_SfxCaptureThread() { } } - extern "C" void OTRAudio_InstallSfxCaptureThread() { +extern "C" void OTRAudio_InstallSfxCaptureThread() { OTRAudio_Exit(); audio.running = true; audio.thread = std::thread(OTRAudio_SfxCaptureThread); - - } - extern "C" void OTRAudio_UninstallSfxCaptureThread() - { +} +extern "C" void OTRAudio_UninstallSfxCaptureThread() { OTRAudio_Exit(); audio.running = true; audio.thread = std::thread(OTRAudio_Thread); - } - std::unique_lock OTRAudio_Lock() - { +} +std::unique_lock OTRAudio_Lock() { return std::unique_lock(audio.mutex); - } -//extern "C" void CheckTracker_OnMessageClose() { -// CheckTracker::CheckTrackerDialogClosed(); +} +// extern "C" void CheckTracker_OnMessageClose() { +// CheckTracker::CheckTrackerDialogClosed(); extern "C" void Gfx_UnregisterBlendedTexture(const char* name) { gfx_unregister_blended_texture(name); } diff --git a/soh/soh/OTRGlobals.h b/soh/soh/OTRGlobals.h index dcffe847e..b221acfc9 100644 --- a/soh/soh/OTRGlobals.h +++ b/soh/soh/OTRGlobals.h @@ -164,7 +164,6 @@ void Gfx_TextureCacheDelete(const uint8_t* addr); void SaveManager_ThreadPoolWait(); void CheckTracker_OnMessageClose(); - int32_t GetGIID(uint32_t itemID); GetItemID RetrieveGetItemIDFromItemID(ItemID itemID); RandomizerGet RetrieveRandomizerGetFromItemID(ItemID itemID); diff --git a/soh/soh/SohGui/SohMenuSettings.cpp b/soh/soh/SohGui/SohMenuSettings.cpp index ba4c5a32a..2997133af 100644 --- a/soh/soh/SohGui/SohMenuSettings.cpp +++ b/soh/soh/SohGui/SohMenuSettings.cpp @@ -196,16 +196,17 @@ void SohMenu::AddMenuSettings() { .RaceDisable(false) .Options(CheckboxOptions().Tooltip("Disables the automatic re-centering of the camera when idle.")); - AddWidget(path, "Accessible Audio Cues", WIDGET_CVAR_CHECKBOX) - .CVar("gA11yAudioInteraction") - .RaceDisable(false) - .Options(CheckboxOptions().Tooltip("Enables accessibility audio cues")); + AddWidget(path, "Accessible Audio Cues", WIDGET_CVAR_CHECKBOX) + .CVar("gA11yAudioInteraction") + .RaceDisable(false) + .Options(CheckboxOptions().Tooltip("Enables accessibility audio cues")); + + AddWidget(path, "Extract Sfx", WIDGET_CVAR_CHECKBOX) + .CVar("gExtractSfx") + .RaceDisable(false) + .Options(CheckboxOptions().Tooltip("Extracts the sfx to be used in accessible audio cues, must be run once for " + "the audio cues to play then restart game")); - AddWidget(path, "Extract Sfx", WIDGET_CVAR_CHECKBOX) - .CVar("gExtractSfx") - .RaceDisable(false) - .Options(CheckboxOptions().Tooltip("Extracts the sfx to be used in accessible audio cues, must be run once for the audio cues to play then restart game")); - AddWidget(path, "EXPERIMENTAL", WIDGET_SEPARATOR_TEXT).Options(TextOptions().Color(Colors::Orange)); AddWidget(path, "ImGui Menu Scaling", WIDGET_CVAR_COMBOBOX) .CVar(CVAR_SETTING("ImGuiScale"))