1
0

video_ipc.cpp 2.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111
  1. #include "Main.h"
  2. #include "video.h"
  3. extern "C"
  4. {
  5. extern wchar_t vidoutbuf_save[];
  6. }
  7. int WINAPI VideoIPCProcedure(int which, WPARAM data, LRESULT *returnValue)
  8. {
  9. switch (which)
  10. {
  11. case IPC_GETNUMAUDIOTRACKS:
  12. *returnValue = video_getNumAudioTracks();
  13. return 1;
  14. case IPC_GETNUMVIDEOTRACKS:
  15. *returnValue = video_getNumVideoTracks();
  16. return 1;
  17. case IPC_GETAUDIOTRACK:
  18. *returnValue = video_getCurAudioTrack();
  19. return 1;
  20. case IPC_GETVIDEOTRACK:
  21. *returnValue = video_getCurVideoTrack();
  22. return 1;
  23. case IPC_SETAUDIOTRACK:
  24. *returnValue = video_setCurAudioTrack(data);
  25. return 1;
  26. case IPC_SETVIDEOTRACK:
  27. *returnValue = video_setCurVideoTrack(data);
  28. return 1;
  29. case IPC_SETSTOPONVIDEOCLOSE:
  30. config_video_stopclose = data;
  31. *returnValue = 0;
  32. return 1;
  33. case IPC_GETSTOPONVIDEOCLOSE:
  34. *returnValue = config_video_stopclose;
  35. return 1;
  36. case IPC_GETVIDEORESIZE:
  37. *returnValue = config_video_updsize;
  38. return 1;
  39. case IPC_SETVIDEORESIZE:
  40. config_video_updsize = data;
  41. *returnValue = 0;
  42. return 1;
  43. case IPC_GETWND:
  44. if (data == IPC_GETWND_VIDEO)
  45. {
  46. *returnValue = (LRESULT)hVideoWindow;
  47. return 1;
  48. }
  49. break;
  50. case IPC_ISWNDVISIBLE:
  51. if (data == IPC_GETWND_VIDEO)
  52. {
  53. *returnValue = config_video_open;
  54. return 1;
  55. }
  56. break;
  57. case IPC_ENABLEDISABLE_ALL_WINDOWS:
  58. EnableWindow(hVideoWindow, data != 0xdeadbeef);
  59. break;
  60. case IPC_GETINFO:
  61. if (data == 3)
  62. {
  63. *returnValue = videoGetWidthHeightDWORD();
  64. return 1;
  65. }
  66. if (data == 4)
  67. {
  68. *returnValue = (LRESULT) vidoutbuf_save;
  69. return 1;
  70. }
  71. break;
  72. case IPC_HAS_VIDEO_SUPPORT:
  73. *returnValue = g_has_video_plugin;
  74. return 1;
  75. case IPC_IS_PLAYING_VIDEO:
  76. *returnValue = video_isVideoPlaying() ? 2 : 0;
  77. return 1;
  78. case IPC_IS_FULLSCREEN:
  79. if (is_fullscreen_video)
  80. {
  81. *returnValue = 1;
  82. return 1;
  83. }
  84. break;
  85. case IPC_GET_IVIDEOOUTPUT:
  86. *returnValue = (LRESULT)video_getIVideoOutput();
  87. return 1;
  88. case IPC_VIDCMD:
  89. Vid_Cmd((windowCommand*)data);
  90. break;
  91. }
  92. return 0;
  93. }