aboutsummaryrefslogtreecommitdiffstats
path: root/alc/events.h
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.h
parentd684c7617f2e13572b1c3f9a933a23e1f0e32d49 (diff)
Specify the device type for the event callback
Diffstat (limited to 'alc/events.h')
-rw-r--r--alc/events.h11
1 files changed, 8 insertions, 3 deletions
diff --git a/alc/events.h b/alc/events.h
index 3b22a4c4..ddb3808a 100644
--- a/alc/events.h
+++ b/alc/events.h
@@ -19,6 +19,11 @@ enum class EventType : uint8_t {
Count
};
+enum class DeviceType : ALCenum {
+ Playback = ALC_PLAYBACK_DEVICE_SOFT,
+ Capture = ALC_CAPTURE_DEVICE_SOFT,
+};
+
inline std::bitset<al::to_underlying(EventType::Count)> EventsEnabled{0};
inline std::mutex EventMutex;
@@ -26,10 +31,10 @@ inline std::mutex EventMutex;
inline ALCEVENTPROCTYPESOFT EventCallback{};
inline void *EventUserPtr{};
-void Event(alc::EventType eventType, ALCdevice *device, std::string_view message) noexcept;
+void Event(EventType eventType, DeviceType deviceType, ALCdevice *device, std::string_view message) noexcept;
-inline void Event(alc::EventType eventType, std::string_view message) noexcept
-{ Event(eventType, nullptr, message); }
+inline void Event(EventType eventType, DeviceType deviceType, std::string_view message) noexcept
+{ Event(eventType, deviceType, nullptr, message); }
} // namespace alc