| Contents |
|
Next |
The system's output pins provide 3 items of information:
Each of these has a True/False answer. These conditions can be used to control switches, visibility of controls or panels, and list selections. DHRC2 and DHRC2A each provide outputs for "Registered?" and "In Demo Period?". This ensures that a valid check can be made despite the many varied ways that different VST hosts handle the opening and closing of the DSP and GUI sides of a VST, and the communication between the 2 sides. So, we end up with 5 outputs for our 3 items of information:
These 5 outputs need to be combined to control access to the VST or to specific features. For this, we use the logical operations of AND, OR, and NOT. The 3 logical operations work like this:
The component modules of the DH_RegControl system work across both the GUI and DSP sides of the VST, so some of the logical outputs are GUI pins of type Bool (black on blue background), which can be either True or False, and some are voltage pins (dark blue on gray background), for which a positive voltage means True, and 0 means False. Bool values can be logically combined using DH_BooleanAnd, DH_BooleanOr, and DH_BooleanNot. Voltages can be logically combined using SE's AND Gate, OR Gate, and NOT Gate, which are found in the Insert menu under Logic. Bool values can be converted to voltages using DH_BoolToVoltage. AND, OR and NOT work the same way in any case. Exactly what logical combinations you should use depends on what you are trying to accomplish. In the example above, the goal was very simple. There is just one final decision, at the output of the AND Gate. All of the "Registered?" and "In Demo Period?" outputs are connected with one OR Gate. If the VST is registered or in a valid demo period, and the modules have validated themselves, the Gate will be positive. Otherwise, it will be 0. Any number of things could be done with the results of the AND Gate. It could turn the main switch or volume on or off. You might have a 0 result trigger a periodic beep or other noise. There are a few guidelines that should be followed when using the system's outputs:
By using additional ANDs, ORs and NOTs, you can build a control structure to provide different things for registered status than for demo status. The demo .se1 provides an example that's not too complicated. Here, in addition to having the synth play only if it's registered or in its demo period, the system outputs are also used to control the visibility of the button that invokes the registration dialog, so that it no longer appears after the synth is registered.
A Bool Splitter splits off the DHRC2's "Registered?" output in 3 directions. The middle one goes to a DH_BoolToVoltage for use in controlling whether the synth plays or not. The upper one goes to a DH_BooleanNot. From there, the output, which is now True if "Registered?" is False (because of the NOT) goes to the "Controls on Parent" of the BoolButton container, which contains the "Please Register" button and its caption. Therefore, the button and caption are visible only as long as the synth isn't registered. When "Registered?" becomes True, the output of the DH_BooleanNot, and thus the BoolButton container's "Controls on Parent" becomes False, hiding the controls inside the container. The bottom branch of the Bool Splitter form the "Registered?" output goes to a little prefab that displays "Unregistered !" if "Registered?" is False, or the user's name if "Registered?" is True. The structure of the Registered Display prefab is shown below. If "Registered?" is False, the output of the DH_BooleanNot is True, and a DH_TextDisplay with the unregistered message, which is inside the top container, gets displayed. If "Registered?" is True, the Controls on Parent of the bottom container is true. There are two DH_TextDisplays inside, one with the words "Registered to" preloaded, and one that is used to display the User ID that is output by the DHRC2 if it determines that the VST/VSTi is validly registered.
|
Next |