NAME
NJB_Reset_Get_EAX_Type, NJB_Get_EAX_Type, NJB_Destroy_EAX_Type - Get possible EAX controls from the NJB.
LIBRARY
libnjb
SYNOPSIS
#include <libnjb.h>
extern int njb_error
void NJB_Reset_Get_EAX_Type(njb_t *njb)
njb_eax_t *NJB_Get_EAX_Type(njb_t *njb)
void NJB_Destroy_EAX_Type(njb_eax_t *eax)
DESCRIPTION
NJB_Get_EAX_Type is used to fetch the available EAX control types and min/max values for the current device. Different devices present different number and types of controls, and e.g. GUI:s must therefore be built dynamically by using these types as prototypes.
NJB_Reset_Get_EAX_Type should be called first to initialize the fetch operation.
Any retrieved and used types must be destroyed using NJB_Destroy_EAX_Type afterwards.
The values can thereafter be modified using the NJB_Adjust_EAX(3) function.
When the last EAX type has been fetched, NJB_Get_EAX_Type returns a NULL pointer.
RETURN VALUES
A njb_eax_t object is returned from a successful query. If no more tags remain, or an error is encountered, a NULL pointer is returned.
EAX TYPE STRUCTURE
The EAX type struct has the following form:
typedef struct {
u_int16_t number;
char *name;
u_int8_t exclusive;
u_int8_t group;
u_int8_t selectable;
u_int16_t current_selectionvalue;
u_int16_t min_selectionvalue;
u_int16_t max_selectionvalue;
char **selection_names;
u_int8_t scaleable;
int16_t current_scalevalue;
int16_t min_scalevalue;
int16_t max_scalevalue; } njb_eax_t;
- number
-
The unique ID number of this EAX type, which shall be used in all calls to NJB_Adjust_EAX(3).
- name
-
The name of this EAX type, as a zero-terminated string.
- exclusive
-
The "exclusive" attribute signifies if this effect can be used in parallell with other EAX effects, GUI:s shall make sure all other exclusive effects are reset to default values when one exclusive effect is chosen. A value of 0 signifies that the effect is not exclusive, any other value means it is exclusive.
- group
-
The visual group for this effect - effects appearing after each other are grouped if their group numbers are identical. This is used e.g. when grouping controls in a GUI.
- selectable
-
If this value is different from 0 it means that this effect has several selectable patches.
- current_selectionvalue
-
If the effect has selectable patches, this is the current patch index selected.
- min_selectionvalue
-
If the effect has selectable patches, this is the minimum value for selecting a patch with NJB_Adjust_EAX(3).
- max_selectionvalue
-
If the effect has selectable patches, this is the maximum value for selecting a patch with NJB_Adjust_EAX(3).
- selection_names
-
If the effect has selectable patches, this is an array of names for the individual patches, indexed from 0 and upwards. The expression max_selectionvalue - min_selectionvalue + 1 gives the number of available patches. (The zero:th value is thus included.)
- scaleable
-
If this value is different from 0 the effect can be slided on a scale. (It is in theory possible for an effect to be both selectable and scaleable though this phenomenon has not occured in the wild.) A scaleable effect can take both negative and positive values.
- current_scalevalue
-
If the effect can be slided on a scale, this indicates the current value of the value on that scale. Observe that this number can be negative!
- min_scalevalue
-
If the effect can be slided on a scale, this indicates the minimum value the value can take on that scale. Observe that this number can be negative!
- max_scalevalue
-
If the effect can be slided on a scale, this indicates the maximum value the value can take on that scale. This number is typically not negative, though there is no guarantee that it will never be.