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

Description

Definition at line 39 of file snd_Channel.h.

Public Types

enum  ChannelCallbackStatus {
  CALLBACK_STATUS_STOPPED ,
  CALLBACK_STATUS_DROP ,
  CALLBACK_STATUS_FINISH ,
  CALLBACK_STATUS_CANCEL
}
 
enum  LfoTarget {
  LFO_TARGET_PITCH ,
  LFO_TARGET_VOLUME ,
  LFO_TARGET_PAN
}
 
typedef void Callback(Channel *dropChannel, ChannelCallbackStatus status, ulong userData)
 
typedef ut::LinkList< Channel, 0xd8 > LinkList
 

Public Member Functions

void InitParam (Callback *callback, ulong callbackData)
 
void Start (WaveInfo const &waveParam, int length, ulong startOffset)
 
void Pause (bool flag)
 
void Stop ()
 
bool IsRelease () const
 
bool IsPause () const
 
bool IsActive () const
 
bool IsAutoUpdateSweep () const
 
f32 GetSweepValue () const
 
s32 GetLength () const
 
int GetAlternateAssignId () const
 
VoiceGetVoice () const
 
ChannelGetNextTrackChannel () const
 
void SetDecay (int decay)
 
void SetRelease (int release)
 
void SetAttack (int attack)
 
void SetSustain (int sustain)
 
void SetHold (int hold)
 
void SetLfoParam (LfoParam const &param)
 
void SetLfoTarget (LfoTarget type)
 
void SetReleasePriorityFix (bool fix)
 
void SetReleaseIgnore (bool ignore)
 
void SetBiquadFilter (int type, f32 value)
 
void SetRemoteFilter (int filter)
 
void SetUserVolume (f32 volume)
 
void SetUserPitchRatio (f32 pitchRatio)
 
void SetUserPan (f32 pan)
 
void SetUserSurroundPan (f32 surroundPan)
 
void SetRemoteOutVolume (int channel, f32 volume)
 
void SetUserLpfFreq (f32 lpfFreq)
 
void SetOutputLine (int lineFlag)
 
void SetMainOutVolume (f32 volume)
 
void SetMainSend (f32 send)
 
void SetFxSend (AuxBus bus, f32 send)
 
void SetUserPitch (f32 pitch)
 
void SetSweepParam (f32 sweepPitch, int sweepTime, bool autoUpdate)
 
void SetInitVolume (f32 volume)
 
void SetInitPan (f32 pan)
 
void SetInitSurroundPan (f32 surroundPan)
 
void SetTune (f32 tune)
 
void SetSilence (bool silenceFlag, int fadeTimes)
 
void SetKey (int key)
 
void SetOriginalKey (int key)
 
void SetLength (s32 length)
 
void SetPanMode (PanMode panMode)
 
void SetPanCurve (PanCurve panCurve)
 
void SetAlternateAssignId (int id)
 
void SetWaveDataLocationCallback (WaveDataLocationCallback *callback, WaveInfo const *waveInfo)
 
void SetVoiceOutParam (int index, VoiceOutParam const &param)
 
void SetNextTrackChannel (Channel *channel)
 
void Update (bool doPeriodicProc)
 
void UpdateSweep (int count)
 
void Release ()
 
void NoteOff ()
 

Static Public Member Functions

static ChannelAllocChannel (int voiceChannelCount, int voiceOutCount, int priority, Callback *callback, ulong callbackData)
 
static void FreeChannel (Channel *channel)
 

Public Attributes

ut::LinkListNode mLink
 

Static Public Attributes

static u8 const SILENCE_VOLUME_MIN = 0
 
static u8 const SILENCE_VOLUME_MAX = 255
 
static int const ORIGINAL_KEY_INIT = 60
 
static int const KEY_INIT = 60
 
static int const PRIORITY_RELEASE = 1
 
static int const CHANNEL_MAX = Voice::CHANNEL_MAX
 
static int const CHANNEL_MIN = 1
 
static int const CHANNEL_NUM
 

Static Private Member Functions

static void VoiceCallbackFunc (Voice *voice, Voice::VoiceCallbackStatus status, void *arg)
 

Private Attributes

EnvGenerator mEnvelope
 
Lfo mLfo
 
u8 mLfoTarget
 
bool mPauseFlag
 
bool mActiveFlag
 
bool mAllocFlag
 
bool mAutoSweep
 
bool mReleasePriorityFixFlag
 
u8 mReleaseIgnoreFlag
 
u8 mBiquadType
 
u8 mRemoteFilter
 
f32 mUserVolume
 
f32 mUserPitchRatio
 
f32 mUserPan
 
f32 mUserSurroundPan
 
f32 mUserLpfFreq
 
f32 mBiquadValue
 
int mOutputLineFlag
 
f32 mMainOutVolume
 
f32 mMainSend
 
f32 mFxSend [AUX_BUS_NUM]
 
f32 mRemoteOutVolume [4]
 
f32 mUserPitch
 
f32 mSweepPitch
 
s32 mSweepCounter
 
s32 mSweepLength
 
f32 mInitVolume
 
f32 mInitPan
 
f32 mInitSurroundPan
 
f32 mTune
 
MoveValue< u8, u16 > mSilenceVolume
 
int mKey
 
int mOriginalKey
 
s32 mLength
 
PanMode mPanMode
 
PanCurve mPanCurve
 
int mAlternateAssign
 
Callback * mCallback
 
ulong mCallbackData
 
WaveDataLocationCallbackmWaveDataLocationCallback
 
WaveInfo const * mWaveInfo
 
VoicemVoice
 
ChannelmNextLink
 

Member Typedef Documentation

◆ Callback

typedef void nw4r::snd::detail::Channel::Callback(Channel *dropChannel, ChannelCallbackStatus status, ulong userData)

Definition at line 62 of file snd_Channel.h.

◆ LinkList

Definition at line 66 of file snd_Channel.h.

Member Enumeration Documentation

◆ ChannelCallbackStatus

enum nw4r::snd::detail::Channel::ChannelCallbackStatus

Definition at line 44 of file snd_Channel.h.

◆ LfoTarget

enum nw4r::snd::detail::Channel::LfoTarget

Definition at line 53 of file snd_Channel.h.

Member Function Documentation

◆ Pause()

void nw4r::snd::detail::Channel::Pause ( bool flag)
inline

Definition at line 80 of file snd_Channel.h.

◆ IsRelease()

bool nw4r::snd::detail::Channel::IsRelease ( ) const
inline

Definition at line 87 of file snd_Channel.h.

◆ IsPause()

bool nw4r::snd::detail::Channel::IsPause ( ) const
inline

Definition at line 91 of file snd_Channel.h.

◆ IsActive()

bool nw4r::snd::detail::Channel::IsActive ( ) const
inline

Definition at line 92 of file snd_Channel.h.

◆ IsAutoUpdateSweep()

bool nw4r::snd::detail::Channel::IsAutoUpdateSweep ( ) const
inline

Definition at line 93 of file snd_Channel.h.

◆ GetLength()

s32 nw4r::snd::detail::Channel::GetLength ( ) const
inline

Definition at line 95 of file snd_Channel.h.

◆ GetAlternateAssignId()

int nw4r::snd::detail::Channel::GetAlternateAssignId ( ) const
inline

Definition at line 96 of file snd_Channel.h.

◆ GetVoice()

Voice * nw4r::snd::detail::Channel::GetVoice ( ) const
inline

Definition at line 97 of file snd_Channel.h.

◆ GetNextTrackChannel()

Channel * nw4r::snd::detail::Channel::GetNextTrackChannel ( ) const
inline

Definition at line 98 of file snd_Channel.h.

◆ SetDecay()

void nw4r::snd::detail::Channel::SetDecay ( int decay)
inline

Definition at line 100 of file snd_Channel.h.

◆ SetRelease()

void nw4r::snd::detail::Channel::SetRelease ( int release)
inline

Definition at line 101 of file snd_Channel.h.

◆ SetAttack()

void nw4r::snd::detail::Channel::SetAttack ( int attack)
inline

Definition at line 102 of file snd_Channel.h.

◆ SetSustain()

void nw4r::snd::detail::Channel::SetSustain ( int sustain)
inline

Definition at line 103 of file snd_Channel.h.

◆ SetHold()

void nw4r::snd::detail::Channel::SetHold ( int hold)
inline

Definition at line 104 of file snd_Channel.h.

◆ SetLfoParam()

void nw4r::snd::detail::Channel::SetLfoParam ( LfoParam const & param)
inline

Definition at line 105 of file snd_Channel.h.

◆ SetLfoTarget()

void nw4r::snd::detail::Channel::SetLfoTarget ( LfoTarget type)
inline

Definition at line 106 of file snd_Channel.h.

◆ SetReleasePriorityFix()

void nw4r::snd::detail::Channel::SetReleasePriorityFix ( bool fix)
inline

Definition at line 107 of file snd_Channel.h.

◆ SetReleaseIgnore()

void nw4r::snd::detail::Channel::SetReleaseIgnore ( bool ignore)
inline

Definition at line 108 of file snd_Channel.h.

◆ SetRemoteFilter()

void nw4r::snd::detail::Channel::SetRemoteFilter ( int filter)
inline

Definition at line 110 of file snd_Channel.h.

◆ SetUserVolume()

void nw4r::snd::detail::Channel::SetUserVolume ( f32 volume)
inline

Definition at line 111 of file snd_Channel.h.

◆ SetUserPitchRatio()

void nw4r::snd::detail::Channel::SetUserPitchRatio ( f32 pitchRatio)
inline

Definition at line 112 of file snd_Channel.h.

◆ SetUserPan()

void nw4r::snd::detail::Channel::SetUserPan ( f32 pan)
inline

Definition at line 113 of file snd_Channel.h.

◆ SetUserSurroundPan()

void nw4r::snd::detail::Channel::SetUserSurroundPan ( f32 surroundPan)
inline

Definition at line 114 of file snd_Channel.h.

◆ SetRemoteOutVolume()

void nw4r::snd::detail::Channel::SetRemoteOutVolume ( int channel,
f32 volume )
inline

Definition at line 118 of file snd_Channel.h.

◆ SetUserLpfFreq()

void nw4r::snd::detail::Channel::SetUserLpfFreq ( f32 lpfFreq)
inline

Definition at line 122 of file snd_Channel.h.

◆ SetOutputLine()

void nw4r::snd::detail::Channel::SetOutputLine ( int lineFlag)
inline

Definition at line 123 of file snd_Channel.h.

◆ SetMainOutVolume()

void nw4r::snd::detail::Channel::SetMainOutVolume ( f32 volume)
inline

Definition at line 124 of file snd_Channel.h.

◆ SetMainSend()

void nw4r::snd::detail::Channel::SetMainSend ( f32 send)
inline

Definition at line 125 of file snd_Channel.h.

◆ SetFxSend()

void nw4r::snd::detail::Channel::SetFxSend ( AuxBus bus,
f32 send )
inline

Definition at line 126 of file snd_Channel.h.

◆ SetUserPitch()

void nw4r::snd::detail::Channel::SetUserPitch ( f32 pitch)
inline

Definition at line 127 of file snd_Channel.h.

◆ SetInitVolume()

void nw4r::snd::detail::Channel::SetInitVolume ( f32 volume)
inline

Definition at line 129 of file snd_Channel.h.

◆ SetInitPan()

void nw4r::snd::detail::Channel::SetInitPan ( f32 pan)
inline

Definition at line 130 of file snd_Channel.h.

◆ SetInitSurroundPan()

void nw4r::snd::detail::Channel::SetInitSurroundPan ( f32 surroundPan)
inline

Definition at line 131 of file snd_Channel.h.

◆ SetTune()

void nw4r::snd::detail::Channel::SetTune ( f32 tune)
inline

Definition at line 135 of file snd_Channel.h.

◆ SetSilence()

void nw4r::snd::detail::Channel::SetSilence ( bool silenceFlag,
int fadeTimes )
inline

Definition at line 136 of file snd_Channel.h.

◆ SetKey()

void nw4r::snd::detail::Channel::SetKey ( int key)
inline

Definition at line 144 of file snd_Channel.h.

◆ SetOriginalKey()

void nw4r::snd::detail::Channel::SetOriginalKey ( int key)
inline

Definition at line 145 of file snd_Channel.h.

◆ SetLength()

void nw4r::snd::detail::Channel::SetLength ( s32 length)
inline

Definition at line 146 of file snd_Channel.h.

◆ SetPanMode()

void nw4r::snd::detail::Channel::SetPanMode ( PanMode panMode)
inline

Definition at line 147 of file snd_Channel.h.

◆ SetPanCurve()

void nw4r::snd::detail::Channel::SetPanCurve ( PanCurve panCurve)
inline

Definition at line 148 of file snd_Channel.h.

◆ SetAlternateAssignId()

void nw4r::snd::detail::Channel::SetAlternateAssignId ( int id)
inline

Definition at line 149 of file snd_Channel.h.

◆ SetWaveDataLocationCallback()

void nw4r::snd::detail::Channel::SetWaveDataLocationCallback ( WaveDataLocationCallback * callback,
WaveInfo const * waveInfo )
inline

Definition at line 150 of file snd_Channel.h.

◆ SetVoiceOutParam()

void nw4r::snd::detail::Channel::SetVoiceOutParam ( int index,
VoiceOutParam const & param )
inline

Definition at line 156 of file snd_Channel.h.

◆ SetNextTrackChannel()

void nw4r::snd::detail::Channel::SetNextTrackChannel ( Channel * channel)
inline

Definition at line 160 of file snd_Channel.h.

Member Data Documentation

◆ SILENCE_VOLUME_MIN

u8 const nw4r::snd::detail::Channel::SILENCE_VOLUME_MIN = 0
static

Definition at line 179 of file snd_Channel.h.

◆ SILENCE_VOLUME_MAX

u8 const nw4r::snd::detail::Channel::SILENCE_VOLUME_MAX = 255
static

Definition at line 180 of file snd_Channel.h.

◆ ORIGINAL_KEY_INIT

int const nw4r::snd::detail::Channel::ORIGINAL_KEY_INIT = 60
static

Definition at line 182 of file snd_Channel.h.

◆ KEY_INIT

int const nw4r::snd::detail::Channel::KEY_INIT = 60
static

Definition at line 183 of file snd_Channel.h.

◆ PRIORITY_RELEASE

int const nw4r::snd::detail::Channel::PRIORITY_RELEASE = 1
static

Definition at line 185 of file snd_Channel.h.

◆ CHANNEL_MAX

int const nw4r::snd::detail::Channel::CHANNEL_MAX = Voice::CHANNEL_MAX
static

Definition at line 187 of file snd_Channel.h.

◆ CHANNEL_MIN

int const nw4r::snd::detail::Channel::CHANNEL_MIN = 1
static

Definition at line 188 of file snd_Channel.h.

◆ CHANNEL_NUM

int const nw4r::snd::detail::Channel::CHANNEL_NUM
static

Definition at line 189 of file snd_Channel.h.

◆ mEnvelope

EnvGenerator nw4r::snd::detail::Channel::mEnvelope
private

Definition at line 193 of file snd_Channel.h.

◆ mLfo

Lfo nw4r::snd::detail::Channel::mLfo
private

Definition at line 194 of file snd_Channel.h.

◆ mLfoTarget

u8 nw4r::snd::detail::Channel::mLfoTarget
private

Definition at line 195 of file snd_Channel.h.

◆ mPauseFlag

bool nw4r::snd::detail::Channel::mPauseFlag
private

Definition at line 196 of file snd_Channel.h.

◆ mActiveFlag

bool nw4r::snd::detail::Channel::mActiveFlag
private

Definition at line 197 of file snd_Channel.h.

◆ mAllocFlag

bool nw4r::snd::detail::Channel::mAllocFlag
private

Definition at line 198 of file snd_Channel.h.

◆ mAutoSweep

bool nw4r::snd::detail::Channel::mAutoSweep
private

Definition at line 199 of file snd_Channel.h.

◆ mReleasePriorityFixFlag

bool nw4r::snd::detail::Channel::mReleasePriorityFixFlag
private

Definition at line 200 of file snd_Channel.h.

◆ mReleaseIgnoreFlag

u8 nw4r::snd::detail::Channel::mReleaseIgnoreFlag
private

Definition at line 201 of file snd_Channel.h.

◆ mBiquadType

u8 nw4r::snd::detail::Channel::mBiquadType
private

Definition at line 202 of file snd_Channel.h.

◆ mRemoteFilter

u8 nw4r::snd::detail::Channel::mRemoteFilter
private

Definition at line 203 of file snd_Channel.h.

◆ mUserVolume

f32 nw4r::snd::detail::Channel::mUserVolume
private

Definition at line 205 of file snd_Channel.h.

◆ mUserPitchRatio

f32 nw4r::snd::detail::Channel::mUserPitchRatio
private

Definition at line 206 of file snd_Channel.h.

◆ mUserPan

f32 nw4r::snd::detail::Channel::mUserPan
private

Definition at line 207 of file snd_Channel.h.

◆ mUserSurroundPan

f32 nw4r::snd::detail::Channel::mUserSurroundPan
private

Definition at line 208 of file snd_Channel.h.

◆ mUserLpfFreq

f32 nw4r::snd::detail::Channel::mUserLpfFreq
private

Definition at line 209 of file snd_Channel.h.

◆ mBiquadValue

f32 nw4r::snd::detail::Channel::mBiquadValue
private

Definition at line 210 of file snd_Channel.h.

◆ mOutputLineFlag

int nw4r::snd::detail::Channel::mOutputLineFlag
private

Definition at line 211 of file snd_Channel.h.

◆ mMainOutVolume

f32 nw4r::snd::detail::Channel::mMainOutVolume
private

Definition at line 212 of file snd_Channel.h.

◆ mMainSend

f32 nw4r::snd::detail::Channel::mMainSend
private

Definition at line 213 of file snd_Channel.h.

◆ mFxSend

f32 nw4r::snd::detail::Channel::mFxSend[AUX_BUS_NUM]
private

Definition at line 214 of file snd_Channel.h.

◆ mRemoteOutVolume

f32 nw4r::snd::detail::Channel::mRemoteOutVolume[4]
private

Definition at line 215 of file snd_Channel.h.

◆ mUserPitch

f32 nw4r::snd::detail::Channel::mUserPitch
private

Definition at line 216 of file snd_Channel.h.

◆ mSweepPitch

f32 nw4r::snd::detail::Channel::mSweepPitch
private

Definition at line 217 of file snd_Channel.h.

◆ mSweepCounter

s32 nw4r::snd::detail::Channel::mSweepCounter
private

Definition at line 218 of file snd_Channel.h.

◆ mSweepLength

s32 nw4r::snd::detail::Channel::mSweepLength
private

Definition at line 219 of file snd_Channel.h.

◆ mInitVolume

f32 nw4r::snd::detail::Channel::mInitVolume
private

Definition at line 220 of file snd_Channel.h.

◆ mInitPan

f32 nw4r::snd::detail::Channel::mInitPan
private

Definition at line 221 of file snd_Channel.h.

◆ mInitSurroundPan

f32 nw4r::snd::detail::Channel::mInitSurroundPan
private

Definition at line 222 of file snd_Channel.h.

◆ mTune

f32 nw4r::snd::detail::Channel::mTune
private

Definition at line 223 of file snd_Channel.h.

◆ mSilenceVolume

MoveValue<u8, u16> nw4r::snd::detail::Channel::mSilenceVolume
private

Definition at line 224 of file snd_Channel.h.

◆ mKey

int nw4r::snd::detail::Channel::mKey
private

Definition at line 226 of file snd_Channel.h.

◆ mOriginalKey

int nw4r::snd::detail::Channel::mOriginalKey
private

Definition at line 227 of file snd_Channel.h.

◆ mLength

s32 nw4r::snd::detail::Channel::mLength
private

Definition at line 228 of file snd_Channel.h.

◆ mPanMode

PanMode nw4r::snd::detail::Channel::mPanMode
private

Definition at line 229 of file snd_Channel.h.

◆ mPanCurve

PanCurve nw4r::snd::detail::Channel::mPanCurve
private

Definition at line 230 of file snd_Channel.h.

◆ mAlternateAssign

int nw4r::snd::detail::Channel::mAlternateAssign
private

Definition at line 231 of file snd_Channel.h.

◆ mCallback

Callback* nw4r::snd::detail::Channel::mCallback
private

Definition at line 232 of file snd_Channel.h.

◆ mCallbackData

ulong nw4r::snd::detail::Channel::mCallbackData
private

Definition at line 233 of file snd_Channel.h.

◆ mWaveDataLocationCallback

WaveDataLocationCallback* nw4r::snd::detail::Channel::mWaveDataLocationCallback
private

Definition at line 234 of file snd_Channel.h.

◆ mWaveInfo

WaveInfo const* nw4r::snd::detail::Channel::mWaveInfo
private

Definition at line 235 of file snd_Channel.h.

◆ mVoice

Voice* nw4r::snd::detail::Channel::mVoice
private

Definition at line 236 of file snd_Channel.h.

◆ mNextLink

Channel* nw4r::snd::detail::Channel::mNextLink
private

Definition at line 237 of file snd_Channel.h.

◆ mLink

ut::LinkListNode nw4r::snd::detail::Channel::mLink

Definition at line 239 of file snd_Channel.h.