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
17<h2>C Specification</h2>
18<BLOCKQUOTE>
19<pre><code>#include &lt;revolution.h&gt;
20
21typedef void(*AXAuxCallback)(void *data, void *context);
22void AXRegisterAuxACallback (AXAuxCallback callback, void *context);</CODE></pre>
23</BLOCKQUOTE>
24<h2>Arguments</h2>
25
26<table border="1" cellpadding="3" cellspacing="0.1">
27  <tr>
28<td width="120" bgcolor="#ffffe8"><em><strong><code>callback</code></strong></em></td>
29<td width="520">The callback function. Accepts the following two arguments:<br><code>void *data;<br> void *context;</code></td>
30  </tr>
31  <tr>
32<td width="120" bgcolor="#ffffe8"><code><em><strong>context</strong></em></code></td>
33<td width="520">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
39<p>None.</p>
40
41<h2>Description</h2>
42
43<p><code>AXRegisterAuxACallback</code> 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>
44
45<p>The callback function must take the following two arguments:</p>
46<BLOCKQUOTE>
47<pre><CODE>void *data;
48void *context;</CODE></pre>
49</BLOCKQUOTE>
50<p>The <code><EM><STRONG>data</STRONG></EM></code> argument must be a pointer to a structure with the following format:</p>
51<BLOCKQUOTE>
52<pre><CODE>typedef struct
53{
54
55    s32 *l; // pointer to left aux channel buffer in main memory
56    s32 *r; // pointer to right aux channel buffer in main memory
57    s32 *s; // pointer to surround aux channel buffer in main memory
58
59} aux_data;</CODE></pre>
60</BLOCKQUOTE>
61<p>For <code>AX_MODE_DPL2</code> mode, the data argument must point to a structure with the following format:</p>
62<BLOCKQUOTE>
63<pre><CODE>typedef struct
64{
65
66    s32 *l; // pointer to left aux channel buffer in main memory
67    s32 *r; // pointer to right aux channel buffer in main memory
68    s32 *ls;    // pointer to left surround aux channel buffer in main memory
69    s32 *rs;    // pointer to right surround aux channel buffer in main memory
70
71} aux_data;</CODE></pre>
72</BLOCKQUOTE>
73<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>
74
75<p>The <code><EM><STRONG>context</STRONG></EM></code> argument is a void 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>
76
77<p>Note that the callback is invoked with interrupts <em>disabled</em>.</p>
78
79<h2>See Also</h2>
80
81<p>
82<code><a href="AXRegisterAuxBCallback.html">AXRegisterAuxBCallback</a>, <a href="AXRegisterAuxCCallback.html">AXRegisterAuxCCallback</a></code>
83</p>
84
85<h2>Revision History</h2>
86
87<P>2006/03/01 Initial version.</P>
88
89<hr>
90<P>CONFIDENTIAL</p>
91</BODY>
92</HTML>
93