Repository navigation
TimeTextIndicator JSON
This page describes the persisted format of the timeText indicator in a project, a Mixel and templates. For the user guide on editing .vttp by hand, see Time Text JSON.
The indicator is saved in two modes:
-
toJSON(false)is the real Mixel state: it contains the selected reference source (sourceId), the current property values, and the layer size and position. -
toJSON(true)is the template state: it containsmaketinstead ofsizeandpositionInParent; the reference source is not fixed (referenceSourceis written as an empty object).
The layer identifier is built from the plugin uid and the indicator name:
{
"name": "com.velitask.plagin.official.timeText",
"data": {
"properties": {}
}
}Stable parts:
| Part | Value |
|---|---|
| plugin uid | com.velitask.plagin.official |
| indicator name | timeText |
In a real Mixel, the layer size and position 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; properties are shown in the form that the property code writes.
{
"name": "com.velitask.plagin.official.timeText",
"data": {
"size": { "...": "layer size state" },
"positionInParent": { "...": "layer position state" },
"properties": {
"referenceSource": {
"sourceId": { "value": 3 }
},
"font": {"name":"Dialog","style":0,"size":48,"color":{"r":255,"g":255,"b":255,"a":255}},
"textAlign": {"value":4},
"timeZone": {"value":""},
"timeFormat": {"value":"dd.MM.yyyy HH:mm:ss"},
"durationFormat": {"value":"HH:mm:ss"},
"textTemplate": {"template":"Time {curr} / passed {passed}","vars":{"curr":"%s","tzid":"%s","passed":"%s","left":"%s"}}
}
}
}A template uses maket, and referenceSource stays an empty object: when the indicator is added to a project, the runtime picks the source with the longest duration (LongestDurationStrategy).
{
"name": "com.velitask.plagin.official.timeText",
"data": {
"maket": { "preset": "auto" },
"properties": {
"referenceSource": {},
"font": {"name":"Dialog","style":0,"size":48,"color":{"r":255,"g":255,"b":255,"a":255}},
"textAlign": {"value":4},
"timeZone": {"value":""},
"timeFormat": {"value":"dd.MM.yyyy HH:mm:ss"},
"durationFormat": {"value":"HH:mm:ss"},
"textTemplate": {"template":"Time {curr} / passed {passed}","vars":{"curr":"%s","tzid":"%s","passed":"%s","left":"%s"}}
}
}
}An empty timeZone value ("") means the system time zone; in a real state a zone identifier is usually recorded.
| JSON key | Java property | SDK type | User meaning | Default |
|---|---|---|---|---|
referenceSource |
mReferenceSource |
SourceProperty |
The source whose start and end are used to compute {passed} and {left}. |
The source with the longest duration; with no selection, the project period. |
font |
mFont |
FontColorProperty |
Text font and color. |
Dialog, style 0, size 48, white. |
textAlign |
mTextAlign |
TextAlignProperty |
Text alignment in the layer. |
4 (center). Allowed 0..8. |
timeZone |
mTimeZone |
TimeZoneProperty |
The time zone for {curr}. |
The system time zone. |
timeFormat |
mTimeFormat |
StringProperty |
Date and time format (DateTimeFormatter). |
dd.MM.yyyy HH:mm:ss. |
durationFormat |
mDurationFormat |
StringProperty |
Duration format (Duration.format). |
HH:mm:ss. |
textTemplate |
mTemplate |
TextTemplateProperty |
Text with the variables curr, tzid, passed, left. |
The localized Time {curr} / passed {passed}. |
State format:
-
referenceSourcein a real state:{"sourceId":{"value":<id>}}; in a template{}. When reading, thesourceIdkey is optional: without it the binding does not change. -
font: a flat objectname(string),style(number:0plain,1bold,2italic),size(number 1..999) andcolor(r,g,b,a). -
textAlign:{"value":N}, indexes0TOP_LEFT,1TOP_CENTER,2TOP_RIGHT,3CENTER_LEFT,4CENTER,5CENTER_RIGHT,6BOTTOM_LEFT,7BOTTOM_CENTER,8BOTTOM_RIGHT. An out-of-range value is read asCENTER_LEFT. -
timeZone,timeFormat,durationFormat:{"value":"<string>"}. An empty string and a missingvaluemean the default value. An unknown zone identifier is replaced with the system zone. -
textTemplate:templateis a string with variables in curly braces,varsis an object "variable name → format". All four formats are%s, because the values are passed as strings.
The indicator skins (compact, withZone) substitute only textTemplate.template: {curr} and {curr} ({tzid}).
A compact "time left" label in a format with days, time in UTC:
{
"name": "com.velitask.plagin.official.timeText",
"data": {
"maket": { "preset": "auto" },
"properties": {
"referenceSource": {},
"font": {"name":"Dialog","style":1,"size":64,"color":{"r":255,"g":255,"b":255,"a":255}},
"textAlign": {"value":4},
"timeZone": {"value":"UTC"},
"timeFormat": {"value":"HH:mm"},
"durationFormat": {"value":"d 'd' HH:mm:ss"},
"textTemplate": {"template":"{curr} UTC / {left} left","vars":{"curr":"%s","tzid":"%s","passed":"%s","left":"%s"}}
}
}
}Duration.format tokens: d, H, m, s (a doubled token adds a leading zero); literals go in single quotes; negative values are treated as zero. The H token gives the hour within the day (0–23), and days are output by the d token.
-
VelitaskPlagin.getUID()(com.velitask.plagin.official) must not be changed without a migration of saved projects. -
Indicator.getName()(timeText) must not be changed without a migration. - Property names (
referenceSource,font,textAlign,timeZone,timeFormat,durationFormat,textTemplate) must not be renamed without a migration. - The order of properties mostly affects the UI, while loading of the persisted state goes by name; renaming is more dangerous than reordering.
- Template variable names (
curr,tzid,passed,left) are used in savedtemplatestrings, so they must not be renamed either.