Jump to content

MMIOM_SEEKBYTIME

From EDM2

The MMIOM_SEEKBYTIME message is sent to a Multimedia I/O (MMIO) procedure via the mmioSendMessage function to request that the current file position pointer be relocated using temporal metrics instead of raw byte offsets.

Syntax

newPosition = mmioSendMessage(hmmio, MMIOM_SEEKBYTIME, timeOffset, seekMode);

Parameters

pmmioinfo (PMMIOINFO)
A pointer to an MMIOINFO data structure maintaining the runtime state of the open file channel. The I/O procedure updates the internal raw tracking position marker (`lDiskOffset`) once it translates the time coordinates into physical file position metrics.
usMsg (USHORT)
The message identifier, set to `MMIOM_SEEKBYTIME`.
lParam1 (LONG)
A signed integer specifying the target movement offset expressed in `MMTIME` units (where 1 unit equals $1/3000$ of a second). Depending on the flags passed in lParam2, this value can be positive or negative.
lParam2 (LONG)
A flag specifying the temporal reference origin for the seek calculation:
  • SEEK_SET: Relocates the file pointer to an absolute position exactly lParam1 time units from the beginning of the file. This is the default mode.
  • SEEK_CUR: Shifts the pointer relative to the current position by the time units specified in lParam1 (positive values advance downstream, negative values retreat upstream).
  • SEEK_END: Shifts the pointer relative to the absolute end-of-file temporal boundary by the number of units specified in lParam1.

Return Value

rc (ULONG)
Returns structural positioning or error states:
  • Greater than or equal to 0: Successful completion; returns the brand-new absolute byte position offset calculated from the beginning of the file.
  • MMIO_ERROR: The seek request failed, or the underlying I/O procedure does not support temporal translation.

Remarks

  • **Temporal Units Definition**: Time metrics utilized by this message are strict platform standard `MMTIME` values, calibrated to a precision layout of **3000 units per second**.
  • **Driver-Level Byte Translation**: Because physical storage devices can only parse byte positions, the primary responsibility of an I/O procedure handling this message is to perform internal mathematics. It must calculate the target byte position using the stream's audio sampling rate, video frame rate, or bit rate context, and then record the resolved byte offset inside the `lDiskOffset` field of the MMIOINFO structure.
  • **Limited Codec Support**: Unlike byte-level queries via MMIOM_SEEK, not all custom I/O procedures support temporal tracking. It is primarily reserved for formats with strict internal timestamp infrastructures or linear frame indexes (such as MIDI trackers, digital waveforms, or multiplexed movies).

Related Functions

Related Messages