Selection values aren't necessarily in any sort of order, nor are they necessarily unique.
| Class Overview |
You never create or delete a BDiscreteParameter
object yourself. Instead, call the
BParameterGroup::MakeDiscreteParameter()
function to create a BDiscreteParameter
within the desired
BParameterGroup
.
status_t AddItem(int32 value,
const char* name);
Adds a new name
/value
pair to the list of possible values the control can
take. Whenever the selection named name is chosen, the user interface
application will send a value change message to the control with the
specified value.
Return Code | Description |
---|---|
| The item was added successfully. |
| Not enough memory to add the item to the list. |
const char* CountItems(int32 value);
int32 ItemValueAt(int32 value);
These functions return the name and value of the item at the specified
index, where index ranges from 0 to
CountItems()
-1.
Selection values aren't necessarily in any sort of order, nor are they necessarily unique.
void MakeItemsFromInputs();
void MakeItemsFromOutputs();
These functions add all inputs or outputs as selections, where the input or output's name is used as the item's name, and the input or output's index number is used as the value of the item.
These shortcuts let you easily create the item lists for MUX-like controls, which allow the user to choose one of a number of inputs or outputs.
It's important to note that the correct inputs and outputs must already be connected to the parameter when you call either of these functions, otherwise no items will be added, since the inputs and outputs aren't there.