deviceCommand.h 1.5 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364
  1. #ifndef _NULLSOFT_WINAMP_DEVICES_DEVICE_COMMAND_HEADER
  2. #define _NULLSOFT_WINAMP_DEVICES_DEVICE_COMMAND_HEADER
  3. #if defined(_MSC_VER) && (_MSC_VER >= 1020)
  4. #pragma once
  5. #endif
  6. #include "./ifc_devicecommand.h"
  7. #include "./ifc_devicecommandeditor.h"
  8. #include "./ifc_deviceiconstore.h"
  9. #include "./deviceIconStore.h"
  10. #include <bfc/multipatch.h>
  11. #define MPIID_DEVICECOMMAND 10
  12. #define MPIID_DEVICECOMMANDEDITOR 20
  13. class DeviceCommand : public MultiPatch<MPIID_DEVICECOMMAND, ifc_devicecommand>,
  14. public MultiPatch<MPIID_DEVICECOMMANDEDITOR, ifc_devicecommandeditor>
  15. {
  16. protected:
  17. DeviceCommand();
  18. ~DeviceCommand();
  19. public:
  20. static HRESULT CreateInstance(const char *name, DeviceCommand **instance);
  21. public:
  22. /* Dispatchable */
  23. size_t AddRef();
  24. size_t Release();
  25. int QueryInterface(GUID interface_guid, void **object);
  26. /* ifc_devicecommand */
  27. const char *GetName();
  28. HRESULT GetIcon(wchar_t *buffer, size_t bufferSize, int width, int height);
  29. HRESULT GetDisplayName(wchar_t *buffer, size_t bufferSize);
  30. HRESULT GetDescription(wchar_t *buffer, size_t bufferSize);
  31. /* ifc_devicetypeeditor */
  32. HRESULT GetIconStore(ifc_deviceiconstore **store);
  33. HRESULT SetDisplayName(const wchar_t *displayName);
  34. HRESULT SetDescription(const wchar_t *description);
  35. public:
  36. void Lock();
  37. void Unlock();
  38. protected:
  39. size_t ref;
  40. char *name;
  41. wchar_t *displayName;
  42. wchar_t *description;
  43. DeviceIconStore *iconStore;
  44. CRITICAL_SECTION lock;
  45. protected:
  46. RECVS_MULTIPATCH;
  47. };
  48. #endif // _NULLSOFT_WINAMP_DEVICES_DEVICE_COMMAND_HEADER