You are here: Using External Control Systems with HAL > Integrating Stardraw Control Systems > Exploring the Stardraw Example Application > Commands

Commands

To unmute all audio outputs and reset them to default levels, the example HAL1 configuration provides a Command control. The Stardraw application implements this function with the Default Levels button, which is a standard button from the Stardraw Toolbox Windows palette.

Default Levels Button

The Default Levels button is unidirectional – it sends messages to the Halogen/HAL Control Server but does not receive them. This is because commands occur in a moment of time – when the user clicks on the command button. There is no state to maintain in the form and so receiving and handling command messages that the Halogen/HAL Control Server sends is optional.

When the user clicks on the Default Levels button, the Stardraw application generates a Click event for the form’s DefaultLevelsButton control. The application has mapped this event to an action which calls the HAL driver’s ExecDefaultLevelsCommand method. This in turn causes the driver to send a ‘command’ message to the Halogen/HAL Control Server which fires the Default Command Control configured in the HAL example configuration.

To see the event and associated action, double click on the Default Levels button. This brings up the Actions dialog for the DefaultLevelsButton:

In this dialog the event is DefaultLevelsButton.Click. When this event occurs, the action calls the ExecDefaultLevelsCommand method in the HAL1 driver.