Platform SDK: DirectX

DirectInputEffect.Start

The DirectInputEffect.Start method begins playing an effect. If the effect is already playing, it is restarted from the beginning. If the effect has not been downloaded or has been modified since its last download, then it will be downloaded before being started. This default behavior can be suppressed by passing the DIES_NODOWNLOAD flag.

object.Start(iterations As Long, flags As Long)

Parameters

object
Object expression that resolves to a DirectInputEffect object.
iterations
Number of times to play the effect in sequence. The envelope is re-articulated with each iteration.

To play the effect exactly once, pass 1. To play the effect repeatedly until explicitly stopped, pass -1. To play the effect until explicitly stopped without re-articulating the envelope, modify the effect parameters with the DirectInputEffect.SetParameters method and change the lDuration member of DIEFFECT to -1.

flags
Flags from the CONST_DIESFLAGS enumeration that describe how the effect should be played by the device. The value may be zero or one or more of the following values:
DIES_SOLO
All other effects on the device should be stopped before the specified effect is played. If this flag is omitted, then the effect is mixed with existing effects already started on the device.
DIES_NODOWNLOAD
Do not automatically download the effect.

Error Codes

If the method fails, an error is raised and Err.Number may be set to one of the following:

DIERR_INVALIDPARAM
DIERR_INCOMPLETEEFFECT
DIERR_NOTEXCLUSIVEACQUIRED
DIERR_NOTINITIALIZED
DIERR_UNSUPPORTED

Remarks

The device must be acquired at the exclusive cooperative level for this method to succeed.

Not all devices support multiple iterations.