protected virtual void OnTick(object o, TickArgs args) { long currentTime = args.CurrentTime; float currentposition = args.CurrentPosition; long streamLength = args.StreamLength; //Console.WriteLine ("Current Time:{0}\n Length:{1}\n",currentTime, streamLength); if (length != streamLength) { length = streamLength; slength = TimeString.MSecondsToSecondsString(length); } if (InSegment()) { currentTime -= segmentStartTime; currentposition = (float)currentTime / (float)(segmentStopTime - segmentStartTime); slength = TimeString.MSecondsToMSecondsString(segmentStopTime - segmentStartTime); } timelabel.Text = TimeString.MSecondsToMSecondsString(currentTime) + "/" + slength; timescale.Value = currentposition; if (Tick != null) { Tick(o, args.CurrentTime, args.StreamLength, args.CurrentPosition, args.Seekable); } }
public void CloseActualSegment() { closebutton.Hide(); segmentStartTime = 0; segmentStopTime = 0; SetScaleValue(SCALE_FPS); //timescale.Sensitive = true; slength = TimeString.MSecondsToSecondsString(length); SegmentClosedEvent(); player.CancelProgramedStop(); }
public void CloseActualSegment() { closebutton.Hide(); segmentStartTime = 0; segmentStopTime = 0; vscale1.Value = 25; //timescale.Sensitive = true; slength = TimeString.MSecondsToSecondsString(length); if (SegmentClosedEvent != null) { SegmentClosedEvent(); } player.CancelProgramedStop(); }
private void SeekFromTimescale(double pos) { if (InSegment()) { long seekPos = segmentStartTime + (long)(pos * (segmentStopTime - segmentStartTime)); player.SeekInSegment(seekPos, GetRateFromScale()); timelabel.Text = TimeString.MSecondsToSecondsString(seekPos) + "/" + TimeString.MSecondsToSecondsString(segmentStopTime - segmentStartTime); } else { player.Position = pos; timelabel.Text = TimeString.MSecondsToSecondsString(player.CurrentTime) + "/" + slength; Rate = 1; } }
protected virtual void OnTick(int ellapsedTime) { timelabel.Text = "Time: " + TimeString.MSecondsToSecondsString(CurrentTime); }