diff options
| author | Jean-Francois Mauguit <jfmauguit@mac.com> | 2024-09-24 09:03:25 -0400 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2024-09-24 09:03:25 -0400 |
| commit | bab614c421ed7ae329d26bf028c4a3b1d2450f5a (patch) | |
| tree | 12f17f78986871dd2cfb0a56e5e93b545c1ae0d0 /Src/auth/ifc_authcallback.h | |
| parent | 4bde6044fddf053f31795b9eaccdd2a5a527d21f (diff) | |
| parent | 20d28e80a5c861a9d5f449ea911ab75b4f37ad0d (diff) | |
| download | winamp-bab614c421ed7ae329d26bf028c4a3b1d2450f5a.tar.gz | |
Merge pull request #5 from WinampDesktop/community
Merge to main
Diffstat (limited to 'Src/auth/ifc_authcallback.h')
| -rw-r--r-- | Src/auth/ifc_authcallback.h | 51 |
1 files changed, 51 insertions, 0 deletions
diff --git a/Src/auth/ifc_authcallback.h b/Src/auth/ifc_authcallback.h new file mode 100644 index 00000000..f6b44c2f --- /dev/null +++ b/Src/auth/ifc_authcallback.h @@ -0,0 +1,51 @@ +#pragma once + +#include <bfc/dispatch.h> +#include <windows.h> //need this for Sleep() + +class ifc_authcallback : public Dispatchable +{ +protected: + ifc_authcallback() {} + ~ifc_authcallback() {} +public: + int OnConnecting(); + int OnSending(); + int OnReceiving(); + // pump your message loop for a little while + int OnIdle(); + + enum + { + ONCONNECTING=0, + ONSENDING=1, + ONRECEIVING=2, + ONIDLE=3, + }; +}; + +inline int ifc_authcallback::OnConnecting() +{ + return _call(ONCONNECTING, (int)0); +} +inline int ifc_authcallback::OnSending() +{ + return _call(ONSENDING, (int)0); +} +inline int ifc_authcallback::OnReceiving() +{ + return _call(ONRECEIVING, (int)0); +} +inline int ifc_authcallback::OnIdle() +{ + int retval; + if (_dispatch(ONIDLE, &retval)) + return retval; + else + { + // default implementation + Sleep(50); + return 0; + } + +} |
