WMEncBasicEdit.RunState

Windows Media Encoder SDK banner art

The RunState property retrieves a value indicating whether the basic edit process is running or stopped.

Syntax

WMENC_BASICEDIT_STATE = WMEncBasicEdit.RunState

Parameters

This property takes no parameters.

Property Value

A member of the WMENC_BASICEDIT_STATE enumeration type.

Remarks

Use the RunState property to determine if the basic edit process has stopped, for example if an error occurs. Use the ErrorState property to determine whether an error has occurred. This property is read-only.

Example Code

' Create the WMEncBasicEdit object.
  Dim BasicEdit As WMEncBasicEdit
  Set BasicEdit = New WMEncBasicEdit

' Specify the input, output, and configuration files.
  BasicEdit.MediaFile = "C:\InputFile.wmv"
  BasicEdit.OutputFile = "C:\OutputFile.wmv"
  BasicEdit.ConfigFile = "C:\ConfigFile.txt"

' Retrieve the duration of the input file, in seconds.
  Dim lFileDur As Long
  lFileDur = BasicEdit.Duration / 1000

' Retrieve the profile used by the input file.
  Dim Pro As WMEncProfile2
  Set Pro = BasicEdit.Profile

' Save the profile used by the input file.
  BasicEdit.SaveProfile "C:\BasicEditPro.prx"

' Add indexing to the file.
  BasicEdit.Index = True

' Specify a mark-in time of 5 seconds and a mark-out time of 10 seconds.
  BasicEdit.MarkIn = 5000
  BasicEdit.MarkOut = 10000

' Specify an output configuration file.
  BasicEdit.SaveConfigFile "C:\ConfigFile2.txt"

' Start the basic edit process.
  BasicEdit.Start

' Retrieve the run state.
  Dim BERunState as WMENC_BASICEDIT_STATE
  BERunState = BasicEdit.RunState

' Retrieve a run-time error.
  Dim lError As Long
  lError = BasicEdit.ErrorState
  If lError = 123456 Then
  ' Process the error.
  End If

' You can use a timer to retrieve the percentage complete.
  Dim lPercentComplete As Long
  lPercentComplete = BasicEdit.ProgressPercent

' Stop the edit process manually.
  ' BasicEdit.Stop

Requirements

Reference: Windows Media Encoder

Library: wmenc.exe

See Also