I'm in the middle of writing an app to control an eye-tracker using the SDK from the manufacturer. I have a form with a windows media player control on it.
What needs to happen is that there's a countdown (displayed on a label) as to when the video will play. On zero the video should start playing the avi file and the eye tracker should begin collecting gaze data.
My questions are, which of these would be better to use (or are they both the same performance wise) and secondly, is the slight pause as the video file loads in media player avoidable so that it starts right on zero?
VB Code:
Private Sub MediaPlayer_StateChange(ByVal sender As Object, ByVal e As AxWMPLib._WMPOCXEvents_PlayStateChangeEvent) _ Handles mPlayer.PlayStateChange If mPlayer.playState = WMPLib.WMPPlayState.wmppsPlaying Then 'Begin eye tracking here??? End If End Sub
Or:
VB Code:
Private Sub Timer1_Tick(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Timer1.Tick intCount -= 1 If Not intCount = 0 Then Me.lblCount.Text = "Showing in: " & intCount.ToString Else Timer1.Enabled = False Me.lblCount.Visible = False 'Show video: mPlayer.URL = Application.StartupPath & "\Cases\JEPIFWEJ_LKL003.avi" 'Or begin eye tracking here ??? End If End Sub




Reply With Quote