Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Runstate change?

Status
Not open for further replies.

trk1616b

MIS
May 25, 2005
20
0
0
US
I've got a video camera hooked up to my computer through a firewire port. I'm trying to play the tape in the camera and encode it on my computer using Windows Media Encoder. I've got everything working, but I cannot capture when it has stopped encoding. I'm using a 'MyEncoer.start' command to start the encoding, but it does not sit there while in encodes....it continues through the rest of the code. I've found some examples, but they're all for VB 6 and not .NET. Below is my code. Anyone know what I need to do in order to capture the runstate change??? Thanks in advance!!

I tried this loop but it doesn't work:
While (Encoder.RunState = WMEncoderLib.WMENC_ENCODER_STATE.WMENC_ENCODER_RUNNING)
System.Threading.Thread.Sleep(2000)
End While

This is the VB 6 sub example, but my code never calls this sub:
Private Sub Encoder_OnStateChange(ByVal enumState As WMEncoderLib.WMENC_ENCODER_STATE)

Select Case enumState
Case WMEncoderLib.WMENC_ENCODER_STATE.WMENC_ENCODER_RUNNING Labeltest.Text = "Running"
Case WMEncoderLib.WMENC_ENCODER_STATE.WMENC_ENCODER_STOPPED
Labeltest.Text = "Stopped"
End Select

End sub
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top