Ejemplo n.º 1
0
        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);
            }
        }
Ejemplo n.º 2
0
 public void CloseActualSegment()
 {
     closebutton.Hide();
     segmentStartTime = 0;
     segmentStopTime  = 0;
     SetScaleValue(SCALE_FPS);
     //timescale.Sensitive = true;
     slength = TimeString.MSecondsToSecondsString(length);
     SegmentClosedEvent();
     player.CancelProgramedStop();
 }
Ejemplo n.º 3
0
 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();
 }
Ejemplo n.º 4
0
 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;
     }
 }
Ejemplo n.º 5
0
 protected virtual void OnTick(int ellapsedTime)
 {
     timelabel.Text = "Time: " + TimeString.MSecondsToSecondsString(CurrentTime);
 }