Source code of Windows XP (NT5)
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.

70 lines
1.7 KiB

  1. /**********************************************************************
  2. Copyright (c) 1992-1995 Microsoft Corporation
  3. cookfix.c
  4. DESCRIPTION:
  5. Fixed code for doing output mapping. KEEP THE SIZE OF THIS CODE
  6. TO A MINIMUM!
  7. HISTORY:
  8. 03/04/94 [jimge] created.
  9. *********************************************************************/
  10. #include "preclude.h"
  11. #include <windows.h>
  12. #include <windowsx.h>
  13. #include <mmsystem.h>
  14. #include <mmddk.h>
  15. #include "idf.h"
  16. #include "midimap.h"
  17. #include "debug.h"
  18. /***************************************************************************
  19. @doc internal
  20. @api void | SendNextCookedBuffer | Sends the next cooked buffer on a
  21. mapper handle.
  22. @parm PINSTANCE | pinstance | Pointer to an open instance.
  23. ***************************************************************************/
  24. void FNGLOBAL SendNextCookedBuffer(
  25. PINSTANCE pinstance)
  26. {
  27. PCOOKSYNCOBJ pcooksyncobj;
  28. UINT idx;
  29. LPMIDIHDR lpmh;
  30. MMRESULT mmr;
  31. pcooksyncobj = (PCOOKSYNCOBJ)QueueGet(&pinstance->qCookedHdrs);
  32. if (NULL == pcooksyncobj)
  33. {
  34. DPF(1, TEXT ("SendNextCookedBuffer: No more buffers."));
  35. return;
  36. }
  37. lpmh = pcooksyncobj->lpmh;
  38. pcooksyncobj->cSync = 0;
  39. for (idx = 0; idx < pcooksyncobj->cLPMH; ++idx)
  40. {
  41. ++pcooksyncobj->cSync;
  42. mmr = midiOutPolyMsg(
  43. (HMIDI)(HIWORD(lpmh->dwUser)),
  44. lpmh,
  45. sizeof(*lpmh));
  46. if (MMSYSERR_NOERROR != mmr)
  47. {
  48. --pcooksyncobj->cSync;
  49. DPF(1, TEXT ("midiOutPolyMsg *FAILED* mmr=%08lX"), (DWORD)mmr);
  50. }
  51. }
  52. }