aboutsummaryrefslogtreecommitdiff
path: root/Src/Plugins/Library/ml_pmp/DeviceCommands.h
diff options
context:
space:
mode:
authorJef <jef@targetspot.com>2024-09-24 08:54:57 -0400
committerJef <jef@targetspot.com>2024-09-24 08:54:57 -0400
commit20d28e80a5c861a9d5f449ea911ab75b4f37ad0d (patch)
tree12f17f78986871dd2cfb0a56e5e93b545c1ae0d0 /Src/Plugins/Library/ml_pmp/DeviceCommands.h
parent537bcbc86291b32fc04ae4133ce4d7cac8ebe9a7 (diff)
downloadwinamp-20d28e80a5c861a9d5f449ea911ab75b4f37ad0d.tar.gz
Initial community commit
Diffstat (limited to 'Src/Plugins/Library/ml_pmp/DeviceCommands.h')
-rw-r--r--Src/Plugins/Library/ml_pmp/DeviceCommands.h65
1 files changed, 65 insertions, 0 deletions
diff --git a/Src/Plugins/Library/ml_pmp/DeviceCommands.h b/Src/Plugins/Library/ml_pmp/DeviceCommands.h
new file mode 100644
index 00000000..3aa237d2
--- /dev/null
+++ b/Src/Plugins/Library/ml_pmp/DeviceCommands.h
@@ -0,0 +1,65 @@
+#pragma once
+#include "../nu/refcount.h"
+#include "../devices/ifc_devicecommand.h"
+#include "../devices/ifc_devicesupportedcommand.h"
+#include "../devices/ifc_devicesupportedcommandenum.h"
+class PortableCommand : public ifc_devicecommand
+{
+public:
+ PortableCommand(const char *name, int title, int description);
+ const char *name;
+ int title;
+ int description;
+
+ 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);
+RECVS_DISPATCH;
+};
+
+typedef struct DeviceCommandInfo
+{
+ const char *name;
+ DeviceCommandFlags flags;
+} DeviceCommandInfo;
+
+BOOL SetDeviceCommandInfo(DeviceCommandInfo *info, const char *name, DeviceCommandFlags flags);
+
+class DeviceCommand : public Countable<ifc_devicesupportedcommand>
+{
+public:
+ DeviceCommand(const char *name, DeviceCommandFlags flags);
+ DeviceCommand(const DeviceCommandInfo *commandInfo);
+
+public:
+ const char *GetName();
+ HRESULT GetFlags(DeviceCommandFlags *flags);
+ REFERENCE_COUNT_IMPLEMENTATION;
+
+public:
+ const char *name;
+ DeviceCommandFlags flags;
+RECVS_DISPATCH;
+};
+
+class DeviceCommandEnumerator : public Countable<ifc_devicesupportedcommandenum>
+{
+public:
+ DeviceCommandEnumerator(const DeviceCommandInfo *commandInfoList, size_t listSize);
+ ~DeviceCommandEnumerator();
+
+ HRESULT Next(ifc_devicesupportedcommand **buffer, size_t bufferMax, size_t *count);
+ HRESULT Reset(void);
+ HRESULT Skip(size_t count);
+ HRESULT GetCount(size_t *count);
+ REFERENCE_COUNT_IMPLEMENTATION;
+
+private:
+ size_t position;
+ DeviceCommand **commands;
+ size_t count;
+ RECVS_DISPATCH;
+};