DirectOutput
DirectOutput framework R2 for virtual pinball cabinets.
|
Effects are the parts which are connecting the Table and its TableElelement objects to the Toy objects in the Cabinet object. While toys are thought to be relatively stupid and just capable of doing a few simple things (e.g. set a RGB LED to a specific color), effects should do the more complex operations (e.g. dimming the color of a LED from one color to another).
Effects are triggered by TableElement objects (e.g. a switch or a lamp) changing its state or value and also by the Table itself when the Table is started.
DOF contains two types of effects:
Effects can be chained resp. stacked to achive more complex behaviour than the standard behaviour of effects.
Effect effects (effects which troger other effects) are used for chaining and any number of effects can be chained. The last effect in a chain of effects is always a toy effect which controls one or several instances of a toy objects.
Example 1
In this example, the first effect is a delay effect (2), which will forward the received trigger signal (1) from the table element after a specified delay. The output of the delay effect (2) triggers a first blink effect (3) which a long blink period. The output of the first blink effect (3) triggers a second blink effect (4) with a much short blink period. This will create short blinks within the long blinks of the first blink effect (3). Finnaly the output of the second blink effect (4) triggers the finaly toy effect, in this case a RGBAFadeOnOff effect (5) which will fade in and out the led depending on the received input signal (4).
Example 2
In the second example, a short trigger pluse from a table element (1) triggers a duration effect (2). The output of the duration effect (2) will trigger a blink effect (3). This will create blinking for the specified duration whenever the first effect in the chain receives a trigger signal. The finaly RGBAFadeOnOff effect (4) will fade in and out the color of the target toy, in this case a RGB-Led, depending on the output signal of the previous toy (3). So finnaly, we get a fading blinking for the duration specified in the second effect, whenever a trigger pluse is received by the effect chain.
Please read the page on Built in Effects for details and config samples on the various effect classes available in the framework.
The DirectOutput framework can easily be extended to support your own custom effects.
All effects must implement the _IEffect__ interface so they are recognized by DOF as effects and must have a globaly unique name (not only within the namespace).
Depending on the the of effect you want to create, it is best if you inherit one of the abstract effect base classes for your implementation. These base classes take care of all the basic tasks for the effects.