provider.h 1.2 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
  1. #ifndef _NULLSOFT_WINAMP_GEN_DEVICE_PROVIDER_IMPLEMENTATION_HEADER
  2. #define _NULLSOFT_WINAMP_GEN_DEVICE_PROVIDER_IMPLEMENTATION_HEADER
  3. #if defined(_MSC_VER) && (_MSC_VER >= 1020)
  4. #pragma once
  5. #endif
  6. #include <wtypes.h>
  7. #include "../../devices/ifc_deviceprovider.h"
  8. #include "./testSuite.h"
  9. class DeviceProvider : public ifc_deviceprovider
  10. {
  11. protected:
  12. DeviceProvider();
  13. ~DeviceProvider();
  14. public:
  15. static HRESULT CreateInstance(DeviceProvider **instance);
  16. public:
  17. /* Dispatchable */
  18. size_t AddRef();
  19. size_t Release();
  20. int QueryInterface(GUID interface_guid, void **object);
  21. /* ifc_deviceprovider */
  22. HRESULT BeginDiscovery(api_devicemanager *manager);
  23. HRESULT CancelDiscovery();
  24. HRESULT GetActive();
  25. public:
  26. HRESULT Register(api_devicemanager *manager);
  27. HRESULT Unregister(api_devicemanager *manager);
  28. private:
  29. DWORD DiscoveryThread(api_devicemanager *manager);
  30. friend static DWORD CALLBACK DeviceProvider_DiscoveryThreadStarter(void *param);
  31. protected:
  32. size_t ref;
  33. HANDLE discoveryThread;
  34. HANDLE cancelEvent;
  35. TestSuite testSuite;
  36. CRITICAL_SECTION lock;
  37. protected:
  38. RECVS_DISPATCH;
  39. };
  40. #endif //_NULLSOFT_WINAMP_GEN_DEVICE_PROVIDER_IMPLEMENTATION_HEADER