diff --git a/src/sound/SI2.cpp b/src/sound/SI2.cpp index a9a74d6..4413780 100644 --- a/src/sound/SI2.cpp +++ b/src/sound/SI2.cpp @@ -1,5 +1,6 @@ #include "sound/SI2.hpp" #include "ui/FrameScript.hpp" +#include "console/CVar.hpp" void SI2::RegisterScriptFunctions() { FrameScript_Method* item = s_ScriptFunctions; @@ -10,5 +11,13 @@ void SI2::RegisterScriptFunctions() { } int32_t SI2::Init(int32_t flag) { + + Log_Init(); + SI2_LOG("=> Version %s (%s) %s", "1.0.0", "00000", "Feb 25 2024"); + SI2_LOG(" "); + SI2_LOG("=> Setting up Game Sound:"); + SI2_LOG(" - SESound Engine Init"); + SI2_LOG(" - FMOD Memory Init"); + return 0; } diff --git a/src/sound/SI2.hpp b/src/sound/SI2.hpp index bbc29aa..c2b5583 100644 --- a/src/sound/SI2.hpp +++ b/src/sound/SI2.hpp @@ -8,6 +8,10 @@ #include #include + +#define SI2_ERR(errcode, format, ...) SI2::Log_Write(__LINE__, __FILE__, errcode, format, __VA_ARGS__) +#define SI2_LOG(format, ...) SI2::Log_Write(__LINE__, __FILE__, FMOD_OK, format, __VA_ARGS__) + class SI2 { public: // Static variables @@ -20,6 +24,7 @@ class SI2 { static int32_t Log_Init(); static void Log_Write(const char* format, ...); static void Log_Write(uint32_t line, const char* filename, FMOD_RESULT errcode, const char* format, ...); + static void RegisterCVars(); static int32_t Init(int32_t flag); }; diff --git a/src/sound/SI2Cvars.cpp b/src/sound/SI2Cvars.cpp new file mode 100644 index 0000000..900bb18 --- /dev/null +++ b/src/sound/SI2Cvars.cpp @@ -0,0 +1,80 @@ +#include "sound/SI2.hpp" +#include "console/CVar.hpp" + +bool OutboundChatVolumeHandler(CVar*, const char*, const char*, void*) { + return true; +} + +bool InboundChatVolumeHandler(CVar*, const char*, const char*, void*) { + return true; +} + +bool VoiceChatModeHandler(CVar*, const char*, const char*, void*) { + return true; +} + +bool VoiceActivationSensitivityHandler(CVar*, const char*, const char*, void*) { + return true; +} + +bool EnableMicrophoneHandler(CVar*, const char*, const char*, void*) { + return true; +} + +bool EnableVoiceChatHandler(CVar*, const char*, const char*, void*) { + return true; +} + +bool SelfMuteHandler(CVar*, const char*, const char*, void*) { + return true; +} + +bool PushToTalkButtonHandler(CVar*, const char*, const char*, void*) { + return true; +} + +bool EnableReverb_CVarCallback(CVar*, const char*, const char*, void*) { + return true; +} + +bool VoiceChatInputDriverIndex_CVarCallback(CVar*, const char*, const char*, void*) { + return true; +} + +bool VoiceChatOutputDriverIndex_CVarCallback(CVar*, const char*, const char*, void*) { + return true; +} + +bool OutputDriverIndex_CVarCallback(CVar*, const char*, const char*, void*) { + return true; +} + + +void SI2::RegisterCVars() { + CVar::Register("StartTalkingDelay", "", 0, "0.0", 0, 5, 0, 0, 0); + CVar::Register("StartTalkingTime", "", 0, "1.0", 0, 5, 0, 0, 0); + CVar::Register("StopTalkingDelay", "", 0, "0.0", 0, 5, 0, 0, 0); + CVar::Register("StopTalkingTime", "", 0, "2.0", 0, 5, 0, 0, 0); + CVar::Register("OutboundChatVolume", "The software amplification factor (0.0 - 2.0)", 0, "1.0", &OutboundChatVolumeHandler, 5, 0, 0, 0); + CVar::Register("InboundChatVolume", "The volume of all other chat you hear (0.0 - 1.0)", 0, "1.0", &InboundChatVolumeHandler, 5, 0, 0, 0); + CVar::Register("VoiceChatMode", "Push to talk(0) or voice activation(1)", 0, "0", &VoiceChatModeHandler, 5, 0, 0, 0); + CVar::Register("VoiceActivationSensitivity", "Sensitivity of the microphone (0.0 - 1.0)", 0, "0.4", &VoiceActivationSensitivityHandler, 5, 0, 0, 0); + CVar::Register("EnableMicrophone", "Enables the microphone so you can speak.", 0, "1", &EnableMicrophoneHandler, 5, 0, 0, 0); + CVar::Register("EnableVoiceChat", "Enables the voice chat feature.", 0, "0", &EnableVoiceChatHandler, 5, 0, 0, 0); + CVar::Register("VoiceChatSelfMute", "Turn off your ability to talk.", 0, "0", &SelfMuteHandler, 5, 0, 0, 0); + CVar::Register("PushToTalkButton", "String representation of the Push-To-Talk button.", 0, "`", &PushToTalkButtonHandler, 5, 0, 0, 0); + CVar::Register("Sound_OutputQuality", "sound quality, default 1 (medium)", 0, "1", 0, 7, 0, 0, 0); + CVar::Register("Sound_NumChannels", "number of sound channels", 0, "32", 0, 7, 0, 0, 0); + CVar::Register("Sound_EnableReverb", "", 0, "0", &EnableReverb_CVarCallback, 7, 0, 0, 0); + CVar::Register("Sound_EnableSoftwareHRTF", "", 0, "0", 0, 7, 0, 0, 0); + CVar::Register("Sound_VoiceChatInputDriverIndex", "", 0, "0", &VoiceChatInputDriverIndex_CVarCallback, 7, 0, 0, 0); + CVar::Register("Sound_VoiceChatInputDriverName", "", 0, "Primary Sound Capture Driver", 0, 7, 0, 0, 0); + CVar::Register("Sound_VoiceChatOutputDriverIndex", "", 0, "0", &VoiceChatOutputDriverIndex_CVarCallback, 7, 0, 0, 0); + CVar::Register("Sound_VoiceChatOutputDriverName", "", 0, "Primary Sound Driver", 0, 7, 0, 0, 0); + CVar::Register("Sound_OutputDriverIndex", "", 0, "0", &OutputDriverIndex_CVarCallback, 7, 0, 0, 0); + CVar::Register("Sound_OutputDriverName", "", 0, "Primary Sound Driver", 0, 7, 0, 0, 0); + CVar::Register("Sound_DSPBufferSize", "sound buffer size, default 0", 0, "0", 0, 7, 0, 0, 0); + CVar::Register("Sound_EnableHardware", "Enables Hardware", 0, "0", 0, 7, 0, 0, 0); + CVar::Register("Sound_EnableMode2", "test", 0, "0", 0, 7, 0, 0, 0); + CVar::Register("Sound_EnableMixMode2", "test", 0, "0", 0, 7, 0, 0, 0); +}