Repository navigation
SliderIndicator JSON
This page describes the persisted format of the slider indicator in a project, in Mixel, and in templates. For the user guide on writing .vttp files by hand, see Slider JSON.
The slider is a controller with no image of its own; all its properties are numbers and option indexes. The slider declares no figures.
The indicator is saved in two modes:
-
toJSON(false)- the real Mixel state: the current property values, and the size and position of the layer. -
toJSON(true)- the template state: the same property values plusmaket. The slider has no sensors or sources that a template would need to clear, so the property keys are the same in both modes.
The layer identifier is built from the plugin uid and the indicator name:
{
"name": "com.velitask.plagin.official.slider",
"data": {
"properties": {}
}
}Stable parts:
| Part | Value |
|---|---|
| plugin uid | com.velitask.plagin.official |
| indicator name | slider |
In a real Mixel, the runtime stores the layer geometry next to properties: size, position, and the link to the parent. The exact shape of the State fields depends on the current runtime, so an abbreviated structure is shown below. How the nested indicators of the slider are stored is decided by the runtime and is not described in the plugin code.
{
"name": "com.velitask.plagin.official.slider",
"data": {
"size": { "...": "layer size state" },
"positionInParent": { "...": "layer position state" },
"properties": {
"sliderProject": {},
"slideDuration": { "value": 15 },
"pauseDuration": { "value": 0 },
"timeMode": { "value": 0 },
"appearanceIn": { "value": 0 },
"appearanceOut": { "value": 0 },
"appearanceDuration": { "value": 1.0 },
"disappearanceDuration": { "value": 1.0 },
"pointX": { "value": 960 },
"pointY": { "value": 540 }
}
}
}A template adds maket. The slider does not override defineMaket(...), so the default layout is used; for the shape of maket, see the general documentation on makets.
{
"name": "com.velitask.plagin.official.slider",
"data": {
"maket": { "preset": "auto" },
"properties": {
"sliderProject": {},
"slideDuration": { "value": 15 },
"pauseDuration": { "value": 0 },
"timeMode": { "value": 0 },
"appearanceIn": { "value": 0 },
"appearanceOut": { "value": 0 },
"appearanceDuration": { "value": 1.0 },
"disappearanceDuration": { "value": 1.0 },
"pointX": { "value": 960 },
"pointY": { "value": 540 }
}
}
}The row order matches defineProperties().
| JSON key | Java property | SDK type | User meaning | Default | Allowed values |
|---|---|---|---|---|---|
sliderProject |
mProjectAccess |
VideoSourceProperty (hidden, setVisible(false)) |
Internal access to the project; not shown to the user. | {} |
Always {}: toJSON returns an empty object, fromJSON reads nothing. |
slideDuration |
mSlideDuration |
IntegerSpinnerProperty |
"Slide duration, s". | 15 |
Integer; no range is set in the code. |
pauseDuration |
mPauseDuration |
IntegerSpinnerProperty |
"Min pause, s". | 0 |
Integer; no range is set in the code. |
timeMode |
mTimeMode |
EnumArrayProperty<SliderTimeMode> |
"Time mode". | 0 |
0 PARENT ("Parent speed"), 1 FROZEN ("Freeze frame"), 2 REAL ("Real speed"). |
appearanceIn |
mAppearanceIn |
EnumArrayProperty<SliderAppearanceIn> |
"Appearance". | 0 |
0 NONE, 1 FADE, 2 FROM_LEFT, 3 FROM_RIGHT, 4 FROM_TOP, 5 FROM_BOTTOM, 6 FROM_POINT. |
appearanceOut |
mAppearanceOut |
EnumArrayProperty<SliderAppearanceOut> |
"Disappearance". | 0 |
0 NONE, 1 FADE, 2 TO_LEFT, 3 TO_RIGHT, 4 TO_TOP, 5 TO_BOTTOM, 6 TO_POINT. |
appearanceDuration |
mAppearanceDuration |
DoubleSpinnerProperty |
"Appearance, s". | 1.0 |
A number >= 0.0; spinner step 0.1. |
disappearanceDuration |
mDisappearanceDuration |
DoubleSpinnerProperty |
"Disappearance, s". | 1.0 |
A number >= 0.0; spinner step 0.1. |
pointX |
mPointX |
IntegerSpinnerProperty |
"Point X". | 960 |
Integer; base pixels of the parent. |
pointY |
mPointY |
IntegerSpinnerProperty |
"Point Y". | 540 |
Integer; base pixels of the parent. |
The value format is defined by the SDK states:
-
IntegerSpinnerProperty->{"value": <int>}(IntegerState); -
DoubleSpinnerProperty->{"value": <double>}(DoubleState); -
EnumArrayProperty->{"value": <ordinal of the constant>}(IntegerState). The ordinal is read, not the name; an invalid ordinal gives the first constant.
Nested types: SliderTimeMode, SliderAppearanceIn, SliderAppearanceOut.
A slider: 10 seconds per slide, a 2-second pause, real speed, entering from the left and leaving to the right in 0.5 seconds:
{
"name": "com.velitask.plagin.official.slider",
"data": {
"maket": { "preset": "auto" },
"properties": {
"sliderProject": {},
"slideDuration": { "value": 10 },
"pauseDuration": { "value": 2 },
"timeMode": { "value": 2 },
"appearanceIn": { "value": 2 },
"appearanceOut": { "value": 3 },
"appearanceDuration": { "value": 0.5 },
"disappearanceDuration": { "value": 0.5 },
"pointX": { "value": 960 },
"pointY": { "value": 540 }
}
}
}-
VelitaskPlagin.getUID()(com.velitask.plagin.official) must not be changed without migrating saved projects. -
Indicator.getName()(slider) must not be changed without a migration. - Property names (
sliderProject,slideDuration,pauseDuration,timeMode,appearanceIn,appearanceOut,appearanceDuration,disappearanceDuration,pointX,pointY) must not be renamed without a migration. - The ordinals of the constants of
SliderTimeMode,SliderAppearanceIn, andSliderAppearanceOutare saved in files: the order of the constants in the enum must not be changed. - The property order mostly affects the UI, while persisted state is loaded by name; renaming is more dangerous than reordering.