The MSSMixer Model: Controls
Previous  Top  Next


The MSSMixer control provides properties that allow you to determine how many controls there are (NControls), to select a control to work on (ControlNumber) and to determine the name of the currently-selected control (ControlName). The controls are effectively organised into a list indexed by ControlNumber.

Note that the available controls are a function of the currently selected mixer, destination and source. You should therefore always select a mixer, destination and source BEFORE examining or modifying the controls.

The MSSMixer control provides the GetControlInfo method to find the properties of the currently selected control. In particular, you can find out:

·The type of the control (see Control classes and Types).  
·The number of values that the control has. This will typically be one for a mute control, two for a volume control (for the left and right stereo channels), and can be more for other types of controls (for example, a multiple select control).  
·The minimum value that each control value can take.  
·The maximum value that each control value can take.  
·Whether the control is disabled.  

In order to find out the current values of a control, MSSMixer provides the GetControlValue method.

Setting the values of a control is a two stage process. To set new values, MSSMixer provides the PutNewControlValue method. Because a control can have multiple values, MSSMixer keeps a 'holding array' of control values which is set by using this method (the new values can also be examined by using the GetNewControlValue method). Once all the necessary values have been set, the control itself is updated by using the CommitNewControlValue method.

In addition, you can use the control to find a source of a given type and/or target type belonging to a destination of a given type or target type by using the FindSource method.