MIKMIDICommandThrottler

Objective-C

@interface MIKMIDICommandThrottler : NSObject

Swift

class MIKMIDICommandThrottler : NSObject

MIKMIDICommandThrottler is a simple utility class useful for throttling e.g. jog wheel/turntable controls, which otherwise send many messages per revolution.

  • Determine whether a command from a throttled control should be handled or discarded.

    Declaration

    Objective-C

    - (BOOL)shouldPassCommand:(nonnull MIKMIDIChannelVoiceCommand *)command
          forThrottlingFactor:(NSUInteger)factor;

    Swift

    func shouldPass(_ command: MIKMIDIChannelVoiceCommand, forThrottlingFactor factor: UInt) -> Bool

    Parameters

    command

    The command received from the throttled control.

    factor

    The throttling factor to apply. e.g. a value of 20 means that only 1 of every 20 messages should be handled.

    Return Value

    YES if the command should be handled, NO if it should be discarded.

  • Resets the throttle counter for command.

    Declaration

    Objective-C

    - (void)resetThrottlingCountForCommand:
        (nonnull MIKMIDIChannelVoiceCommand *)command;

    Swift

    func resetThrottlingCount(for command: MIKMIDIChannelVoiceCommand)

    Parameters

    command

    The command received from the throttled control.