diff options
author | Chris Robinson <[email protected]> | 2018-12-04 16:33:26 -0800 |
---|---|---|
committer | Chris Robinson <[email protected]> | 2018-12-04 16:33:26 -0800 |
commit | 64099105437741233255704733cd69c24b1579ea (patch) | |
tree | 6a694b91f31f8c7f00f453f6c02c60528d415d33 /OpenAL32/event.cpp | |
parent | f79b0e24d4cc5c1d4e9aa289b7eb2caba750bb9a (diff) |
Handle EventType_BufferCompleted uniquely
Diffstat (limited to 'OpenAL32/event.cpp')
-rw-r--r-- | OpenAL32/event.cpp | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/OpenAL32/event.cpp b/OpenAL32/event.cpp index d263acc5..1a4e1df0 100644 --- a/OpenAL32/event.cpp +++ b/OpenAL32/event.cpp @@ -55,6 +55,17 @@ static int EventThread(ALCcontext *context) evt.u.srcstate.state, msg.length(), msg.c_str(), context->EventParam ); } + else if(evt.EnumType == EventType_BufferCompleted) + { + if(!(enabledevts&EventType_BufferCompleted)) + continue; + std::string msg{std::to_string(evt.u.bufcomp.count)}; + if(evt.u.bufcomp.count == 1) msg += " buffer completed"; + else msg += " buffers completed"; + context->EventCb(AL_EVENT_TYPE_BUFFER_COMPLETED_SOFT, evt.u.bufcomp.id, + evt.u.bufcomp.count, msg.length(), msg.c_str(), context->EventParam + ); + } else if((enabledevts&evt.EnumType) == evt.EnumType) context->EventCb(evt.u.user.type, evt.u.user.id, evt.u.user.param, (ALsizei)strlen(evt.u.user.msg), evt.u.user.msg, context->EventParam |