next up previous contents
Next: Memory allocation Up: Setting up your callbacks Previous: ox_desc: giving text feedback

   
ox_track: when the user adds or subtracts tracks

void ox_track(machine* m, int change)

The section on ox_update() contained a discussion of how your machines can recieve multiple tracks full of parameters. But how do you know when the user adds or deletes a track? (Keep in mind that the tracks are arranged in a stack, where insertions and deletions can only occur at the righmost end.)

When the user adds or deletes a track, OCTAL will set m->num_tracks to the new value, and then it will signal you by calling ox_track(). If the user has added a track, you'll recieve the value +1. If the user has removed a track, you'll recieve -1.

Do whatever memory allocation/deallocation or initialization you may need to do in these cases. See the next section for more information.



David O'Toole
2000-07-19