Section Variables


Measures and meters can be referenced as variables. These are called section variables, and they can provide several kinds of information about the meter or measure. Lua scripts can also be called inline and most will work right out of the box and plugins can also add support but will be on a more case by case basis

Usage

A meter or measure is referenced as a section variable by placing the section name in brackets ([]). The value provided by a section variable can be changed by adding parameters after a colon (:). Multiple parameters are separated by commas (,). Spaces are allowed after a comma.

[SectionName:P1,P2]

Normal or built-in variables take priority over section variables, which means they can be used within section variables. For example: [#Foo#:#Bar#]. (The reverse, such as #[Foo][Bar]#, is not valid.)

Dynamic Variables

Section variables are always dynamic. DynamicVariables=1 will always be needed on a measure or meter section where the variable is used in an option value.

Meter Parameters

None

Section variables for meters have no value without a parameter.

:X, :YExample: [MeterName:X]

The current X or Y position of the meter.

Note: This provides the "real" X or Y value, which is the position of the top-left corner of the meter area. This is always an integer, even if the meter has no X and Y options set, or if the options use formulas, variables or relative positions.

This also means that for a string meter with StringAlign options, the value of [MeterName:X] and [MeterName:Y] may not be the same as the option values.

:W, :HExample: [MeterName:W]

The current width or height of the meter.

Note: This provides the "real" W or H value. This is always an integer, even if the meter has no W and H options set, or if the options use formulas or variables.

Measure Parameters

NoneExample: [MeasureName]

If no parameters are given, the measure's string value is provided.

:Example: [MeasureName:]

If a blank parameter is given, the measure's number value is provided, with up to ten decimal places of precision.

:nExample: [MeasureName:10]

The measure's number value, with the number of decimal places given.

Multiple Parameters: This parameter may be combined with Scale and Percentual.

:/nExample: [MeasureName:/1024]

The measure's number value, scaled by the divisor given.

Multiple Parameters: This parameter may be combined with Decimals and Percentual.

:%Example: [MeasureName:%]

The measure's number value, as a percentual value.

Multiple Parameters: This parameter may be combined with Decimals and Scale.

:MinValue :MaxValueExample: [MeasureName:MaxValue]

The measure's MinValue or MaxValue number value.

Multiple Parameters: This parameter may be combined with Decimals and Scale.

:EscapeRegExpExample: [MeasureName:EscapeRegExp]

The measure's string value will be treated as a PCRE Regular Expression pattern, and all regular expression reserved characters, which are .^$*+?()[{\|, will be "escaped" with \.

:EncodeURLExample: [MeasureName:EncodeURL]

The measure's string value will be URL-Encoded.

:TimestampExample: [MeasureName:Timestamp]

This will only return a value when used with a Time measure. The measure's Windows timestamp value. This will allow you to obtain the numeric value of the Windows timestamp from a Time measure that has a Format option, and won't have the timestamp as the normal number value.