jMax IRCAM - Centre Georges Pompidou

Templates



Introduction

The template module actually handle only the template looks up; the actual template instantiation is exactly loading a jmax file (see
the chapter on loading and saving ) and the variable mechanism of templates is exactly the same as the patchers; actually the template is implemented with a patcher, whose arguments are the same of the template (see the chapter on objects).

The template table handle is pretty straighforward: it handle the templateDirectory and the templatePath declarations; two things to note: when a template is access thru a path, its file name is cached: this means that if the file is moved while jMax is still runnig, it will not be found anymore; this choice is due to performance reasons: looking for a file is very expensive compared to loading it.

The other important point: currently there is primitive support to store the text of a template in binary form; this is used now to install protected template from C code, but it can be easily transformed in a template cache; template text caching should speed up quite a lot patch loading, because profiling show that a significant part of the loading time is spent in I/O operations.

Related Files

  • templates.c
  • templates.h