SMH_REPORTEVENT - Example Code

The following code illustrates how to report events or sync pulses to the Sync/Stream Manager.

#include        "os2.h"
#include        "os2me.h"

  ULONG         ulRC;               /* Error return code.              * /
  HID           hidSource;          /* Source handler ID.              */
  TIME_EVCB     timeevcb;           /* Cue point event control block.  */
  HEVENT        hevent;             /* Time event handle.              */
  HSTREAM       hstream;            /* Stream handle.                  */
  HID           hid;                /* Handler ID.                     */
  PARM_EVENT    parm_event;         /* Report event parameter block.   */
  MMTIME        mmtimeCurrent;      /* Current stream time.            */
  PSMHFN        SMHEntryPoint;      /* Pointer to SMH entry point.     */

/*----------------------------------------------------------------------*/
/*  Report an event.                                                    */
/*----------------------------------------------------------------------*/
  parm_event.ulFunction = SMH_REPORTEVENT;     /* Set function.         */
  parm_event.hid = hidSource;                  /* Source handler ID.    */
  parm_event.hevent = hevent;                  /* Event handle.         */
  parm_event.pevcbEvent = (PEVCB) &timeevcb;   /* Pointer to Time EVCB. */

  timeevcb.ulType = EVENT_CUE_TIME;            /* Set event type.       */
  timeevcb.hstream = hstream;                  /* Set stream handle.    */
  timeevcb.hid = hid;                          /* Set handler ID.       */
  timeevcb.ulStatus = 0;                       /* No status.            */
  timeevcb.mmtimeStream = mmtimeCurrent;       /* Set current time.     */

  if (ulRC = SMHEntryPoint (&parm_event))
     return(ulRC);                               /* Error! */


[Back: SMH_REPORTEVENT - Remarks]
[Next: SMH_REPORTEVENT - Topics]