---
name: "njb_eaxapi"
section: "3"
platform: "linux"
package: "libnjb-doc"
version: "2.2.5-4.3"
release: "Debian 6.0 (Squeeze)"
platforms: ["linux"]
url: "https://new.carta.tech/njb_eaxapi"
---

# njb\_eaxapi(3)

## NAME

The EAX (and volume) manipulation API -

### Functions

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)\
 void **NJB\_Adjust\_EAX** (**njb\_t** \*njb, u\_int16\_t eaxid, u\_int16\_t patchindex, int16\_t scalevalue)\

## Function Documentation

### void NJB\_Adjust\_EAX (njb\_t \* njb, u\_int16\_t eaxid, u\_int16\_t patchindex, int16\_t scalevalue) This adjusts an EAX control. The magic numbers needed are to be found in `njb_eax_t` structs retrived with the NJB\_Get\_EAX\_Type() function. In theory, EAX controls could be both selectable (different `patchindex` can be selected) and scaleable (different `scalevalue` can be set) but in practice all controls are either selectable or scaleable.

**Parameters:**

*njb* a pointer to the `njb_t` object to manipulate the EAX settings on \
 *eaxid* a unique ID for the EAX effect to manipulate \
 *patchindex* a patch index to set for the EAX effect. If the effect is not selectable, you can set this to 0. \
 *scalevalue* a scale value to set for the EAX effect. If the effect is not scaleable, you can set this to 0. Note that this is a signed integer, and may very well be supplied with negative numbers!

**See also:**

**NJB\_Get\_EAX\_Type()**

References njb\_struct::device\_type, njb3\_state\_t::eax\_processor\_active, njb3\_control\_eax\_processor(), NJB\_DEVICE\_NJB1, and njb\_struct::protocol\_state.

### void NJB\_Destroy\_EAX\_Type (njb\_eax\_t \* eax) This destroys an EAX Type and frees all memory used by it.

**Parameters:**

*eax* the EAX Type to destroy

**Examples:**  **dumpeax.c**.

References destroy\_eax\_type().

### njb\_eax\_t\* NJB\_Get\_EAX\_Type (njb\_t \* njb) This retrieves an EAX type from the device. EAX types include volume controls, so this is essential for most player gadgets. Adjustment of the EAX controls according to the values found in `njb_eax_t` objects is done using the `NJB_Ajust_EAX()` function.

**Parameters:**

*njb* a pointer to the `njb_t` object to reset the EAX retrieveal pointer for

**Returns:**

a pointer to a newly allocaed EAX type. This should be freed with **NJB\_Destroy\_EAX\_Type() after use.**

**See also:**

**NJB\_Reset\_Get\_EAX\_Type()**

**NJB\_Adjust\_EAX()**

**njb\_eax\_t**

**Examples:**  **dumpeax.c.**

**References njb\_struct::device\_type, NJB\_DEVICE\_NJB1, and njb\_get\_nexteax().**

### void NJB\_Reset\_Get\_EAX\_Type (njb\_t \* njb) This function resets the retrieveal of EAX types. It should typically be called before any subsequent calls to NJB\_Get\_EAX\_Type().

**Typical usage:**

```
 njb_t *njb;
 njb_eax_t *eax;
```

```
 NJB_Reset_Get_EAX_Type(njb);
 while ( (eax = NJB_Get_EAX_Type(njb)) != NULL ) {
    // Do something with all the EAX types...
    NJB_Destroy_EAX_Type(eax);
 }
```

**Parameters:**

*njb* **a pointer to the** `njb_t` **object to reset the EAX retrieveal pointer for**

**See also:**

**NJB\_Get\_EAX\_Type()**

**Examples:**  **dumpeax.c.**

**References njb\_struct::device\_type, NJB\_DEVICE\_NJB1, and njb\_read\_eaxtypes().**

## Author

**Generated automatically by Doxygen for libnjb from the source code.**
