Programming Reference:ChoiceCombination: Difference between revisions
Created page with "==Function== The <tt>ChoiceCombination</tt> class contains filters that are applied alternatively, depending on a user choice. To use a <tt>ChoiceCombination</tt>, you need to derive a child class and define a constructor in which you add the desired filters, together with the corresponding user choice. In addition, you need to specify a parameter name that will be displayed in the BCI2000 GUI, and allows to select one of the choices. #include "ChoiceCombination.h" #i..." |
|||
| Line 1: | Line 1: | ||
==Function== | ==Function== | ||
The <tt>ChoiceCombination</tt> class contains filters that are applied alternatively, depending on a user choice. | The <tt>ChoiceCombination</tt> class contains filters that are applied alternatively, depending on a user choice. | ||
To use a <tt>ChoiceCombination</tt>, you need to derive a child class and define a constructor in which you add the desired filters, together with | To use a <tt>ChoiceCombination</tt>, you need to derive a child class and define a constructor in which you add the desired filters, together with corresponding user choices. | ||
In addition, you need to specify a parameter name that will be displayed in the BCI2000 GUI, and allows to select one of the choices. | In addition, you need to specify a parameter name that will be displayed in the BCI2000 GUI, and allows to select one of the choices. | ||
Latest revision as of 15:20, 7 September 2023
Function
The ChoiceCombination class contains filters that are applied alternatively, depending on a user choice. To use a ChoiceCombination, you need to derive a child class and define a constructor in which you add the desired filters, together with corresponding user choices. In addition, you need to specify a parameter name that will be displayed in the BCI2000 GUI, and allows to select one of the choices.
#include "ChoiceCombination.h"
#include "IdentityFilter.h"
#include "Filter1.h"
#include "Filter2.h"
struct MyChoice : ChoiceCombination
{
MyChoice() : ChoiceCombination("MyParameterName")
{
AddChoice<IdentityFilter>(1);
AddChoice<Filter1>(2);
AddChoice<Filter2>(3);
}
};
In the above example, we have used the IdentityFilter to give the user an "neutral" choice, i.e. not processing anything but transferring the input signal to the output unchanged.
Parameters
<UserDefinedParameterName>
An enumeration parameter whose value determines which of the filters is applied to the input.
States
None.
See also
Programming Reference:ParallelCombination, Programming Reference:LinearCombination, Programming Reference:IdentityFilter