From 20d28e80a5c861a9d5f449ea911ab75b4f37ad0d Mon Sep 17 00:00:00 2001 From: Jef Date: Tue, 24 Sep 2024 14:54:57 +0200 Subject: Initial community commit --- Src/devices/discoveryMonitor.h | 43 ++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 43 insertions(+) create mode 100644 Src/devices/discoveryMonitor.h (limited to 'Src/devices/discoveryMonitor.h') diff --git a/Src/devices/discoveryMonitor.h b/Src/devices/discoveryMonitor.h new file mode 100644 index 00000000..7b838c15 --- /dev/null +++ b/Src/devices/discoveryMonitor.h @@ -0,0 +1,43 @@ +#ifndef _NULLSOFT_WINAMP_DEVICES_DISCOVERY_MONITOR_HEADER +#define _NULLSOFT_WINAMP_DEVICES_DISCOVERY_MONITOR_HEADER + +#if defined(_MSC_VER) && (_MSC_VER >= 1020) +#pragma once +#endif + +#include "ifc_deviceprovider.h" +#include + +class DiscoveryMonitor +{ +public: + DiscoveryMonitor(); + ~DiscoveryMonitor(); + +public: + BOOL Register(ifc_deviceprovider *provider); + BOOL Unregister(ifc_deviceprovider *provider); + BOOL IsActive(); + BOOL Reset(); + +protected: + void Lock(); + void Unlock(); + +private: + typedef struct ActiveDiscovery + { + intptr_t providerId; + size_t ref; + } ActiveDiscovery; + + typedef std::vector ActivityList; + +private: + CRITICAL_SECTION lock; + ActivityList activityList; +}; + + + +#endif // _NULLSOFT_WINAMP_DEVICES_DISCOVERY_MONITOR_HEADER \ No newline at end of file -- cgit