1<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
2<html>
3
4<head>
5<LINK rel="stylesheet" type="text/css" href="../../CSS/revolution.css">
6<title>AXRegisterAuxACallback</title>
7<META http-equiv="Content-Type" content="text/html; charset=windows-1252">
8<META name="GENERATOR" content="IBM WebSphere Studio Homepage Builder Version 6.5.0.0 for Windows">
9<META http-equiv="Content-Style-Type" content="text/css">
10</head>
11
12<body>
13
14<h1 align="left">AXRegisterAuxACallback</h1>
15
16<h2>Syntax</h2>
17<dl><dd><pre class="construction">
18#include &lt;revolution/ax.h&gt;
19
20typedef void(*AXAuxCallback)(void *data, void *context);
21
22void AXRegisterAuxACallback (AXAuxCallback callback, void *context);
23</pre></dd></dl>
24
25<h2>Arguments</h2>
26<TABLE class="arguments" border="1" >
27  <tr>
28<th>callback</th>
29<td>The callback function. Accepts the following two arguments:<br><code>void *data;<br> void *context;</code></td>
30  </tr>
31  <tr>
32<th>context</th>
33<td>Void pointer to a user application-defined structure. Passed directly to the effects callback.</td>
34  </tr>
35</table>
36
37<h2>Return Values</h2>
38<p>None.</p>
39
40<h2>Description</h2>
41<p>The <code>AXRegisterAuxACallback</code> function registers the callback function. This function is invoked once per audio frame, and is responsible for applying an effect (such as reverb) to the contents of the AuxA buffer.</p>
42
43<p>The callback function must take the following two arguments:</p>
44<BLOCKQUOTE>
45<pre><CODE>
46void *data;
47void *context;
48</CODE></pre>
49</BLOCKQUOTE>
50<p>The <SPAN class="argument">data</SPAN> argument must be a pointer to a structure with the following format:</p>
51<BLOCKQUOTE><pre><CODE>
52typedef struct
53{
54s32 *l; // pointer to left aux channel buffer in main memory
55s32 *r; // pointer to right aux channel buffer in main memory
56s32 *s; // pointer to surround aux channel buffer in main memory
57} aux_data;
58</CODE></pre></BLOCKQUOTE>
59
60<p>For <code>AX_MODE_DPL2</code> mode, the data argument must point to a structure with the following format:</p>
61<BLOCKQUOTE><pre><CODE>
62typedef struct
63{
64s32 *l; // pointer to left aux channel buffer in main memory
65s32 *r; // pointer to right aux channel buffer in main memory
66s32 *ls;    // pointer to left surround aux channel buffer in main memory
67s32 *rs;    // pointer to right surround aux channel buffer in main memory
68} aux_data;
69</CODE></pre></BLOCKQUOTE>
70<p>The buffers contain the contents of the Aux bus, as received from the DSP. The callback function must apply its effect to this data, then store the result back into these buffers.&nbsp;Each of the buffers is 384 bytes in length (i.e., 4 bytes/sample x 96 samples, or 1152 bytes total for all three buffers). Note that each sample is a signed, 24-bit number, encoded into 32 bits.</p>
71
72<p>The <SPAN class="argument">context</SPAN> argument is a valid pointer that is not modified or otherwise examined by AX. It is simply passed from the user application to the callback function, and is meant to facilitate communication between the two.</p>
73
74<p>Note that the callback is invoked with interrupts <em>disabled</em>.</p>
75
76<h2>See Also</h2>
77<p class="reference">
78<a href="AXRegisterAuxBCallback.html">AXRegisterAuxBCallback</a>, <a href="AXRegisterAuxCCallback.html">AXRegisterAuxCCallback</a>
79</p>
80
81<h2>Revision History</h2>
82<P>
832006/03/01 Initial version.<BR>
84</P>
85
86<hr><p>CONFIDENTIAL</p></body>
87</html>
88