delete
The delete command deletes a data segment from a file. Digital-video and waveform-audio devices recognize this command.
To send this command, call the mciSendString function with the lpszCommand parameter set as follows.
_stprintf_s(
lpszCommand,
TEXT("delete %s %s %s"),
lpszDeviceID,
lpszPosition,
lpszFlags
);
Parameters
lpszDeviceID
Identifier of an MCI device. This identifier or alias is assigned when the device is opened.
lpszPosition
Flag that identifies a data segment to delete. The following table lists device types that recognize the delete command and the flags used by each type.
Value | Meaning | Meaning |
digitalvideo | at rectangle audio stream stream from position |
to position video stream stream |
waveaudio | from position | to position |
The following table lists the flags that can be specified in the lpszPosition parameter and their meanings.
Value | Meaning |
at rectangle | Specifies the portion of each frame deleted. If omitted, it defaults to the entire frame. When this item is specified, frames are not deleted. Instead the area inside the rectangle becomes black. |
audio stream stream | Specifies the audio stream in the workspace affected by the command. If you use this flag and also want to delete video, you must also use the "video stream" flag. (If neither flag is specified, all audio and video streams are deleted.) |
from position | Specifies the position at which deletion begins. If this flag is omitted, the deletion begins at the current position. |
to position | Specifies the position at which deletion ends. If this flag is omitted, the deletion continues to the end of the content or workspace. |
video stream stream | Specifies the video stream in the workspace affected by the command. If you use this flag and also want to delete audio, you must also use "audio stream" flag. (If neither flag is specified, all audio and video streams are deleted.) |
lpszFlags
Can be "wait", "notify", or both. For digital-video and VCR devices, "test" can also be specified. For more information about these flags, see The Wait, Notify, and Test Flags.
Return Values
Returns zero if successful or an error otherwise.
Remarks
Before issuing any commands that use position values, you should set the desired time format by using the set command.
The following command deletes the waveform-audio data from 1 millisecond through 900 milliseconds (assuming the time format is set to milliseconds):
delete mysound from 1 to 900
Requirements
** Windows NT/2000/XP:** Included in Windows NT 3.1 and later.
** Windows 95/98/Me:** Included in Windows 95 and later.
See Also