Skip to content

FileExtensionIndicator JSON

roosit edited this page Oct 16, 2026 · 1 revision

FileExtensionIndicator JSON

Up | Code | Русский

Purpose

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.

Two save modes

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: contains maket instead of size and positionInParent; fileSource is written as an empty object, and the source is picked when the template is loaded.

Common indicator wrapper

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

Real mixel state

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}
    }
  }
}

Template state

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.

Properties

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:

  • fileSource in the real state: {"sourceId":{"value":<id>}}; {} in a template.
  • font: a flat object with name, style (0 plain, 1 bold, 2 italic), size (1..999; not used when drawing), and color (r, g, b, a). The default size value 48 is always written, but the fitting overrides it.
  • padding: {"value":N}; the range 0..40 limits 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.

Examples

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}
    }
  }
}

Compatibility

  • 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 template thumbnail-undefined.vttp refers 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.

Clone this wiki locally