Class StepperClipControl

All Implemented Interfaces:
PropertyChangeListener, EventListener

public class StepperClipControl extends ClipControl
This is a ClipControl that displays every step in a video clip.
Version:
1.0
Author:
Douglas Brown
  • Constructor Details

    • StepperClipControl

      protected StepperClipControl(VideoClip videoClip)
      Constructs a StepperClipControl object.
      Parameters:
      videoClip - the video clip
  • Method Details

    • play

      public void play()
      Plays the clip.
      Overrides:
      play in class ClipControl
    • stop

      public void stop()
      Stops at the next step.
      Overrides:
      stop in class ClipControl
    • step

      public void step()
      Steps forward one step.
      Overrides:
      step in class ClipControl
    • back

      public void back()
      Steps back one step.
      Overrides:
      back in class ClipControl
    • setStepNumber

      public void setStepNumber(int n0)
      Sets the step number.
      Overrides:
      setStepNumber in class ClipControl
      Parameters:
      n - the desired step number
    • setStepNumberLater

      protected void setStepNumberLater(int frame, int step)
    • setRate

      public void setRate(double newRate)
      Sets the play rate.
      Overrides:
      setRate in class ClipControl
      Parameters:
      newRate - the desired rate
    • getMeanFrameDuration

      public double getMeanFrameDuration()
      Gets the average frame duration in milliseconds (for calculations).
      Specified by:
      getMeanFrameDuration in class ClipControl
      Returns:
      the frame duration in milliseconds
    • setFrameDuration

      public void setFrameDuration(double duration)
      Sets the frame duration.
      Specified by:
      setFrameDuration in class ClipControl
      Parameters:
      duration - the desired frame duration in milliseconds
    • setLooping

      public void setLooping(boolean loops)
      Turns on/off looping.
      Overrides:
      setLooping in class ClipControl
      Parameters:
      loops - true to turn looping on
    • isPlaying

      public boolean isPlaying()
      Gets the playing status.
      Specified by:
      isPlaying in class ClipControl
      Returns:
      true if playing
    • getTime

      public double getTime()
      Gets the current video time in milliseconds measured from step 0.
      Specified by:
      getTime in class ClipControl
      Returns:
      the current time
    • getStepTime

      public double getStepTime(int stepNumber)
      Gets the start time of the specified step measured from step 0.
      Specified by:
      getStepTime in class ClipControl
      Parameters:
      stepNumber - the step number
      Returns:
      the step time
    • propertyChange

      public void propertyChange(PropertyChangeEvent e)
      Responds to property change events.
      Specified by:
      propertyChange in interface PropertyChangeListener
      Overrides:
      propertyChange in class ClipControl
      Parameters:
      e - the property change event
    • getMeasuredRate

      public double getMeasuredRate()
      Description copied from class: ClipControl
      Gets the measured play rate. Default is the set rate. StepperClipControl overrides to report true measured rate.
      Overrides:
      getMeasuredRate in class ClipControl
      Returns:
      the measured rate
    • getLoader

      public static XML.ObjectLoader getLoader()
      Returns an XML.ObjectLoader to save and load data for this class.
      Returns:
      the object loader
    • dispose

      public void dispose()
      Description copied from class: ClipControl
      Empty dispose method.
      Overrides:
      dispose in class ClipControl