1
0

deviceSupportedCommandStore.h 1.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869
  1. #ifndef _NULLSOFT_WINAMP_DEVICES_DEVICE_SUPPORTED_COMMAND_STORE_HEADER
  2. #define _NULLSOFT_WINAMP_DEVICES_DEVICE_SUPPORTED_COMMAND_STORE_HEADER
  3. #if defined(_MSC_VER) && (_MSC_VER >= 1020)
  4. #pragma once
  5. #endif
  6. #include "./ifc_devicesupportedcommandstore.h"
  7. #include "./deviceSupportedCommand.h"
  8. #include "./ifc_devicesupportedcommandenum.h"
  9. #include <vector>
  10. class DeviceSupportedCommandStore : public ifc_devicesupportedcommandstore
  11. {
  12. protected:
  13. DeviceSupportedCommandStore();
  14. ~DeviceSupportedCommandStore();
  15. public:
  16. static HRESULT CreateInstance(DeviceSupportedCommandStore **instance);
  17. public:
  18. /* Dispatchable */
  19. size_t AddRef();
  20. size_t Release();
  21. int QueryInterface(GUID interface_guid, void **object);
  22. /* ifc_devicesupportedcommandstore*/
  23. HRESULT Add(const char *name, DeviceCommandFlags flags);
  24. HRESULT Remove(const char *name);
  25. HRESULT RemoveAll();
  26. HRESULT GetFlags(const char *name, DeviceCommandFlags *flagsOut);
  27. HRESULT SetFlags(const char *name, DeviceCommandFlags mask, DeviceCommandFlags value);
  28. HRESULT Get(const char *name, ifc_devicesupportedcommand **command);
  29. HRESULT GetActive(ifc_devicesupportedcommand **command);
  30. HRESULT Enumerate(ifc_devicesupportedcommandenum **enumerator);
  31. HRESULT Clone(ifc_devicesupportedcommandstore **instance, BOOL fullCopy);
  32. public:
  33. void Lock();
  34. void Unlock();
  35. protected:
  36. static int SearchCallback(const void *key, const void *element);
  37. static int SortCallback(const void *element1, const void *element2);
  38. DeviceSupportedCommand *Find(const char *name, size_t *indexOut);
  39. protected:
  40. typedef std::vector<DeviceSupportedCommand*> CommandList;
  41. protected:
  42. size_t ref;
  43. CommandList commandList;
  44. CRITICAL_SECTION lock;
  45. protected:
  46. RECVS_DISPATCH;
  47. };
  48. #endif // _NULLSOFT_WINAMP_DEVICES_DEVICE_SUPPORTED_COMMAND_STORE_HEADER