Repository navigation
FileExtensionIndicator JSON
This page describes the persisted format of the fileExtension indicator in a project, in Mixel, and in templates. For the user guide on writing .vttp files by hand, see File extension JSON.
The indicator is saved in two modes:
-
toJSON(false)- the real Mixel state: contains the selected file source (sourceId), the current property values, and the size and position of the layer. -
toJSON(true)- the template state: containsmaketinstead ofsizeandpositionInParent;fileSourceis written as an empty object, and the source is picked when the template is loaded.
The layer identifier is built from the plugin uid and the indicator name:
{
"name": "com.velitask.plagin.official.fileExtension",
"data": {
"properties": {}
}
}Stable parts:
| Part | Value |
|---|---|
| plugin uid | com.velitask.plagin.official |
| indicator name | fileExtension |
In a real Mixel, the size and position of the layer are stored next to properties. The exact shape of the State fields depends on the current runtime, so an abbreviated structure is shown for them.
{
"name": "com.velitask.plagin.official.fileExtension",
"data": {
"size": { "...": "layer size state" },
"positionInParent": { "...": "layer position state" },
"properties": {
"fileSource": {
"sourceId": { "value": 7 }
},
"font": {"name":"Dialog","style":0,"size":48,"color":{"r":224,"g":224,"b":224,"a":255}},
"padding": {"value":12}
}
}
}The template is stretched over the whole canvas (preset: fill) and does not fix the source: when the template is applied, fileSource is bound to the player's source (see PlayerSourceStrategy). This is how the template thumbnail-undefined.vttp is used.
{
"name": "com.velitask.plagin.official.fileExtension",
"data": {
"maket": { "preset": "fill" },
"properties": {
"fileSource": {},
"font": {"name":"Dialog","style":0,"size":48,"color":{"r":224,"g":224,"b":224,"a":255}},
"padding": {"value":12}
}
}
}A minimal file with only a maket is also valid, as in the bundled template: missing properties take their default values.
| JSON key | Java property | SDK type | User meaning | Default |
|---|---|---|---|---|
fileSource |
mSource |
FileSourceProperty |
The file source whose extension is drawn. | The player's source, otherwise the first one that fits by time. |
font |
mFont |
FontColorProperty |
Font name, style, and color; the size is fitted automatically. |
Dialog, style 0, color E0E0E0 (224,224,224). |
padding |
mPadding |
IntegerSliderProperty |
Padding from the layer edges as a percentage of the smaller side. |
12. Range 0..40. |
State formats:
-
fileSourcein the real state:{"sourceId":{"value":<id>}};{}in a template. -
font: a flat object withname,style(0plain,1bold,2italic),size(1..999; not used when drawing), andcolor(r,g,b,a). The default size value 48 is always written, but the fitting overrides it. -
padding:{"value":N}; the range0..40limits only the input in the panel: when read from JSON the value is not checked, so too large a padding (the area for the text disappears) leads to an empty layer.
Large text in a light color with a small padding:
{
"name": "com.velitask.plagin.official.fileExtension",
"data": {
"maket": { "preset": "fill" },
"properties": {
"fileSource": {},
"font": {"name":"Dialog","style":1,"size":48,"color":{"r":255,"g":255,"b":255,"a":255}},
"padding": {"value":5}
}
}
}-
VelitaskPlagin.getUID()(com.velitask.plagin.official) must not be changed without migrating saved projects and preview templates. -
Indicator.getName()(fileExtension) must not be changed without a migration: the bundled templatethumbnail-undefined.vttprefers to it. - Property names (
fileSource,font,padding) must not be renamed without a migration. - The property order mostly affects the UI, while persisted state is loaded by name; renaming is more dangerous than reordering.