1<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"> 2<html> 3 4<head> 5<META http-equiv="Content-Type" content="text/html; charset=windows-1252"> 6<META name="GENERATOR" content="Microsoft FrontPage 5.0"> 7<META http-equiv="Content-Style-Type" content="text/css"> 8<LINK rel="stylesheet" type="text/css" href="../CSS/revolution.css"> 9<title>WPADControlSpeaker</title> 10</head> 11 12<body> 13 14<h1>WPADControlSpeaker</h1> 15 16 17<h2>C Specification</h2> 18 19<dl> 20<dd><pre><code>#include <revolution/wpad.h> 21 22#define WPAD_CHAN0 0 23#define WPAD_CHAN1 1 24#define WPAD_CHAN2 2 25#define WPAD_CHAN3 3 26 27#define WPAD_SPEAKER_OFF 0 28#define WPAD_SPEAKER_ON 1 29#define WPAD_SPEAKER_MUTE 2 30#define WPAD_SPEAKER_MUTE_OFF 3 31#define WPAD_SPEAKER_PLAY 4 32 33typedef void (*WPADCallback) ( s32 chan, s32 result ); 34 35s32 WPADControlSpeaker( s32 chan, u32 command, WPADCallback callback );</code></pre> 36 </dd> 37</dl> 38 39<h2>Arguments</h2> 40<TABLE border="1"> 41 <TBODY> 42 <TR> 43<TD width="120" bgcolor="#ffffe8"><code><b><i>chan</i></b></code></TD> 44<TD>One of the <code>WPAD_CHAN<i>n</i></code> values.</TD> 45 </TR> 46 <TR> 47<TD width="120" bgcolor="#ffffe8"><CODE><b><i>pattern</i></b></CODE></TD> 48<TD><code>Set to one of the WPAD_SPEAKER_OFF, WPAD_SPEAKER_ON, WPAD_SPEAKER_MUTE, WPAD_SPEAKER_MUTE_OFF, or WPAD_SPEAKER_PLAY.</code></TD> 49 </TR> 50 <TR> 51<TD width="120" bgcolor="#ffffe8"><CODE><b><i>callback</i></b></CODE></TD> 52<TD>Callback function to notify about the result. Notification processing is omitted if NULL is specified.</TD> 53 </TR> 54 </TBODY> 55</TABLE> 56<h2>Return Values</h2> 57<p> 58Returns one of the following codes: 59</p> 60<p> 61<code>WPAD_ERR_NONE</code><br> <code>WPAD_ERR_NO_CONTROLLER</code><br> <code>WPAD_ERR_BUSY</code><br> 62</P> 63<H2>Description</H2> 64<p> 65Controls the speaker of the Wii Remote Control on the specified channel. This function registers the speaker control command in the library. The WPAD library processes registered commands when other commands are not running. 66</p> 67<p> 68To output audio from the speaker on the Wii Remote, first start the speaker using the <code>WPAD_SPEAKER_ON</code> command. Next, audio can be output from the speaker using the <code>WPAD_SPEAKER_PLAY</code> command. Sending audio data using the <a href="./WPADSendStreamData.html"><code>WPADSendStreamData</code></a> at this time will cause audio to be output from the speaker of the Wii Remote. 69</p> 70 71<ul> 72<li>Commands</li> 73</ul> 74<p> 75The different commands are defined as follows. 76</p> 77 78<table border="1"> 79<tr><td><code>WPAD_SPEAKER_OFF</code></td><td>Turns off the Wii Remote speaker.</td> 80<tr><td><code>WPAD_SPEAKER_ON</code></td><td>Turns on the Wii Remote speaker.</td> 81<tr><td><code>WPAD_SPEAKER_MUTE</code></td><td>Mutes the Wii Remote speaker.</td> 82<tr><td><code>WPAD_SPEAKER_MUTE_OFF</code></td><td>Unmutes the Wii Remote speaker.</td> 83<tr><td><code>WPAD_SPEAKER_PLAY</code></td><td>Allows audio data to be output from the Wii Remote speaker.</td> 84</table> 85 86<ul> 87<li>Error Codes</li> 88</ul> 89<p> 90The return values have the following meanings: 91</p> 92<table border="1"> 93<tr><td><code>WPAD_ERR_NONE</code></td><td>The WPAD library received a command.</td> 94<tr><td><code>WPAD_ERR_BUSY</code></td><td>The WPAD library was unable to receive a command.</td> 95<tr><td><code>WPAD_ERR_NO_CONTROLLER</code></td><td>The connection was broken.</td> 96</table> 97 98<ul> 99<li>Callbacks</li> 100</ul> 101<p> 102In addition, if a callback function is set, the callback function returns the following error codes when the processing is complete. Their meanings are as follows: 103</p> 104<table border="1"> 105<tr> 106<td><code>WPAD_ERR_NONE</code></td> 107<td>The command was processed normally.</td> 108</tr> 109<tr> 110<td><code>WPAD_ERR_BUSY</code></td> 111<td>The WPAD library was unable to receive a command. Call it again later.</td> 112</tr> 113<tr> 114<td><code>WPAD_ERR_TRANSFER</code></td> 115<td>A communications error prevented normal processing of the command.</td> 116</tr> 117<tr> 118<td><code>WPAD_ERR_NO_CONTROLLER</code></td> 119<td>The connection was broken.</td> 120</tr> 121</table> 122 123<h2>See Also</h2> 124<p> 125<A href="./toc.html" target="contents">WPAD Functions</A><br> <A href="./WPADIsSpeakerEnabled.html"><CODE>WPADIsSpeakerEnabled</CODE></A>, <A href="./WPADSendStreamData.html"><CODE>WPADSendStreamData</CODE></A><br> 126</p> 127 128<H2>Revision History</H2> 129<p> 1302006/11/29 Added <CODE>WPAD_ERR_BUSY</CODE>, which had been left out from the list, to the error codes passed by the callback.<br>2006/08/15 Initial version.<br> 131</P> 132 133<hr> 134<P>CONFIDENTIAL</p> 135</BODY> 136</HTML>