5 #include "opthelpers.h"
10 #include <string_view>
15 enum class EventType
: uint8_t {
23 std::optional
<alc::EventType
> GetEventType(ALCenum type
);
25 enum class EventSupport
: ALCenum
{
26 FullSupport
= ALC_EVENT_SUPPORTED_SOFT
,
27 NoSupport
= ALC_EVENT_NOT_SUPPORTED_SOFT
,
30 enum class DeviceType
: ALCenum
{
31 Playback
= ALC_PLAYBACK_DEVICE_SOFT
,
32 Capture
= ALC_CAPTURE_DEVICE_SOFT
,
35 using EventBitSet
= std::bitset
<al::to_underlying(EventType::Count
)>;
36 inline EventBitSet EventsEnabled
{0};
38 inline std::mutex EventMutex
;
40 inline ALCEVENTPROCTYPESOFT EventCallback
{};
41 inline void *EventUserPtr
{};
43 void Event(EventType eventType
, DeviceType deviceType
, ALCdevice
*device
, std::string_view message
) noexcept
;
45 inline void Event(EventType eventType
, DeviceType deviceType
, std::string_view message
) noexcept
46 { Event(eventType
, deviceType
, nullptr, message
); }
50 #endif /* ALC_EVENTS_H */