WMEncoder.OnDeviceControlStateChange

Windows Media Encoder SDK banner art

The OnDeviceControlStateChange event indicates the state of an external digital device.

Syntax

WMEncoder.OnDeviceControlStateChange(enumState, strName, strScheme)

Parameters

enumState

[in]  Member of a WMENC_DEVICECONTROL_STATE enumeration type indicating the state of the digital device.

strName

[in]  String containing the device resource name.

strScheme

[in]  String containing the scheme, which should be "DeviceControl".

Return Values

This event does not return a value.

Remarks

You can find the name of the plug-in by enumerating the plug-ins with the "DeviceControl" scheme type. For more information, see Enumerating Devices.

For an end-to-end example, see Controlling a Digital Device (Visual Basic).

Example Code

Private Sub Encoder_OnDeviceControlStateChange(ByVal EnumState As WMEncoderLib.WMENC_DEVICECONTROL_STATE, ByVal sName As String, ByVal sScheme As String)
' When the device state changes, display the state in Label1.
  Select Case EnumState:
        Case WMENC_DEVICECONTROL_PLAYING
        Label1.Caption = "Playing"
        
        Case WMENC_DEVICECONTROL_STOPPED
        Label1.Caption = "Stopped"
        
        Case WMENC_DEVICECONTROL_FASTFORWARDING
        Label1.Caption = "Forwarding"
        
        Case WMENC_DEVICECONTROL_REWINDING
        Label1.Caption = "Rewinding"
        
        Case WMENC_DEVICECONTROL_UNSTABLE
        Label1.Caption = "Unstable"
        
        Case WMENC_DEVICECONTROL_EJECT
        Label1.Caption = "Eject"
        
        Case WMENC_DEVICECONTROL_ENDOFTAPE
        Label1.Caption = "End of tape"
        bDone = True
        
    End Select
    
 End Sub

Requirements

Reference: Windows Media Encoder

Library: wmenc.exe

See Also