diff options
author | Jef <jef@targetspot.com> | 2024-09-24 08:54:57 -0400 |
---|---|---|
committer | Jef <jef@targetspot.com> | 2024-09-24 08:54:57 -0400 |
commit | 20d28e80a5c861a9d5f449ea911ab75b4f37ad0d (patch) | |
tree | 12f17f78986871dd2cfb0a56e5e93b545c1ae0d0 /Src/devices/deviceCommand.h | |
parent | 537bcbc86291b32fc04ae4133ce4d7cac8ebe9a7 (diff) | |
download | winamp-20d28e80a5c861a9d5f449ea911ab75b4f37ad0d.tar.gz |
Initial community commit
Diffstat (limited to 'Src/devices/deviceCommand.h')
-rw-r--r-- | Src/devices/deviceCommand.h | 64 |
1 files changed, 64 insertions, 0 deletions
diff --git a/Src/devices/deviceCommand.h b/Src/devices/deviceCommand.h new file mode 100644 index 00000000..60b9ee70 --- /dev/null +++ b/Src/devices/deviceCommand.h @@ -0,0 +1,64 @@ +#ifndef _NULLSOFT_WINAMP_DEVICES_DEVICE_COMMAND_HEADER +#define _NULLSOFT_WINAMP_DEVICES_DEVICE_COMMAND_HEADER + +#if defined(_MSC_VER) && (_MSC_VER >= 1020) +#pragma once +#endif + +#include "./ifc_devicecommand.h" +#include "./ifc_devicecommandeditor.h" +#include "./ifc_deviceiconstore.h" +#include "./deviceIconStore.h" + +#include <bfc/multipatch.h> + +#define MPIID_DEVICECOMMAND 10 +#define MPIID_DEVICECOMMANDEDITOR 20 + + +class DeviceCommand : public MultiPatch<MPIID_DEVICECOMMAND, ifc_devicecommand>, + public MultiPatch<MPIID_DEVICECOMMANDEDITOR, ifc_devicecommandeditor> +{ + +protected: + DeviceCommand(); + ~DeviceCommand(); + +public: + static HRESULT CreateInstance(const char *name, DeviceCommand **instance); + +public: + /* Dispatchable */ + size_t AddRef(); + size_t Release(); + int QueryInterface(GUID interface_guid, void **object); + + /* ifc_devicecommand */ + const char *GetName(); + HRESULT GetIcon(wchar_t *buffer, size_t bufferSize, int width, int height); + HRESULT GetDisplayName(wchar_t *buffer, size_t bufferSize); + HRESULT GetDescription(wchar_t *buffer, size_t bufferSize); + + /* ifc_devicetypeeditor */ + HRESULT GetIconStore(ifc_deviceiconstore **store); + HRESULT SetDisplayName(const wchar_t *displayName); + HRESULT SetDescription(const wchar_t *description); + +public: + void Lock(); + void Unlock(); + + +protected: + size_t ref; + char *name; + wchar_t *displayName; + wchar_t *description; + DeviceIconStore *iconStore; + CRITICAL_SECTION lock; + +protected: + RECVS_MULTIPATCH; +}; + +#endif // _NULLSOFT_WINAMP_DEVICES_DEVICE_COMMAND_HEADER |