- java.lang.Object
-
- org.praxislive.base.Binding.Adaptor
-
-
Constructor Summary
Constructors Constructor Description Adaptor()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description Binding
getBinding()
Get the Binding this adaptor is attached to.Binding.SyncRate
getSyncRate()
The current SyncRate.protected boolean
getValueIsAdjusting()
Whether the Adaptor is currently actively updating and sending values, eg.boolean
isActive()
Whether this Adaptor is currently active.protected void
onError(List<Value> args)
An optional hook for adaptors to access any error response from a call to send.protected void
onResponse(List<Value> args)
An optional hook for adaptors to access the returned response from a call to send.protected void
send(List<Value> args)
Send the provided values to the Control.void
setActive(boolean active)
Set whether this Adaptor is currently active.void
setSyncRate(Binding.SyncRate syncRate)
Set the SyncRate of the Adaptor.protected void
update()
Optional hook called whenever values have been updated, by a sync call or another Adaptor.protected void
updateBindingConfiguration()
Optional hook called when the Binding configuration has changed.
-
-
-
Method Detail
-
getBinding
public final Binding getBinding()
Get the Binding this adaptor is attached to. The binding provides access to latest values and the ControlInfo.- Returns:
- binding
-
getSyncRate
public final Binding.SyncRate getSyncRate()
The current SyncRate.- Returns:
- syncrate
-
isActive
public final boolean isActive()
Whether this Adaptor is currently active.- Returns:
- active
-
setActive
public final void setActive(boolean active)
Set whether this Adaptor is currently active. By default an Adaptor is inactive. The Binding will not sync unless at least one attached Adaptor is active and has a sync rate above None.- Parameters:
active
-
-
setSyncRate
public final void setSyncRate(Binding.SyncRate syncRate)
Set the SyncRate of the Adaptor. By default an Adaptor has a sync rate of None. The Binding will not sync unless at least one attached Adaptor is active and has a sync rate above None. The highest active sync rate will be used by the binding.- Parameters:
syncRate
-
-
send
protected final void send(List<Value> args)
Send the provided values to the Control. Other attached Adaptors will be immediately updated.- Parameters:
args
-
-
getValueIsAdjusting
protected boolean getValueIsAdjusting()
Whether the Adaptor is currently actively updating and sending values, eg. as a response to user input. The Binding implementation will normally send quiet calls in such cases as the values are expected to be superseded before a reply is received.- Returns:
- value currently being adjuested
-
onResponse
protected void onResponse(List<Value> args)
An optional hook for adaptors to access the returned response from a call to send. This will only be called on the adaptor that initiated the call.- Parameters:
args
- returned values
-
onError
protected void onError(List<Value> args)
An optional hook for adaptors to access any error response from a call to send. This will only be called on the adaptor that initiated the call.- Parameters:
args
- error values
-
updateBindingConfiguration
protected void updateBindingConfiguration()
Optional hook called when the Binding configuration has changed. Eg. new ControlInfo available.
-
update
protected void update()
Optional hook called whenever values have been updated, by a sync call or another Adaptor.
-
-