aboutsummaryrefslogtreecommitdiffstats
path: root/alc/events.cpp
diff options
context:
space:
mode:
authorChris Robinson <[email protected]>2023-05-31 22:11:15 -0700
committerChris Robinson <[email protected]>2023-06-01 06:33:41 -0700
commitedc20c87d3cd37608e8fa50556d718cd32755f3d (patch)
treeca712a140ff79a21ba2c49d5c13b686c9679a143 /alc/events.cpp
parentd684c7617f2e13572b1c3f9a933a23e1f0e32d49 (diff)
Specify the device type for the event callback
Diffstat (limited to 'alc/events.cpp')
-rw-r--r--alc/events.cpp10
1 files changed, 5 insertions, 5 deletions
diff --git a/alc/events.cpp b/alc/events.cpp
index 3c9c59ee..b5b65cb1 100644
--- a/alc/events.cpp
+++ b/alc/events.cpp
@@ -40,17 +40,17 @@ ALCenum EnumFromEventType(const alc::EventType type)
namespace alc {
-void Event(EventType eventType, ALCdevice *device, std::string_view message) noexcept
+void Event(EventType eventType, DeviceType deviceType, ALCdevice *device, std::string_view message) noexcept
{
auto eventlock = std::unique_lock{EventMutex};
if(EventCallback && EventsEnabled.test(al::to_underlying(eventType)))
- EventCallback(EnumFromEventType(eventType), device,
+ EventCallback(EnumFromEventType(eventType), al::to_underlying(deviceType), device,
static_cast<ALCsizei>(message.length()), message.data(), EventUserPtr);
}
} // namespace alc
-FORCE_ALIGN ALCboolean ALC_APIENTRY alcEventControlSOFT(ALCsizei count, const ALCenum *types,
+FORCE_ALIGN ALCboolean ALC_APIENTRY alcEventControlSOFT(ALCsizei count, const ALCenum *events,
ALCboolean enable) noexcept
{
if(enable != ALC_FALSE && enable != ALC_TRUE)
@@ -65,14 +65,14 @@ FORCE_ALIGN ALCboolean ALC_APIENTRY alcEventControlSOFT(ALCsizei count, const AL
}
if(count == 0)
return ALC_TRUE;
- if(!types)
+ if(!events)
{
alcSetError(nullptr, ALC_INVALID_VALUE);
return ALC_FALSE;
}
std::bitset<al::to_underlying(alc::EventType::Count)> eventSet{0};
- for(ALCenum type : al::span{types, static_cast<ALCuint>(count)})
+ for(ALCenum type : al::span{events, static_cast<ALCuint>(count)})
{
auto etype = GetEventType(type);
if(!etype)