NSMBW-Decomp
A decompilation of New Super Mario Bros. Wii
Loading...
Searching...
No Matches
nw4r::snd::RemoteSpeaker Class Reference

Description

Definition at line 11 of file snd_RemoteSpeaker.h.

Public Types

enum  SpeakerState {
  STATE_INVALID ,
  STATE_EXEC_SPEAKER_ON ,
  STATE_SPEAKER_ON ,
  STATE_EXEC_SPEAKER_PLAY ,
  STATE_SPEAKER_PLAY ,
  STATE_EXEC_SPEAKER_OFF ,
  STATE_SPEAKER_OFF
}
 
enum  SpeakerCommand {
  COMMAND_NONE ,
  COMMAND_SPEAKER_ON ,
  COMMAND_SPEAKER_PLAY ,
  COMMAND_SPEAKER_OFF
}
 

Public Member Functions

void InitParam ()
 
bool Setup (WPADCallback pCallback)
 
void Shutdown (WPADCallback pCallback)
 
bool EnableOutput (bool enable)
 
bool IsEnabledOutput () const
 
void Update ()
 
void UpdateStreamData (const s16 *pRmtSamples)
 
bool IsAvailable () const
 
void SetChannelIndex (int index)
 

Static Public Attributes

static const int SAMPLES_PER_AUDIO_PACKET = 40
 

Private Member Functions

void ClearParam ()
 
void ExecCommand (SpeakerCommand command)
 
bool IsAllSampleZero (const s16 *pRmtSamples)
 
void NotifyCallback (s32 chan, s32 result)
 

Static Private Member Functions

static void SpeakerOnCallback (s32 chan, s32 result)
 
static void SpeakerPlayCallback (s32 chan, s32 result)
 
static void SpeakerOffCallback (s32 chan, s32 result)
 
static void ContinueAlarmHandler (OSAlarm *pAlarm, OSContext *pCtx)
 
static void IntervalAlarmHandler (OSAlarm *pAlarm, OSContext *pCtx)
 

Private Attributes

bool mInitFlag
 
bool mPlayFlag
 
bool mEnableFlag
 
bool mFirstEncodeFlag
 
bool mValidCallbackFlag
 
bool mCommandBusyFlag
 
bool mContinueFlag
 
volatile bool mIntervalFlag
 
SpeakerState mState
 
SpeakerCommand mUserCommand
 
SpeakerCommand mInternalCommand
 
WENCInfo mEncodeInfo
 
int mChannelIndex
 
WPADCallback * mWpadCallback
 
OSAlarm mContinueAlarm
 
OSAlarm mIntervalAlarm
 
s64 mContinueBeginTime
 

Static Private Attributes

static const int SAMPLES_PER_ENCODED_PACKET = (SAMPLES_PER_AUDIO_PACKET + 1) / 2
 
static const int CONTINUOUS_PLAY_INTERVAL_MINUTES = 8
 

Member Enumeration Documentation

◆ SpeakerState

enum nw4r::snd::RemoteSpeaker::SpeakerState

Definition at line 13 of file snd_RemoteSpeaker.h.

◆ SpeakerCommand

enum nw4r::snd::RemoteSpeaker::SpeakerCommand

Definition at line 23 of file snd_RemoteSpeaker.h.

Member Function Documentation

◆ IsAvailable()

bool nw4r::snd::RemoteSpeaker::IsAvailable ( ) const
inline

Definition at line 45 of file snd_RemoteSpeaker.h.

◆ SetChannelIndex()

void nw4r::snd::RemoteSpeaker::SetChannelIndex ( int index)
inline

Definition at line 49 of file snd_RemoteSpeaker.h.

Member Data Documentation

◆ SAMPLES_PER_AUDIO_PACKET

const int nw4r::snd::RemoteSpeaker::SAMPLES_PER_AUDIO_PACKET = 40
static

Definition at line 30 of file snd_RemoteSpeaker.h.

◆ SAMPLES_PER_ENCODED_PACKET

const int nw4r::snd::RemoteSpeaker::SAMPLES_PER_ENCODED_PACKET = (SAMPLES_PER_AUDIO_PACKET + 1) / 2
staticprivate

Definition at line 54 of file snd_RemoteSpeaker.h.

◆ CONTINUOUS_PLAY_INTERVAL_MINUTES

const int nw4r::snd::RemoteSpeaker::CONTINUOUS_PLAY_INTERVAL_MINUTES = 8
staticprivate

Definition at line 56 of file snd_RemoteSpeaker.h.

◆ mInitFlag

bool nw4r::snd::RemoteSpeaker::mInitFlag
private

Definition at line 73 of file snd_RemoteSpeaker.h.

◆ mPlayFlag

bool nw4r::snd::RemoteSpeaker::mPlayFlag
private

Definition at line 74 of file snd_RemoteSpeaker.h.

◆ mEnableFlag

bool nw4r::snd::RemoteSpeaker::mEnableFlag
private

Definition at line 75 of file snd_RemoteSpeaker.h.

◆ mFirstEncodeFlag

bool nw4r::snd::RemoteSpeaker::mFirstEncodeFlag
private

Definition at line 76 of file snd_RemoteSpeaker.h.

◆ mValidCallbackFlag

bool nw4r::snd::RemoteSpeaker::mValidCallbackFlag
private

Definition at line 77 of file snd_RemoteSpeaker.h.

◆ mCommandBusyFlag

bool nw4r::snd::RemoteSpeaker::mCommandBusyFlag
private

Definition at line 78 of file snd_RemoteSpeaker.h.

◆ mContinueFlag

bool nw4r::snd::RemoteSpeaker::mContinueFlag
private

Definition at line 82 of file snd_RemoteSpeaker.h.

◆ mIntervalFlag

volatile bool nw4r::snd::RemoteSpeaker::mIntervalFlag
private

Definition at line 83 of file snd_RemoteSpeaker.h.

◆ mState

SpeakerState nw4r::snd::RemoteSpeaker::mState
private

Definition at line 84 of file snd_RemoteSpeaker.h.

◆ mUserCommand

SpeakerCommand nw4r::snd::RemoteSpeaker::mUserCommand
private

Definition at line 85 of file snd_RemoteSpeaker.h.

◆ mInternalCommand

SpeakerCommand nw4r::snd::RemoteSpeaker::mInternalCommand
private

Definition at line 86 of file snd_RemoteSpeaker.h.

◆ mEncodeInfo

WENCInfo nw4r::snd::RemoteSpeaker::mEncodeInfo
private

Definition at line 87 of file snd_RemoteSpeaker.h.

◆ mChannelIndex

int nw4r::snd::RemoteSpeaker::mChannelIndex
private

Definition at line 88 of file snd_RemoteSpeaker.h.

◆ mWpadCallback

WPADCallback* nw4r::snd::RemoteSpeaker::mWpadCallback
private

Definition at line 89 of file snd_RemoteSpeaker.h.

◆ mContinueAlarm

OSAlarm nw4r::snd::RemoteSpeaker::mContinueAlarm
private

Definition at line 90 of file snd_RemoteSpeaker.h.

◆ mIntervalAlarm

OSAlarm nw4r::snd::RemoteSpeaker::mIntervalAlarm
private

Definition at line 91 of file snd_RemoteSpeaker.h.

◆ mContinueBeginTime

s64 nw4r::snd::RemoteSpeaker::mContinueBeginTime
private

Definition at line 92 of file snd_RemoteSpeaker.h.