aboutsummaryrefslogtreecommitdiff
path: root/Src/devices/deviceConnection.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/devices/deviceConnection.h
parent537bcbc86291b32fc04ae4133ce4d7cac8ebe9a7 (diff)
downloadwinamp-20d28e80a5c861a9d5f449ea911ab75b4f37ad0d.tar.gz
Initial community commit
Diffstat (limited to 'Src/devices/deviceConnection.h')
-rw-r--r--Src/devices/deviceConnection.h59
1 files changed, 59 insertions, 0 deletions
diff --git a/Src/devices/deviceConnection.h b/Src/devices/deviceConnection.h
new file mode 100644
index 00000000..3d2dd8e2
--- /dev/null
+++ b/Src/devices/deviceConnection.h
@@ -0,0 +1,59 @@
+#ifndef _NULLSOFT_WINAMP_DEVICES_DEVICE_CONNECTION_HEADER
+#define _NULLSOFT_WINAMP_DEVICES_DEVICE_CONNECTION_HEADER
+
+#if defined(_MSC_VER) && (_MSC_VER >= 1020)
+#pragma once
+#endif
+
+#include "./ifc_deviceconnection.h"
+#include "./ifc_deviceconnectioneditor.h"
+#include "./ifc_deviceiconstore.h"
+#include "./deviceIconStore.h"
+
+#include <bfc/multipatch.h>
+
+#define MPIID_DEVICECONNECTION 10
+#define MPIID_DEVICECONNECTIONEDITOR 20
+
+class DeviceConnection : public MultiPatch<MPIID_DEVICECONNECTION, ifc_deviceconnection>,
+ public MultiPatch<MPIID_DEVICECONNECTIONEDITOR, ifc_deviceconnectioneditor>
+{
+
+protected:
+ DeviceConnection();
+ ~DeviceConnection();
+
+public:
+ static HRESULT CreateInstance(const char *name, DeviceConnection **instance);
+
+public:
+ /* Dispatchable */
+ size_t AddRef();
+ size_t Release();
+ int QueryInterface(GUID interface_guid, void **object);
+
+ /* ifc_deviceconnection */
+ const char *GetName();
+ HRESULT GetIcon(wchar_t *buffer, size_t bufferSize, int width, int height);
+ HRESULT GetDisplayName(wchar_t *buffer, size_t bufferSize);
+
+ /* ifc_deviceconnectioneditor */
+ HRESULT GetIconStore(ifc_deviceiconstore **store);
+ HRESULT SetDisplayName(const wchar_t *displayName);
+
+public:
+ void Lock();
+ void Unlock();
+
+protected:
+ size_t ref;
+ char *name;
+ wchar_t *displayName;
+ DeviceIconStore *iconStore;
+ CRITICAL_SECTION lock;
+
+protected:
+ RECVS_MULTIPATCH;
+};
+
+#endif // _NULLSOFT_WINAMP_DEVICES_DEVICE_CONNECTION_HEADER