Add beep sound to platforms with no beep

This commit is contained in:
elasota
2021-05-09 23:45:27 -04:00
parent d54ad576bc
commit 24169507bd
21 changed files with 85 additions and 25 deletions

View File

@@ -18,9 +18,18 @@ namespace PortabilityLayer
memcpy(dest + 1, src, sz);
}
}
static BeepFunction_t gs_beepFunction = nullptr;
}
void SysBeep(int duration)
{
PLDrivers::GetSystemServices()->Beep();
if (!PLDrivers::GetSystemServices()->Beep())
if (PortabilityLayer::gs_beepFunction != nullptr)
PortabilityLayer::gs_beepFunction(duration);
}
void SetBeepFunction(BeepFunction_t beepFunction)
{
PortabilityLayer::gs_beepFunction = beepFunction;
}