#include <revolution/wpad.h>
#define WPAD_CHAN0 0
#define WPAD_CHAN1 1
#define WPAD_CHAN2 2
#define WPAD_CHAN3 3
#define WPAD_SPEAKER_OFF 0
#define WPAD_SPEAKER_ON 1
#define WPAD_SPEAKER_MUTE 2
#define WPAD_SPEAKER_MUTE_OFF 3
#define WPAD_SPEAKER_PLAY 4
typedef void (*WPADCallback) ( s32 chan, s32 result );
s32 WPADControlSpeaker( s32 chan, u32 command, WPADCallback callback );
chan |
One of the WPAD_CHANn values. |
pattern |
Set to one of the WPAD_SPEAKER_OFF, WPAD_SPEAKER_ON, WPAD_SPEAKER_MUTE, WPAD_SPEAKER_MUTE_OFF, or WPAD_SPEAKER_PLAY. |
callback |
Callback function to notify about the result. Notification processing is omitted if NULL is specified. |
Returns one of the following codes:
WPAD_ERR_NONE
WPAD_ERR_NO_CONTROLLER
WPAD_ERR_BUSY
Controls 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.
To output audio from the speaker on the Wii Remote, first start the speaker using the WPAD_SPEAKER_ON command. Next, audio can be output from the speaker using the WPAD_SPEAKER_PLAY command. Sending audio data using the WPADSendStreamData at this time will cause audio to be output from the speaker of the Wii Remote.
The different commands are defined as follows.
WPAD_SPEAKER_OFF | Turns off the Wii Remote speaker. |
WPAD_SPEAKER_ON | Turns on the Wii Remote speaker. |
WPAD_SPEAKER_MUTE | Mutes the Wii Remote speaker. |
WPAD_SPEAKER_MUTE_OFF | Unmutes the Wii Remote speaker. |
WPAD_SPEAKER_PLAY | Allows audio data to be output from the Wii Remote speaker. |
The return values have the following meanings:
WPAD_ERR_NONE | The WPAD library received a command. |
WPAD_ERR_BUSY | The WPAD library was unable to receive a command. |
WPAD_ERR_NO_CONTROLLER | The connection was broken. |
In 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:
WPAD_ERR_NONE |
The command was processed normally. |
WPAD_ERR_BUSY |
The WPAD library was unable to receive a command. Call it again later. |
WPAD_ERR_TRANSFER |
A communications error prevented normal processing of the command. |
WPAD_ERR_NO_CONTROLLER |
The connection was broken. |
WPAD Functions
WPADIsSpeakerEnabled, WPADSendStreamData
2006/11/29 Added WPAD_ERR_BUSY, which had been left out from the list, to the error codes passed by the callback.
2006/08/15 Initial version.
CONFIDENTIAL