aboutsummaryrefslogtreecommitdiff
path: root/Src/Wasabi/api/application/ipcs.h
diff options
context:
space:
mode:
authorJean-Francois Mauguit <jfmauguit@mac.com>2024-09-24 09:03:25 -0400
committerGitHub <noreply@github.com>2024-09-24 09:03:25 -0400
commitbab614c421ed7ae329d26bf028c4a3b1d2450f5a (patch)
tree12f17f78986871dd2cfb0a56e5e93b545c1ae0d0 /Src/Wasabi/api/application/ipcs.h
parent4bde6044fddf053f31795b9eaccdd2a5a527d21f (diff)
parent20d28e80a5c861a9d5f449ea911ab75b4f37ad0d (diff)
downloadwinamp-bab614c421ed7ae329d26bf028c4a3b1d2450f5a.tar.gz
Merge pull request #5 from WinampDesktop/community
Merge to main
Diffstat (limited to 'Src/Wasabi/api/application/ipcs.h')
-rw-r--r--Src/Wasabi/api/application/ipcs.h60
1 files changed, 60 insertions, 0 deletions
diff --git a/Src/Wasabi/api/application/ipcs.h b/Src/Wasabi/api/application/ipcs.h
new file mode 100644
index 00000000..8ef50062
--- /dev/null
+++ b/Src/Wasabi/api/application/ipcs.h
@@ -0,0 +1,60 @@
+#ifndef _IPCS_H
+#define _IPCS_H
+
+// same value as winamp 2.x
+#define WM_WA_IPC WM_USER
+
+#ifdef LINUX
+// Stolen from a webpage, I think Linux's is higher, but to be safe...
+#define IPC_MSGMAX 4056
+
+struct wa_msgbuf {
+ long mtype;
+ int paramlen;
+ char param[IPC_MSGMAX - 4];
+};
+#endif
+
+namespace IpcsCommand {
+ enum {
+#ifdef WASABI_API_MEDIACORE
+ // wa2.x IPC messages
+ IPC_PLAYFILE=100,
+#endif
+
+#ifdef WASABI_API_COMPONENT
+ // wa3 IPC messages
+ IPC_COMMANDLINE=1000,
+#endif
+ };
+};
+
+class IpcsPtr {
+public:
+#ifdef WIN32
+ IpcsPtr(HWND hwnd);
+#else
+ IpcsPtr(int qid);
+#endif
+
+ void sendWasabiCommand(int command, void *param=0, int paramlen=0);
+ void sendWasabiCommand(int command, const char *param);
+
+ void moveToForeground();
+
+private:
+#ifdef WIN32
+ HWND hwnd;
+#else
+ int qid;
+#endif
+};
+
+class Ipcs {
+public:
+ static IpcsPtr *getOtherWasabiInstance();
+
+ static int onIpcsMessage(int command, void *param, int paramlen);
+};
+
+#endif