Class ParameterValueEvent.Before

java.lang.Object
dev.turboism.sdk.event.cubism.ParameterValueEvent.Before
All Implemented Interfaces:
ParameterValueEvent, EventBus.TurboismEvent, TurboismEvent
Enclosing interface:
ParameterValueEvent

public static final class ParameterValueEvent.Before extends Object implements ParameterValueEvent
Synchronous state published before the host write.

Subscribers may replace the current candidate. The Runtime validates and checkpoints each subscriber's change.

  • Constructor Details

    • Before

      public Before(Parameter parameter, float requestedValue, float value)
  • Method Details

    • openCallback

      public static ParameterValueEvent.Before.Callback openCallback(Parameter parameter, float requestedValue, float value)
      Opens one Runtime-controlled callback scope.

      Each subscriber receives a distinct event instance. The candidate is mutable only on the opening thread and only until the returned scope is closed, so retaining the event cannot mutate a later host operation.

      Parameters:
      parameter - detached parameter projection for the operation
      requestedValue - value originally requested by the caller
      value - current valid candidate before this subscriber
      Returns:
      the callback scope and its event
    • parameter

      public Parameter parameter()
      Specified by:
      parameter in interface ParameterValueEvent
      Returns:
      the parameter participating in the operation
    • requestedValue

      public float requestedValue()
      Returns:
      the value originally requested before any subscriber transformation
    • value

      public float value()
      Returns:
      the current candidate value
    • setValue

      public void setValue(float value)
      Replaces the current candidate value for this callback.

      The Runtime validates the candidate after the subscriber returns; non-finite values are discarded without changing the preceding valid candidate.

      Parameters:
      value - replacement candidate