Templates Engine

:!: do not translate

Usine includes a powerful Templates Engine. To manipulate and create you own templates you have to understand how work’s the Internal Messages Language (IML).

To have an idea of how it works, start to open the Usine console (Windows/Show Console).

Then open a patch and drag&drop a file.

You will see several lines added in the console, something like

image278.jpg

If you now try to create a wire on the patch, you will see in the console :

image279.jpg

Those values are interpreted by the template engine to offer several choices to user after a wire creation or what to do with a dropped file.

In the folder Templates you will find lots of examples (files *.txt) that you can easily adapt to you own purpose like

Horizontal Fader   // the name displayed
*     // file name ext ('wav', 'usr', etc...)
1     // input or output? none=0,in=1,out=2
3     // terminal flowtype
1 5 6 // terminal display flowtype
*     // terminal name can be '*' or "any string"
1     // are dropping something on a wire? 0=no, 1=yes
xxx   // source module ID filter.  -1 or blank if no filter 

SET_TARGET_PATCH SENDER_PATCH  
CREATE_MODULE fader1 3 MOUSE_X MOUSE_Y
CREATE_LINK fader1 fader SRC_MODULE SRC_TERM_NAME
SET_VALUE fader1 fader SRC_VALUE
SET_VALUE fader1 min SRC_MIN
SET_VALUE fader1 max SRC_MAX
SET_STRING_VALUE fader1 symbol SRC_SYMBOL
SET_STRING_VALUE fader1 caption SRC_TERM_NAME
SET_VALUE fader1 prec  SRC_PRECISION_INDEX
SET_VALUE fader1 scale SRC_SCALE
RENAME_MODULE fader1

Flow Type

The terminal flowtype can have the following values:

  • ftNone=0,
  • ftPCM=1,
  • ftInternText=2,
  • ftData=3,
  • ftMIDI=4,
  • ftArray=5,
  • ftUser=6,
  • ftEvtText=7,
  • ftPointerBitMap=8,
  • ftByte=9,
  • ftMatrix=10,
  • ftPointer=11,
  • ftColor=12,
  • ftOther=maxInt

Display FlowType

The terminal display flowtype can have the following values:

  • ptTextField=0,
  • ptChooseColor=1,
  • ptMidi=2,
  • ptGainFader=3,
  • ptAudio=4,
  • ptDataField=5,
  • ptDataFader=6,
  • ptButton=7,
  • ptListBox=8,
  • ptSwitch=9,
  • ptArray=10,
  • ptIpAddress=11,
  • ptSmpte=12,
  • ptMidiNoteFader=13,
  • ptPointerBitMap=14,
  • ptPointer=15,
  • ptOther=maxint

Example

In the templates folder, you will find default patch files used in Usine. You can modify, adapt those files to your needs.

manual/guide/template_engine.txt · Last modified: 2013/04/19 02:21 (external edit)