next up previous contents
Next: Creating a machine type Up: Describing your parameters and Previous: Indexing.

   
Param_specs.

Your machine's parameters may be presented to the user in a variety of ways. In the sequencer view, the musician will see each parameter as a column in a tracker-like grid interface. In the signal router view, OCTAL can draw the user a little window (or ``control box'') full of graphical widgets for manipulating the parameters ``live'' in real-time.

In order for OCTAL to be able to do all this, we'll have to tell it a little bit about each parameter. In particular, OCTAL needs to know what they're called; how they should be drawn in the tracker view; what kind of widget to use when opening a control box; a short description of the parameter that can be displayed to the user; and information about the acceptable ranges and default value for the parameter.

There's a structure called param_spec made specially for this purpose. OCTAL will expect an array of these structures, arranged in the same order as listed in the ix_* constants we defined earlier.

We can statically initialize the array like this:

param_spec my_params[] = {

  /* first parameter */
  {    
    my_format_type,
    my_widget_type,
    "short name",
    "a longer description",
    min_value,
    max_value,
    default_value
  },

  /* second parameter */ 
  {
    my_format_type,
    ...
    ... 
    ...
  }
}

With the above syntax, you can build an array of param_spec objects that match your machine's parameters. By describing them abstractly instead of in terms of graphics calls and windows, your machine can remain independent of GUI specifics.

For more specifics about the format types and widget types you can choose from, consult the table in 3.3 (p. [*]).


next up previous contents
Next: Creating a machine type Up: Describing your parameters and Previous: Indexing.
David O'Toole
2000-07-19