deviceConnection.h 1.4 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859
  1. #ifndef _NULLSOFT_WINAMP_DEVICES_DEVICE_CONNECTION_HEADER
  2. #define _NULLSOFT_WINAMP_DEVICES_DEVICE_CONNECTION_HEADER
  3. #if defined(_MSC_VER) && (_MSC_VER >= 1020)
  4. #pragma once
  5. #endif
  6. #include "./ifc_deviceconnection.h"
  7. #include "./ifc_deviceconnectioneditor.h"
  8. #include "./ifc_deviceiconstore.h"
  9. #include "./deviceIconStore.h"
  10. #include <bfc/multipatch.h>
  11. #define MPIID_DEVICECONNECTION 10
  12. #define MPIID_DEVICECONNECTIONEDITOR 20
  13. class DeviceConnection : public MultiPatch<MPIID_DEVICECONNECTION, ifc_deviceconnection>,
  14. public MultiPatch<MPIID_DEVICECONNECTIONEDITOR, ifc_deviceconnectioneditor>
  15. {
  16. protected:
  17. DeviceConnection();
  18. ~DeviceConnection();
  19. public:
  20. static HRESULT CreateInstance(const char *name, DeviceConnection **instance);
  21. public:
  22. /* Dispatchable */
  23. size_t AddRef();
  24. size_t Release();
  25. int QueryInterface(GUID interface_guid, void **object);
  26. /* ifc_deviceconnection */
  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_deviceconnectioneditor */
  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_CONNECTION_HEADER