deviceType.h 1.3 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859
  1. #ifndef _NULLSOFT_WINAMP_DEVICES_DEVICE_TYPE_HEADER
  2. #define _NULLSOFT_WINAMP_DEVICES_DEVICE_TYPE_HEADER
  3. #if defined(_MSC_VER) && (_MSC_VER >= 1020)
  4. #pragma once
  5. #endif
  6. #include "./ifc_devicetype.h"
  7. #include "./ifc_devicetypeeditor.h"
  8. #include "./ifc_deviceiconstore.h"
  9. #include "./deviceIconStore.h"
  10. #include <bfc/multipatch.h>
  11. #define MPIID_DEVICETYPE 10
  12. #define MPIID_DEVICETYPEEDITOR 20
  13. class DeviceType : public MultiPatch<MPIID_DEVICETYPE, ifc_devicetype>,
  14. public MultiPatch<MPIID_DEVICETYPEEDITOR, ifc_devicetypeeditor>
  15. {
  16. protected:
  17. DeviceType();
  18. ~DeviceType();
  19. public:
  20. static HRESULT CreateInstance(const char *name, DeviceType **instance);
  21. public:
  22. /* Dispatchable */
  23. size_t AddRef();
  24. size_t Release();
  25. int QueryInterface(GUID interface_guid, void **object);
  26. /* ifc_devicetype */
  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. /* ifc_devicetypeeditor */
  31. HRESULT GetIconStore(ifc_deviceiconstore **store);
  32. HRESULT SetDisplayName(const wchar_t *displayName);
  33. public:
  34. void Lock();
  35. void Unlock();
  36. protected:
  37. size_t ref;
  38. char *name;
  39. wchar_t *displayName;
  40. DeviceIconStore *iconStore;
  41. CRITICAL_SECTION lock;
  42. protected:
  43. RECVS_MULTIPATCH;
  44. };
  45. #endif // _NULLSOFT_WINAMP_DEVICES_DEVICE_TYPE_HEADER