Class Trigger.Timer

java.lang.Object
org.praxislive.code.userapi.Trigger.Timer
Enclosing class:
Trigger

public static final class Trigger.Timer extends Object
A timer used for scheduling one-off or repeat invocations of a Trigger. Use Trigger.timer() to access the timer for a trigger.
  • Method Details

    • isActive

      public boolean isActive()
      Check whether this timer is active, with either a one-shot or repeat event scheduled.
      Returns:
      scheduled
    • isRepeat

      public boolean isRepeat()
      Check whether this timer is active and set to repeat.
      Returns:
      active on repeat
    • repeat

      public Trigger.Timer repeat(double seconds)
      Set the timer to trigger on repeat at the provided rate. If the timer is not currently active on repeat, the start time will be set to the current time. If the timer is already active on repeat, the previous trigger time will continue to be the start time. Any scheduled one-off event will be cancelled.
      Parameters:
      seconds - period of timer in seconds
      Returns:
      this for chaining
    • schedule

      public Trigger.Timer schedule(double seconds)
      Schedule a one-off trigger after the provided delay. Any repeat schedule will be cancelled.
      Parameters:
      seconds - timer delay in seconds
      Returns:
      this for chaining
    • stop

      public Trigger.Timer stop()
      Stop the timer.
      Returns:
      this for chaining