aboutsummaryrefslogtreecommitdiff
path: root/Src/devices/deviceEventManager.h
diff options
context:
space:
mode:
authorJef <jef@targetspot.com>2024-09-24 08:54:57 -0400
committerJef <jef@targetspot.com>2024-09-24 08:54:57 -0400
commit20d28e80a5c861a9d5f449ea911ab75b4f37ad0d (patch)
tree12f17f78986871dd2cfb0a56e5e93b545c1ae0d0 /Src/devices/deviceEventManager.h
parent537bcbc86291b32fc04ae4133ce4d7cac8ebe9a7 (diff)
downloadwinamp-20d28e80a5c861a9d5f449ea911ab75b4f37ad0d.tar.gz
Initial community commit
Diffstat (limited to 'Src/devices/deviceEventManager.h')
-rw-r--r--Src/devices/deviceEventManager.h64
1 files changed, 64 insertions, 0 deletions
diff --git a/Src/devices/deviceEventManager.h b/Src/devices/deviceEventManager.h
new file mode 100644
index 00000000..c5790fe9
--- /dev/null
+++ b/Src/devices/deviceEventManager.h
@@ -0,0 +1,64 @@
+#ifndef _NULLSOFT_WINAMP_DEVICES_DEVICE_EVENT_MANAGER_HEADER
+#define _NULLSOFT_WINAMP_DEVICES_DEVICE_EVENT_MANAGER_HEADER
+
+#if defined(_MSC_VER) && (_MSC_VER >= 1020)
+#pragma once
+#endif
+
+#include "./ifc_deviceevent.h"
+#include "./ifc_deviceeventmanager.h"
+#include <vector>
+
+class DeviceEventManager : public ifc_deviceeventmanager
+{
+
+protected:
+ DeviceEventManager();
+ ~DeviceEventManager();
+
+public:
+ static HRESULT CreateInstance(DeviceEventManager **instance);
+
+public:
+ /* Dispatchable */
+ size_t AddRef();
+ size_t Release();
+ int QueryInterface(GUID interface_guid, void **object);
+
+ /* ifc_deviceeventmanager */
+ HRESULT Advise(ifc_deviceevent *handler);
+ HRESULT Unadvise(ifc_deviceevent *handler);
+
+ void Notify_IconChanged(ifc_device *device);
+ void Notify_DisplayNameChanged(ifc_device *device, const wchar_t *displayName);
+ void Notify_AttachmentChanged(ifc_device *device, BOOL attached);
+ void Notify_VisibilityChanged(ifc_device *device, BOOL visible);
+ void Notify_TotalSpaceChanged(ifc_device *device, uint64_t space);
+ void Notify_UsedSpaceChanged(ifc_device *device, uint64_t space);
+ void Notfiy_CommandChanged(ifc_device *device);
+ void Notify_ActivityStarted(ifc_device *device, ifc_deviceactivity *activity);
+ void Notify_ActivityFinished(ifc_device *device, ifc_deviceactivity *activity);
+ void Notify_ActivityChanged(ifc_device *device, ifc_deviceactivity *activity);
+ void Notify_ModelChanged(ifc_device *device, const wchar_t *model);
+ void Notify_StatusChanged(ifc_device *device, const wchar_t *status);
+
+public:
+ void Lock();
+ void Unlock();
+
+protected:
+ typedef std::vector<ifc_deviceevent*> HandlerList;
+
+protected:
+ size_t ref;
+ HandlerList handlerList;
+ CRITICAL_SECTION lock;
+
+protected:
+ RECVS_DISPATCH;
+
+
+
+};
+
+#endif // _NULLSOFT_WINAMP_DEVICES_DEVICE_EVENT_MANAGER_HEADER \ No newline at end of file