Пример #1
0
 /// <summary>
 /// Uses durations from the specified image to set up the control for indexing.
 /// </summary>
 /// <typeparam name="T">The type of the frame images.</typeparam>
 /// <param name="image">The image whose durations should be used to specify frame and time indexes.</param>
 public void UseTimingsFrom <T>(GifImage <T> image)
 {
     PlaybackTimer.Stop();
     if (image == null)
     {
         durations             = null;
         sectionValues         = null;
         FrameSelector.Maximum = 0;
         TimeSelector.Maximum  = 0;
         FrameLabel.Text       = "";
         Enabled = false;
     }
     else
     {
         durations        = new int[image.Frames.Length];
         sectionValues    = new int[image.Frames.Length + 1];
         sectionValues[0] = 0;
         int accumulatedDuration = 0;
         for (int i = 0; i < image.Frames.Length; i++)
         {
             int duration = image.Frames[i].Duration;
             durations[i]         = duration;
             accumulatedDuration += duration;
             sectionValues[i + 1] = accumulatedDuration;
         }
         FrameSelector.Maximum = image.Frames.Length - 1;
         TimeSelector.Maximum  = image.Duration;
         UpdateLabel();
         Enabled = true;
     }
     TimeSelectorSections.Invalidate();
 }
Пример #2
0
 /// <summary>
 /// Stops seeking through the indexes.
 /// </summary>
 public void Pause()
 {
     PlaybackTimer.Stop();
 }
Пример #3
0
 /// <summary>
 /// Starts seeking through the indexes automatically.
 /// </summary>
 public void Play()
 {
     PlaybackTimer.Start();
 }
Пример #4
0
 public void StopPlaying()
 {
     PlaybackTimer.Stop();
     CurrentTrack          = null;
     LastSwitchedSongEvent = null;
 }
Пример #5
0
 private void StartTimer(double interval)
 {
     PlaybackTimer.Stop();
     PlaybackTimer.Interval = interval;
     PlaybackTimer.Start();
 }