Node instances are physical manifestations of node classes. A node instance
has the following functions:
- It can generate messages. An instance can create
a compound message. For example, an instance of the hardware class can create
a message from a stream of bytes sent by a sound card. The hardware instance
collects bytes until an entire compound message arrives. At this point,
it has a complete compound message ready for further processing.
- It can be linked to another instance. Compound
messages travel from one instance to another. The link tells the instance
where to send the message, if it decides to send it at all.
- It can send a message to another instance. The
link tells the instance where to send the message. Note that the instance
can decide at run-time whether to send the message. For example, an instance
that performs filtering can decide to forward messages that fit a certain
criteria. Messages that are not forwarded are lost.
- It can be configured. An application can send
configuration data to a particular instance at any time. The class determines
whether configuration data is accepted, but the instance processes the data.
Typically, the configuration data changes some of the parameters of the
instance. For example, the filter instance (mentioned in the previous list
item) can accept data that changes the filter criteria. Another example
is an instance that can accept actual machine language instructions and
execute them whenever a message arrives. This feature would make that class
very powerful, and very dangerous.
- It can be identified with a unique number. This
32-bit number is called the instance number and it is used internally as
a 16:16 pointer to the instance data. When another driver or an application
wishes to reference a particular instance, it uses the instance number.
RTMIDI comes with pre-defined classes. Each of these is discussed in detail
in Pre-defined Classes.
[Back]
[Next]