Enumerations¶
These mirror TouchOSC's own vocabulary and are written verbatim into the file. Anywhere one is accepted, the equivalent plain string works too.
Structure¶
ControlType ¶
Bases: _StrEnum
The type attribute of a <node> element.
Source code in src/py2tosc/enums.py
PropertyType ¶
Bases: _StrEnum
The type attribute of a <property> element.
FRAME and COLOR are the two composite types: their <value> holds four
named child elements rather than text.
Source code in src/py2tosc/enums.py
Messages¶
PartialType ¶
Conversion ¶
TriggerCondition ¶
MidiType ¶
Bases: _StrEnum
The MIDI status byte a message carries.
These eight are the whole of it, and are exactly what the editor's own Type menu offers on a MIDI message. Four were already corroborated by layouts the editor wrote; the menu confirms the other four, which until then had only been inferred from the MIDI specification.
The manual's scripting reference names a longer MIDIMessageType with nine
more -- CLOCK, START, STOP, CONTINUE, SONGPOSITION, SONGSELECT,
QUARTERFRAME, ACTIVESENSING, SYSTEMRESET. Those belong to sendMIDI
in a script, which is a different thing from a message binding: the editor
will not store one on a control, so they are deliberately absent here. A
layout cannot express "send MIDI Start on press" as a binding; it takes a
script.
Source code in src/py2tosc/enums.py
GamepadInput ¶
Bases: _StrEnum
The button or axis a GamepadMessage binds to.
All twenty-one appear in gamepad.tosc, the example TouchOSC ships, so
every spelling here is one the editor wrote.
Source code in src/py2tosc/enums.py
Property values¶
The properties below hold a number, and these name the numbers. They are IntEnum, so they are interchangeable with the bare integers in both directions -- control.shape = 2 and control.shape = Shape.CIRCLE produce the same file, and a layout written before these existed compares equal to them on load.
Worth knowing that TouchOSC does not number them consistently. shape, textAlignH and textAlignV count from 1; every other property here counts from 0. The manual lists the names in order without numbers, so reading it alone and counting from zero gets those three wrong. The values here come from the 45 layouts in the corpus, and tests/test_enums.py checks that no file holds a number these cannot name.
Shape ¶
Bases: _IntEnum
The shape property. Numbered from 1.
All six are corroborated by files the TouchOSC editor wrote. The bundled
examples cover four, HEXAGON most convincingly, by the 119 hexagonal
buttons in hexkeys.tosc. DIAMOND and PENTAGON appear nowhere in them
and were settled by drawing one of each in the editor; that file is
tests/data/enums.tosc, where every control is named after the shape it
was given, so the mapping is checked rather than asserted.
Source code in src/py2tosc/enums.py
AlignH ¶
AlignV ¶
Bases: _IntEnum
The textAlignV property. Numbered from 1.
All three are corroborated. The bundled examples write only TOP and
MIDDLE; BOTTOM was settled by a label drawn in the editor, in
tests/data/enums.tosc.
Source code in src/py2tosc/enums.py
Orientation ¶
Bases: _IntEnum
The orientation property: which way a control faces. Numbered from 0.
All four are written by the corpus. A RADIO is never NORTH, since a
radio runs horizontally or vertically.
Source code in src/py2tosc/enums.py
ButtonType ¶
Bases: _IntEnum
The buttonType property: when a button reports a press. Numbered from 0.
All three are written by the corpus.
Source code in src/py2tosc/enums.py
OutlineStyle ¶
Bases: _IntEnum
The outlineStyle property. Numbered from 0.
All three are written by the corpus, CORNERS most often.
Source code in src/py2tosc/enums.py
CursorDisplay ¶
Bases: _IntEnum
The cursorDisplay and barDisplay properties. Numbered from 0.
All three are corroborated. The bundled examples write only ALWAYS and
ACTIVE; INACTIVE was settled by a fader drawn in the editor, in
tests/data/enums.tosc, which carries it on barDisplay.
Source code in src/py2tosc/enums.py
Font ¶
Response ¶
Bases: _IntEnum
The response property: how a drag maps to a value. Numbered from 0.
Both are written by the corpus.
Source code in src/py2tosc/enums.py
RadioType ¶
PointerPriority ¶
Bases: _IntEnum
The pointerPriority property. Numbered from 0.
Both are written by the corpus, OLDEST almost always.