Skip to main content

PluginDynamicCommand Class

Base class for dynamic commands.

public abstract class PluginDynamicCommand : Loupedeck.PluginDynamicAction

Inheritance System.Object → Loupedeck.PluginActionBase<Loupedeck.PluginAction> → Loupedeck.PluginAction → PluginDynamicAction → PluginDynamicCommand

Example​

public class ToggleMuteCommand : PluginDynamicCommand
{
public ToggleMuteCommand()
: base(displayName: "Toggle Mute", description: "Mutes and unmutes system volume", groupName: "Audio")
{
}

protected override void RunCommand(String actionParameter)
{
this.Plugin.ClientApplication.SendKeyboardShortcut(VirtualKeyCode.VolumeMute);
}
}

Remarks​

Inherit this class to create a dynamic command for your plugin. Commands represent discrete actions such as muting audio, starting a recording, or toggling a setting.

Minimal implementation requires overriding RunCommand(string) to handle command execution. Optionally override GetCommandDisplayName(string, PluginImageSize) or GetCommandImage(string, PluginImageSize) to provide dynamic display names or action icons.

Constructors​

PluginDynamicCommand(DeviceType) Constructor​

Initializes a new instance of the PluginDynamicCommand class.

public PluginDynamicCommand(Loupedeck.DeviceType supportedDevices=Loupedeck.DeviceType.All);

Parameters​

supportedDevices DeviceType

The device types supported by this command. 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.

PluginDynamicCommand(string, string, string, DeviceType) Constructor​

Initializes a new instance of the PluginDynamicCommand class with display name and group name.

public PluginDynamicCommand(string displayName, string description, string groupName, Loupedeck.DeviceType supportedDevices=Loupedeck.DeviceType.All);

Parameters​

displayName System.String

The display name shown for this command in the user interface.

description System.String

A brief explanation of what this command does.

groupName System.String

The group name used to organize this command in the user interface.

supportedDevices DeviceType

The device types supported by this command. 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.