Jump to content

MCI_SET_SYNC_OFFSET

From EDM2

This message is used to specify positional offsets for devices operating in synchronization.

Syntax

param1
ULONG ulParam1; /* Message flags. */

param2
PMCI_SYNC_OFFSET_PARMS pParam2; /* Pointer to the MCI_SYNC_OFFSET_PARMS structure. */

Parameters

ulParam1 (ULONG) - input
The following standard flags can be used:
  • MCI_NOTIFY Posts a notification message when the action completes.
  • MCI_WAIT Does not return control until the action is completed.
pParam2 (PMCI_SYNC_OFFSET_PARMS) - input
A pointer to the MCI_SYNC_OFFSET_PARMS data structure.

Returns

rc (ULONG) - returns
  • MCIERR_SUCCESS If the function succeeds.
  • MCIERR_INVALID_DEVICE_ID The device ID is not valid.
  • MCIERR_INSTANCE_INACTIVE The device ID is currently inactive. Issue MCI_ACQUIREDEVICE to make the device ID active.
  • MCIERR_MISSING_FLAG A required flag is missing.
  • MCIERR_UNSUPPORTED_FLAG The given flag is unsupported for this device.
  • MCIERR_INVALID_CALLBACK_HANDLE The given callback handle is invalid.
  • MCIERR_HARDWARE Device hardware error.
  • MCIERR_UNSUPPORTED_FUNCTION Unsupported function.
  • MCIERR_INVALID_FLAG The `ulParam1` flag is invalid.
  • MCIERR_FLAGS_NOT_COMPATIBLE Flags cannot be used together.
  • MCIERR_OUT_OF_MEMORY Out of memory.
  • MCIERR_MISSING_PARAMETER A required parameter is missing.

Remarks

This message sets the synchronization offset for a device. When MCI_PLAY or MCI_SEEK messages are sent to a synchronized device group, the "from" position of the play for each device is biased by its synchronization offset.

The synchronization offset is specified in the currently set device units (time format) and is **0** by default.

Example Code

The following code illustrates how to set the synchronization offset for a device to 10 seconds.

   USHORT                usDeviceID;
   MCI_SYNC_OFFSET_PARMS msoparms;

   /* Set the sync offset for the device to 10 seconds */
   /* (Assumes current time format is milliseconds)    */
   msoparms.ulOffset = (ULONG) 10000; 

   mciSendCommand( usDeviceID,           /* Device ID                   */
                   MCI_SET_SYNC_OFFSET,  /* MCI set sync offset message */
                   MCI_WAIT,             /* Flag for this message       */
                   (PVOID) &msoparms,    /* Data structure              */
                   0);                   /* No user parm                */

Related Messages