diff --git a/src/dusk/mods/svc/audio_res/audio_res.cpp b/src/dusk/mods/svc/audio_res/audio_res.cpp index 1c8f359c75..33a9b7be62 100644 --- a/src/dusk/mods/svc/audio_res/audio_res.cpp +++ b/src/dusk/mods/svc/audio_res/audio_res.cpp @@ -4,8 +4,6 @@ #include "mods/svc/audio_res.h" #include "../registry.hpp" -#include "wsys.hpp" -#include "bst.hpp" namespace dusk::mods::svc { diff --git a/src/dusk/mods/svc/audio_res/audio_res.hpp b/src/dusk/mods/svc/audio_res/audio_res.hpp index 5b2ae0a87a..767f1e2d6f 100644 --- a/src/dusk/mods/svc/audio_res/audio_res.hpp +++ b/src/dusk/mods/svc/audio_res/audio_res.hpp @@ -1,9 +1,80 @@ #pragma once - +#include "mods/svc/audio_res.h" namespace dusk::mods { struct LoadedMod; } + namespace dusk::mods::svc::audio_res { +namespace wsys { + +void frame_end(); +void remove_mod(LoadedMod& mod); +void sync_audio_replacements(); + +extern AudioWaveInfo const default_wave_info; + +ModResult insert_replace_wave( + ModContext* ctx, + AudioWaveBank bank, + u16 wave_id, + char const* file_name, + AudioWaveInfo const* wave_info, + AudioWaveHandle* out_handle); + +ModResult insert_add_wave( + ModContext* ctx, + AudioWaveBank bank, + char const* file_name, + AudioWaveInfo const* wave_info, + AudioWaveHandle* out_handle, + u16* out_wave_id); + +ModResult remove_wave(ModContext* ctx, AudioWaveHandle handle); + +} + +namespace bst { + +void frame_end(); +void remove_mod(LoadedMod const& mod); +void sync_audio_replacements(); + +extern AudioSoundTableEffectInfo const default_effect_info; + +ModResult replace_sound_table_effect( + ModContext* ctx, + SoundEffectCategory category_id, + uint16_t effect_id, + AudioSoundTableEffectInfo const* info, + AudioSoundTableHandle* out_handle); + +ModResult add_sound_table_effect( + ModContext* ctx, + SoundEffectCategory category_id, + AudioSoundTableEffectInfo const* info, + AudioSoundTableHandle* out_handle, + uint16_t* out_effect_id); + +extern AudioSoundTableStreamInfo const default_stream_info; + +ModResult replace_sound_table_stream( + ModContext* ctx, + uint16_t stream_id, + char const* file_path, + AudioSoundTableStreamInfo const* info, + AudioSoundTableHandle* out_handle); + +ModResult add_sound_table_stream( + ModContext* ctx, + char const* file_path, + AudioSoundTableStreamInfo const* info, + AudioSoundTableHandle* out_handle, + uint16_t* out_stream_id); + +ModResult remove_sound_table(ModContext* ctx, AudioSoundTableHandle handle); + +} + } diff --git a/src/dusk/mods/svc/audio_res/bst.cpp b/src/dusk/mods/svc/audio_res/bst.cpp index 9dcf635c2a..c7f4bd9e10 100644 --- a/src/dusk/mods/svc/audio_res/bst.cpp +++ b/src/dusk/mods/svc/audio_res/bst.cpp @@ -1,5 +1,6 @@ #include "bst.hpp" +#include "audio_res.hpp" #include "aurora/lib/logging.hpp" #include "dusk/mods/loader/loader.hpp" #include "dusk/mods/svc/id_allocator.hpp" @@ -173,7 +174,7 @@ void remove_mod(LoadedMod const& mod) { void frame_end() { if (sound_replacements_dirty) { - sync_audio_replacements(); + wsys::sync_audio_replacements(); } } diff --git a/src/dusk/mods/svc/audio_res/bst.hpp b/src/dusk/mods/svc/audio_res/bst.hpp index 67b6c1aa18..d0619ad80f 100644 --- a/src/dusk/mods/svc/audio_res/bst.hpp +++ b/src/dusk/mods/svc/audio_res/bst.hpp @@ -6,10 +6,6 @@ #include "JSystem/JAudio2/JAUSoundTable.h" #include "mods/svc/audio_res.h" -namespace dusk::mods { -struct LoadedMod; -} - namespace dusk::mods::svc::audio_res::bst { struct SoundTableReplacementSlot { @@ -64,42 +60,4 @@ std::shared_ptr get_override_for(JAISoundID id); std::shared_ptr get_override_for_se(JAISoundID id); std::shared_ptr get_override_for_stream(JAISoundID id); -void frame_end(); -void remove_mod(LoadedMod const& mod); -void sync_audio_replacements(); - -extern AudioSoundTableEffectInfo const default_effect_info; - -ModResult replace_sound_table_effect( - ModContext* ctx, - SoundEffectCategory category_id, - uint16_t effect_id, - AudioSoundTableEffectInfo const* info, - AudioSoundTableHandle* out_handle); - -ModResult add_sound_table_effect( - ModContext* ctx, - SoundEffectCategory category_id, - AudioSoundTableEffectInfo const* info, - AudioSoundTableHandle* out_handle, - uint16_t* out_effect_id); - -extern AudioSoundTableStreamInfo const default_stream_info; - -ModResult replace_sound_table_stream( - ModContext* ctx, - uint16_t stream_id, - char const* file_path, - AudioSoundTableStreamInfo const* info, - AudioSoundTableHandle* out_handle); - -ModResult add_sound_table_stream( - ModContext* ctx, - char const* file_path, - AudioSoundTableStreamInfo const* info, - AudioSoundTableHandle* out_handle, - uint16_t* out_stream_id); - -ModResult remove_sound_table(ModContext* ctx, AudioSoundTableHandle handle); - } diff --git a/src/dusk/mods/svc/audio_res/wsys.cpp b/src/dusk/mods/svc/audio_res/wsys.cpp index 7899bb117c..771607dd42 100644 --- a/src/dusk/mods/svc/audio_res/wsys.cpp +++ b/src/dusk/mods/svc/audio_res/wsys.cpp @@ -1,3 +1,4 @@ +#include "audio_res.hpp" #include "wsys.hpp" #include "../slot_map.hpp" #include "../id_allocator.hpp" diff --git a/src/dusk/mods/svc/audio_res/wsys.hpp b/src/dusk/mods/svc/audio_res/wsys.hpp index 79b66b70e1..be438dcf42 100644 --- a/src/dusk/mods/svc/audio_res/wsys.hpp +++ b/src/dusk/mods/svc/audio_res/wsys.hpp @@ -104,28 +104,4 @@ using ContainerLoadFunction = ModResult (*)(LoadedMod const& mod, RuntimeWaveRep ModResult load_wav(LoadedMod const& mod, RuntimeWaveReplacementSlot& slot, std::span fileData); ModResult load_opus(LoadedMod const& mod, RuntimeWaveReplacementSlot& slot, std::span fileData); -void frame_end(); -void remove_mod(LoadedMod& mod); -void sync_audio_replacements(); - -extern AudioWaveInfo const default_wave_info; - -ModResult insert_replace_wave( - ModContext* ctx, - AudioWaveBank bank, - u16 wave_id, - char const* file_name, - AudioWaveInfo const* wave_info, - AudioWaveHandle* out_handle); - -ModResult insert_add_wave( - ModContext* ctx, - AudioWaveBank bank, - char const* file_name, - AudioWaveInfo const* wave_info, - AudioWaveHandle* out_handle, - u16* out_wave_id); - -ModResult remove_wave(ModContext* ctx, AudioWaveHandle handle); - } \ No newline at end of file