ipcs.h 959 B

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960
  1. #ifndef _IPCS_H
  2. #define _IPCS_H
  3. // same value as winamp 2.x
  4. #define WM_WA_IPC WM_USER
  5. #ifdef LINUX
  6. // Stolen from a webpage, I think Linux's is higher, but to be safe...
  7. #define IPC_MSGMAX 4056
  8. struct wa_msgbuf {
  9. long mtype;
  10. int paramlen;
  11. char param[IPC_MSGMAX - 4];
  12. };
  13. #endif
  14. namespace IpcsCommand {
  15. enum {
  16. #ifdef WASABI_API_MEDIACORE
  17. // wa2.x IPC messages
  18. IPC_PLAYFILE=100,
  19. #endif
  20. #ifdef WASABI_API_COMPONENT
  21. // wa3 IPC messages
  22. IPC_COMMANDLINE=1000,
  23. #endif
  24. };
  25. };
  26. class IpcsPtr {
  27. public:
  28. #ifdef WIN32
  29. IpcsPtr(HWND hwnd);
  30. #else
  31. IpcsPtr(int qid);
  32. #endif
  33. void sendWasabiCommand(int command, void *param=0, int paramlen=0);
  34. void sendWasabiCommand(int command, const char *param);
  35. void moveToForeground();
  36. private:
  37. #ifdef WIN32
  38. HWND hwnd;
  39. #else
  40. int qid;
  41. #endif
  42. };
  43. class Ipcs {
  44. public:
  45. static IpcsPtr *getOtherWasabiInstance();
  46. static int onIpcsMessage(int command, void *param, int paramlen);
  47. };
  48. #endif