JS API Reference CommonParameterMixin interface

CommonParameterMixin interface

The mixin base interface for all Parameters providing common functionality and attributes across all types of Parameters.

Signature

export interface CommonParameterMixin 

Properties

changeEvent

read-only

Type: EventSubject<any>

In addition to capturing the events emitted by the Device, you can subscribe to a changeEvent on the Parameter itself, allowing additional, more granular event handling. The parameter uses the same ParameterNotificationSetting as set on the Device.

Example

param.changeEvent.subscribe((value: any) => {
  // the type of the value is dependent on the type of the parameter
});

convertFromNormalizedValue

read-only

Type: ConvertFromNormalizedValueFunction

Parameter specific conversion function to convert a normalized value to a real value see ConvertFromNormalizedValueFunction

Example

// this will convert someValue in the range of (0..1) to a real value according to param's specific conversion function
param.convertFromNormalizedValue(someValue: number);

convertToNormalizedValue

read-only

Type: ConvertToNormalizedValueFunction

Parameter specific conversion function to convert a real value to a normalized see ConvertToNormalizedValueFunction

Example

// this will convert someValue to a normalized value according to param's specific conversion function
param.convertToNormalizedValue(someValue: number);

displayName

read-only

Type: string

The displayName of the parameter

exponent

read-only

Type: number

The exponent of the parameter

id

read-only

Type: ParameterId

The unique id of the parameter

index

read-only

Type: number

The index of the parameter

max

read-only

Type: number

Maximum possible value of the parameter

min

read-only

Type: number

Minimum possible value of the parameter

name

read-only

Type: string

The name of the parameter

normalizedValue

Type: number

The normalized value of the parameter in a range from 0-1

Example

// Update the current parameter value with a normalized value by simply setting the property
param.normalizedValue = 0.8;

notificationSetting

read-only

Type: ParameterNotificationSetting

The notification setting of the parameter for its changeEvent, which will be the same as the ParameterNotificationSetting set on the Device.

steps

read-only

Type: number

The steps of the parameter

type

read-only

Type: ParameterType

The type of the parameter see ParameterType

unit

read-only

Type: string

The unit of the parameter