PluginDynamicAdjustment Class
Base class for dynamic adjustments.
public abstract class PluginDynamicAdjustment : Loupedeck.PluginDynamicAction
Inheritance System.Object → Loupedeck.PluginActionBase<Loupedeck.PluginAction> → Loupedeck.PluginAction → PluginDynamicAction → PluginDynamicAdjustment
Example
public class CounterAdjustment : PluginDynamicAdjustment
{
private Int32 _counter = 0;
public CounterAdjustment()
: base(displayName: "Counter", description: "Counts rotation ticks", groupName: "Adjustments", hasReset: true)
{
}
protected override void ApplyAdjustment(String actionParameter, Int32 diff)
{
this._counter += diff;
this.AdjustmentValueChanged();
}
protected override void RunCommand(String actionParameter)
{
this._counter = 0;
this.AdjustmentValueChanged();
}
protected override String GetAdjustmentValue(String actionParameter) => this._counter.ToString();
}
Remarks
Inherit this class to create a dynamic adjustment for your plugin. Override ApplyAdjustment(string, int) to implement the adjustment's behavior, and optionally override GetCommandImage(string, PluginImageSize) and GetAdjustmentDisplayName(string, PluginImageSize) to customize the adjustment's appearance.
Minimal implementation requires overriding ApplyAdjustment(string, int) to handle rotation events and GetAdjustmentValue(string) to return the current value for display.
Constructors
PluginDynamicAdjustment(bool, DeviceType) Constructor
Initializes a new instance of the PluginDynamicAdjustment class.
public PluginDynamicAdjustment(bool hasReset, Loupedeck.DeviceType supportedDevices=Loupedeck.DeviceType.All);
Parameters
hasReset System.Boolean
Indicates whether this adjustment supports reset functionality.
supportedDevices DeviceType
The device types supported by this adjustment. Set to All to support all devices, or combine specific device types using bitwise OR.
Remarks
Use this constructor when the display name, description, or group name are not known at construction time.
PluginDynamicAdjustment(string, string, string, bool, DeviceType) Constructor
Initializes a new instance of the PluginDynamicAdjustment class with display name and group name.
public PluginDynamicAdjustment(string displayName, string description, string groupName, bool hasReset, Loupedeck.DeviceType supportedDevices=Loupedeck.DeviceType.All);
Parameters
displayName System.String
The display name shown for this adjustment in the user interface.
description System.String
A brief explanation of what this adjustment does.
groupName System.String
The group name used to organize this adjustment in the user interface.
hasReset System.Boolean
Indicates whether this adjustment supports reset functionality.
supportedDevices DeviceType
The device types supported by this adjustment. Set to All to support all devices, or combine specific device types using bitwise OR.
Remarks
Use this constructor when the display name, description, and group name are known at construction time.
Methods
PluginDynamicAdjustment.AdjustmentValueChanged(double) Method
Notifies the Logi Plugin Service that the adjustment value has changed.
protected void AdjustmentValueChanged(double value);
Parameters
value System.Double
The new adjustment value.
Remarks
Call this method after updating the adjustment's value to refresh the display on the device and in the user interface.
PluginDynamicAdjustment.AdjustmentValueChanged(string, double) Method
Notifies the Logi Plugin Service that the adjustment value has changed.
protected void AdjustmentValueChanged(string actionParameter, double value);
Parameters
actionParameter System.String
The parameter name identifying which variation of the adjustment has changed, or null if this action
has no parameters.
value System.Double
The new adjustment value.
Remarks
Call this method after updating the adjustment's value to refresh the display on the device and in the user interface.
PluginDynamicAdjustment.ApplyAdjustment(string, int) Method
Called when the user adjusts this adjustment.
protected virtual void ApplyAdjustment(string actionParameter, int diff);
Parameters
actionParameter System.String
The parameter name identifying which variation of the action to execute, or null if this action has
no parameters.
diff System.Int32
The adjustment amount. Positive values indicate an increase, negative values indicate a decrease.
Example
protected override void ApplyAdjustment(String actionParameter, Int32 diff)
{
// Update internal state based on adjustment
this._counter += diff;
// Notify that the value changed
this.AdjustmentValueChanged();
}
Remarks
Override this method to implement the adjustment's behavior.
PluginDynamicAdjustment.GetAdjustmentDisplayName(string, PluginImageSize) Method
Gets the display name for this adjustment.
protected virtual string GetAdjustmentDisplayName(string actionParameter, Loupedeck.PluginImageSize imageSize);
Parameters
actionParameter System.String
The parameter name identifying which variation of the action to display, or null if this action has
no parameters.
imageSize PluginImageSize
The size of the image being rendered, which may affect the display name.
Returns
System.String
The display name to show for this adjustment, or null to use the default display name.
Remarks
Override this method to provide dynamic display names that change based on the adjustment's state.
PluginDynamicAdjustment.GetAdjustmentImage(string, PluginImageSize) Method
Gets the action icon image for this adjustment.
protected virtual Loupedeck.BitmapImage GetAdjustmentImage(string actionParameter, Loupedeck.PluginImageSize imageSize);
Parameters
actionParameter System.String
The parameter name identifying which variation of the action to display, or null if this action has
no parameters.
imageSize PluginImageSize
The size of the image to generate.
Returns
Loupedeck.BitmapImage
A Loupedeck.BitmapImage representing the adjustment's icon, or null if no custom image is provided.
Remarks
Override this method to provide dynamic images that change based on the adjustment's state.
PluginDynamicAdjustment.GetAdjustmentValue(string) Method
Gets the current value of the adjustment.
protected virtual string GetAdjustmentValue(string actionParameter);
Parameters
actionParameter System.String
The parameter name identifying which variation of the action to get, or null if this action has no
parameters.
Returns
System.String
The adjustment value.
Example
protected override String GetAdjustmentValue(String actionParameter)
{
return this._counter.ToString();
}
Remarks
Override this method to return a string representation of the adjustment's current value. This value can be displayed on the device and in the user interface.