Leaked source code of windows server 2003
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

65 lines
2.2 KiB

  1. /* Copyright (c) 1992 Microsoft Corporation */
  2. /* callback put in separate module because must be fixed */
  3. #define UNICODE
  4. //MMSYSTEM
  5. #define MMNOSOUND - Sound support
  6. #define MMNOWAVE - Waveform support
  7. #define MMNOAUX - Auxiliary output support
  8. #define MMNOJOY - Joystick support
  9. //MMDDK
  10. #define NOWAVEDEV - Waveform support
  11. #define NOAUXDEV - Auxiliary output support
  12. #define NOJOYDEV - Joystick support
  13. #include <windows.h>
  14. #include <mmsystem.h>
  15. #include <mmddk.h>
  16. #include "mmsys.h"
  17. #include "list.h"
  18. #include "mciseq.h"
  19. PUBLIC void FAR PASCAL _LOADDS mciSeqCallback (HANDLE h, UINT wMsg, DWORD_PTR dwInstance,
  20. DWORD_PTR dw1, DWORD_PTR dw2)
  21. // this function handles messages from the sequencer
  22. {
  23. pSeqStreamType pStream = (pSeqStreamType) dwInstance;
  24. switch (wMsg)
  25. {
  26. case MIDISEQ_DONE: // sequencer is done with buff (& wants a new one)
  27. // clear the beginning and end flags, and set the done flag
  28. ((LPMIDISEQHDR) dw1)->wFlags &= ~(MIDISEQHDR_BOT + MIDISEQHDR_EOT);
  29. ((LPMIDISEQHDR) dw1)->wFlags |= MIDISEQHDR_DONE; // set done bit
  30. TaskSignal(pStream->streamTaskHandle, WTM_FILLBUFFER); // SIGNAL on this seq
  31. break;
  32. case MIDISEQ_RESET: // sequencer wants to reset the stream
  33. StreamTrackReset(pStream, (UINT) dw1);
  34. break;
  35. case MIDISEQ_DONEPLAY:
  36. TaskSignal(pStream->streamTaskHandle, WTM_DONEPLAY);
  37. break;
  38. }
  39. }
  40. /***********************************************************************/
  41. PUBLIC void FAR PASCAL NotifyCallback(HANDLE hStream)
  42. // Callback for all notifies from MMSEQ
  43. {
  44. Notify((pSeqStreamType)hStream, MCI_NOTIFY_SUCCESSFUL);
  45. }
  46. /*************************************************************************/
  47. PUBLIC VOID FAR PASCAL Notify(pSeqStreamType pStream, UINT wStatus)
  48. // notifies with cb and instance stored in pStream, with wMsg (success, abort..)
  49. {
  50. if (pStream->hNotifyCB) {
  51. mciDriverNotify(pStream->hNotifyCB, pStream->wDeviceID, wStatus);
  52. pStream->hNotifyCB = NULL; // this signifies that it has been notified
  53. }
  54. }