15 STATE_EXEC_SPEAKER_ON,
17 STATE_EXEC_SPEAKER_PLAY,
19 STATE_EXEC_SPEAKER_OFF,
30 static const int SAMPLES_PER_AUDIO_PACKET = 40;
36 bool Setup(WPADCallback pCallback);
37 void Shutdown(WPADCallback pCallback);
39 bool EnableOutput(
bool enable);
40 bool IsEnabledOutput()
const;
43 void UpdateStreamData(
const s16 *pRmtSamples);
45 bool IsAvailable()
const {
46 return mState == STATE_SPEAKER_PLAY;
49 void SetChannelIndex(
int index) {
50 mChannelIndex = index;
54 static const int SAMPLES_PER_ENCODED_PACKET = (SAMPLES_PER_AUDIO_PACKET + 1) / 2;
56 static const int CONTINUOUS_PLAY_INTERVAL_MINUTES = 8;
60 void ExecCommand(SpeakerCommand command);
62 bool IsAllSampleZero(
const s16 *pRmtSamples);
63 void NotifyCallback(s32 chan, s32 result);
65 static void SpeakerOnCallback(s32 chan, s32 result);
66 static void SpeakerPlayCallback(s32 chan, s32 result);
67 static void SpeakerOffCallback(s32 chan, s32 result);
76 bool mFirstEncodeFlag;
77 bool mValidCallbackFlag;
78 bool mCommandBusyFlag;
83 volatile bool mIntervalFlag;
85 SpeakerCommand mUserCommand;
86 SpeakerCommand mInternalCommand;
89 WPADCallback *mWpadCallback;
92 s64 mContinueBeginTime;