## MMPM/2 Device Driver Reference

[prev][next][parent][TOC]

### DDCMDCONTROL Field - ulCmd

ulCmd (ULONG) Defines the following flags:

DDCMD_START Starts a device.

DDCMD_STOP Stops a device and returns the current stream time in milliseconds. All buffers in the PDD are flushed and everything is reset to 0. The device driver sends the current stream time back to the stream handler in milliseconds (using the pParm and ulParmSize fields). For example, return a ULONG of stream time (in milliseconds) and the ULONG of 4 bytes is input in the ulParmSize field.

DDCMD_PAUSE Pauses the device and returns the current stream time in milliseconds. Unlike DDCMD_STOP, DDCMD_PAUSE is not destructive. The device driver is able to resume its function at a later time, exactly where it was paused. DDCMD_ PAUSE returns the current stream time in milliseconds within the pParm field.

DDCMD_RESUME Resumes a currently paused stream. DDCMD_RESUME is only honored if the stream was paused previously. If the stream was stopped and the stream handler issues DDCMD_RESUME, an ERROR_INVALID_SEQUENCE is returned.

DDCMD_ENABLE_EVENT Enables event detection if your PDD supports events. The event message is sent to the device driver and reviews the structure. The hEvent field is a unique handle that signifies the event. pParm contains the stream time with which the event should be detected. This command would be honored whether currently in a streaming state, pause, or stop.

For example, a stream handler is programmed to be detected at 1000 milliseconds in the stream. It sends a DDCMD_ENABLE_EVENT to the device driver with a unique handle event (hEvent) and 1000 milliseconds stated in the pParm field. The device driver obtains the handle event, makes sure there are no duplicate entries, and adds the hEvent to a link list or array (depending on how the device driver is implemented). The device driver now knows it must report an event back to the stream handler when 1000 milliseconds has been reached in the stream. See SHD_REPORT_EVENT for further information.

DDCMD_DISABLE_EVENT Disables event detection in the device driver. An event handle is passed from the structure. The device driver searches its linked list or array to find the matching event handle and deletes it from the list.

DDCMD_PAUSE_TIME Pauses the time but not the stream.

DDCMD_RESUME_TIME Resumes the time.