Share via


WMEncStreamEdit.OnStateChange

Windows Media Encoder SDK banner art

The OnStateChange event receives a notice indicating whether the stream edit process has been started or stopped.

Syntax

WMEncStreamEdit.OnStateChange(enumState)

Parameters

enumState

[in]  Specifies a member of the WMENC_BASICEDIT_STATE enumeration type indicating the state of postprocessing.

Return Values

This event does not return a value.

Example Code

Dim WithEvents Stream As WMEncStreamEdit
Sub Main()
' Create a WMEncStreamEdit object.
  Set Stream = New WMEncStreamEdit

' This example assumes that you have a source file with two audiences.
' Create a new file using the audio from the first audience and the
' video from the second audience, as follows:

' Add the audio stream from the first audience.
  Stream.AddStream "C:\Source.wmv", WMENC_AUDIO, 0, 0, 1033, 0, 0

' Add the video stream from the second audience.
  Stream.AddStream "C:\Source.wmv", WMENC_VIDEO, 1, 0, 1033, 0, 0

' Specify the output file.
  Stream.OutputFile = "C:\Output.wmv"

' Validate the current settings. In practice, you should add a process
' that handles errors.
  Stream.Validate

' Start editing the stream.
  Stream.Start

' Use a loop to wait for the event notifying you when the stream edit process stops and
' display a message.
  Dim bDone As Boolean
  bDone = False
  Do Until bDone = True
    DoEvents
  Loop

  MsgBox "Done!"

End Sub

' This procedure is called when there is a change in the stream edit process.
Private Sub Stream_OnStateChange(ByVal EnumState As WMEncoderLib.WMENC_BASICEDIT_STATE)
    If EnumState = WMENC_BASICEDIT_STOPPED Then bDone = True
End Sub

Requirements

Reference: Windows Media Encoder

Library: wmenc.exe

See Also