Twilight Princess
Decompilation of The Legend of Zelda: Twilight Princess
Loading...
Searching...
No Matches
nw4hbm::snd::detail::StrmPlayer Class Reference

#include <StrmPlayer.h>

+ Inheritance diagram for nw4hbm::snd::detail::StrmPlayer:
+ Collaboration diagram for nw4hbm::snd::detail::StrmPlayer:

Classes

class  LoadCommand
 
class  StrmCallback
 
struct  StrmHeader
 

Public Types

enum  StartOffsetType { START_OFFSET_TYPE_SAMPLE = 0 , START_OFFSET_TYPE_MILLISEC }
 
typedef enum nw4hbm::snd::detail::StrmPlayer::StartOffsetType StartOffsetType
 
typedef struct nw4hbm::snd::detail::StrmPlayer::StrmHeader StrmHeader
 
typedef ut::LinkList< LoadCommand, offsetof(LoadCommand, mLinkNode)> LoadCommandList
 
typedef void(*) NotifyLoadHeaderAsyncEndCallback(bool, const StrmHeader *, void *)
 

Public Member Functions

 StrmPlayer ()
 
virtual bool Start ()
 
virtual void Stop ()
 
virtual void Pause (bool flag)
 
virtual bool IsActive () const
 
virtual bool IsPrepared () const
 
virtual bool IsStarted () const
 
virtual bool IsPause () const
 
virtual void SetVolume (f32 volume)
 
virtual void SetPitch (f32 pitch)
 
virtual void SetPan (f32 pan)
 
virtual void SetSurroundPan (f32 surroundPan)
 
virtual void SetPan2 (f32 pan2)
 
virtual void SetSurroundPan2 (f32 surroundPan2)
 
virtual void SetLpfFreq (f32 lpfFreq)
 
virtual f32 GetVolume () const
 
virtual f32 GetPitch () const
 
virtual f32 GetPan () const
 
virtual f32 GetSurroundPan () const
 
virtual f32 GetPan2 () const
 
virtual f32 GetSurroundPan2 () const
 
virtual f32 GetLpfFreq () const
 
virtual void SetOutputLine (int lineFlag)
 
virtual void SetMainOutVolume (f32 volume)
 
virtual void SetMainSend (f32 send)
 
virtual void SetFxSend (AuxBus bus, f32 send)
 
virtual void SetRemoteOutVolume (int remoteIndex, f32 volume)
 
virtual void SetRemoteSend (int remoteIndex, f32 send)
 
virtual void SetRemoteFxSend (int remoteIndex, f32 send)
 
virtual int GetOutputLine () const
 
virtual f32 GetMainOutVolume () const
 
virtual f32 GetMainSend () const
 
virtual f32 GetFxSend (AuxBus bus) const
 
virtual f32 GetRemoteOutVolume (int remoteIndex) const
 
virtual f32 GetRemoteSend (int remoteIndex) const
 
virtual f32 GetRemoteFxSend (int remoteIndex) const
 
void Setup (const StrmHeader *header)
 
bool SetupPlayer (const StrmHeader *header)
 
void Shutdown ()
 
bool Prepare (StrmBufferPool *bufferPool, StartOffsetType startOffsetType, s32 startOffset, int voices, StrmCallback *callback, u32 callbackData)
 
void InitParam (int voices)
 
void ForceStop ()
 
void Update ()
 

Static Public Member Functions

static void UpdateAllPlayers ()
 
static void StopAllPlayers ()
 
static void UpdateBufferAllPlayers ()
 

Public Attributes

ut::LinkListNode mPlayerLink
 

Static Public Attributes

static const int LOAD_BUFFER_SIZE = 0x4000 + 32
 TODO: How is this calculated?
 

Private Member Functions

bool AllocChannels (int channels, int voices)
 
void FreeChannels ()
 
void UpdateBuffer ()
 
void UpdateLoopAddress (u32 startSample, u32 endSample)
 
void UpdatePlayingBlockIndex ()
 
void UpdateDataLoopAddress (s32 endBlock)
 
void SetLoopEndToZeroBuffer (int endBlock)
 
void UpdateLoadingBlockIndex (LoadCommand::Status status)
 
void UpdatePauseStatus ()
 
int CalcLoadingBufferBlockCount () const
 
bool CalcStartOffset (s32 *blockIndex, u32 *blockOffset, s32 *loopCount)
 

Static Private Member Functions

static void VoiceCallbackFunc (AxVoice *voice, AxVoice::CallbackStatus status, void *pCallbackArg)
 
static void NotifyStrmHeaderAsyncEndCallback (bool result, const StrmHeader *header, void *userData)
 

Private Attributes

StrmInfo mStrmInfo
 
u8 mActiveFlag
 
u8 mStartedFlag
 
u8 mPreparedFlag
 
u8 mPauseFlag
 
u8 mDiskErrorFlag
 
u8 mPauseStatus
 
u8 mLoadWaitFlag
 
u8 mNoRealtimeLoadFlag
 
u8 mSkipUpdateAdpcmLoop
 
u8 mValidAdpcmLoop
 
u8 mPlayFinishFlag
 
u8 mLoadFinishFlag
 
s32 mLoopCounter
 
int mPrepareCounter
 
int mChangeNumBlocks
 
int mDataBlockSize
 
int mBufferBlockCount
 
int mBufferBlockCountBase
 
int mLoadingBufferBlockCount
 
int mLoadingBufferBlockIndex
 
int mLoadingDataBlockIndex
 
int mPlayingBufferBlockCount
 
int mPlayingBufferBlockIndex
 
int mPlayingDataBlockIndex
 
int mLoopStartBlockIndex
 
int mLastBlockIndex
 
StartOffsetType mStartOffsetType
 
int mStartOffset
 
LoadCommandList mFreeLoadCommandList
 
LoadCommandList mFillBufferCommandList
 
LoadCommand mLoadCoammndArray [32]
 
StrmBufferPoolmBufferPool
 
StrmCallbackmCallback
 
u32 mCallbackData
 
AxVoicemVoice
 
f32 mExtVolume
 
f32 mExtPan
 
f32 mExtSurroundPan
 
f32 mExtPan2
 
f32 mExtSurroundPan2
 
f32 mExtPitch
 
f32 mExtLpfFreq
 
int mOutputLineFlag
 
f32 mMainOutVolume
 
f32 mMainSend
 
f32 mFxSend [AUX_BUS_NUM]
 
f32 mRemoteOutVolume [WPAD_MAX_CONTROLLERS]
 
f32 mRemoteSend [WPAD_MAX_CONTROLLERS]
 
f32 mRemoteFxSend [WPAD_MAX_CONTROLLERS]
 
s32 mChannelCount
 
s32 mVoiceOutCount
 
StrmChannel mChannels [CHANNEL_MAX]
 
u16 mAdpcmPredScale [CHANNEL_MAX]
 

Static Private Attributes

static const int DATA_BLOCK_COUNT_MIN = 4
 
static const int DATA_BLOCK_COUNT_MAX = 32
 
static const int DATA_BLOCK_SIZE_MAX = 0x2000
 

Member Typedef Documentation

◆ LoadCommandList

◆ NotifyLoadHeaderAsyncEndCallback

void(*) nw4hbm::snd::detail::StrmPlayer::NotifyLoadHeaderAsyncEndCallback(bool, const StrmHeader *, void *)

◆ StartOffsetType

◆ StrmHeader

struct nw4hbm::snd::detail::StrmPlayer::StrmHeader nw4hbm::snd::detail::StrmPlayer::StrmHeader

Member Enumeration Documentation

◆ StartOffsetType

Enumerator
START_OFFSET_TYPE_SAMPLE 
START_OFFSET_TYPE_MILLISEC 

Constructor & Destructor Documentation

◆ StrmPlayer()

nw4hbm::snd::detail::StrmPlayer::StrmPlayer ( )

Member Function Documentation

◆ AllocChannels()

bool nw4hbm::snd::detail::StrmPlayer::AllocChannels ( int channels,
int voices )
private

◆ CalcLoadingBufferBlockCount()

int nw4hbm::snd::detail::StrmPlayer::CalcLoadingBufferBlockCount ( ) const
private

◆ CalcStartOffset()

bool nw4hbm::snd::detail::StrmPlayer::CalcStartOffset ( s32 * blockIndex,
u32 * blockOffset,
s32 * loopCount )
private

◆ ForceStop()

void nw4hbm::snd::detail::StrmPlayer::ForceStop ( )

◆ FreeChannels()

void nw4hbm::snd::detail::StrmPlayer::FreeChannels ( )
private

◆ GetFxSend()

virtual f32 nw4hbm::snd::detail::StrmPlayer::GetFxSend ( AuxBus bus) const
virtual

◆ GetLpfFreq()

virtual f32 nw4hbm::snd::detail::StrmPlayer::GetLpfFreq ( ) const
inlinevirtual

◆ GetMainOutVolume()

virtual f32 nw4hbm::snd::detail::StrmPlayer::GetMainOutVolume ( ) const
virtual

◆ GetMainSend()

virtual f32 nw4hbm::snd::detail::StrmPlayer::GetMainSend ( ) const
virtual

◆ GetOutputLine()

virtual int nw4hbm::snd::detail::StrmPlayer::GetOutputLine ( ) const
virtual

◆ GetPan()

virtual f32 nw4hbm::snd::detail::StrmPlayer::GetPan ( ) const
inlinevirtual

◆ GetPan2()

virtual f32 nw4hbm::snd::detail::StrmPlayer::GetPan2 ( ) const
inlinevirtual

◆ GetPitch()

virtual f32 nw4hbm::snd::detail::StrmPlayer::GetPitch ( ) const
inlinevirtual

◆ GetRemoteFxSend()

virtual f32 nw4hbm::snd::detail::StrmPlayer::GetRemoteFxSend ( int remoteIndex) const
virtual

◆ GetRemoteOutVolume()

virtual f32 nw4hbm::snd::detail::StrmPlayer::GetRemoteOutVolume ( int remoteIndex) const
virtual

◆ GetRemoteSend()

virtual f32 nw4hbm::snd::detail::StrmPlayer::GetRemoteSend ( int remoteIndex) const
virtual

◆ GetSurroundPan()

virtual f32 nw4hbm::snd::detail::StrmPlayer::GetSurroundPan ( ) const
inlinevirtual

◆ GetSurroundPan2()

virtual f32 nw4hbm::snd::detail::StrmPlayer::GetSurroundPan2 ( ) const
inlinevirtual

◆ GetVolume()

virtual f32 nw4hbm::snd::detail::StrmPlayer::GetVolume ( ) const
inlinevirtual

◆ InitParam()

void nw4hbm::snd::detail::StrmPlayer::InitParam ( int voices)

◆ IsActive()

virtual bool nw4hbm::snd::detail::StrmPlayer::IsActive ( ) const
inlinevirtual

◆ IsPause()

virtual bool nw4hbm::snd::detail::StrmPlayer::IsPause ( ) const
inlinevirtual

◆ IsPrepared()

virtual bool nw4hbm::snd::detail::StrmPlayer::IsPrepared ( ) const
inlinevirtual

◆ IsStarted()

virtual bool nw4hbm::snd::detail::StrmPlayer::IsStarted ( ) const
inlinevirtual

◆ NotifyStrmHeaderAsyncEndCallback()

static void nw4hbm::snd::detail::StrmPlayer::NotifyStrmHeaderAsyncEndCallback ( bool result,
const StrmHeader * header,
void * userData )
staticprivate

◆ Pause()

virtual void nw4hbm::snd::detail::StrmPlayer::Pause ( bool flag)
virtual

◆ Prepare()

bool nw4hbm::snd::detail::StrmPlayer::Prepare ( StrmBufferPool * bufferPool,
StartOffsetType startOffsetType,
s32 startOffset,
int voices,
StrmCallback * callback,
u32 callbackData )

◆ SetFxSend()

virtual void nw4hbm::snd::detail::StrmPlayer::SetFxSend ( AuxBus bus,
f32 send )
virtual

◆ SetLoopEndToZeroBuffer()

void nw4hbm::snd::detail::StrmPlayer::SetLoopEndToZeroBuffer ( int endBlock)
private

◆ SetLpfFreq()

virtual void nw4hbm::snd::detail::StrmPlayer::SetLpfFreq ( f32 lpfFreq)
inlinevirtual

◆ SetMainOutVolume()

virtual void nw4hbm::snd::detail::StrmPlayer::SetMainOutVolume ( f32 volume)
virtual

◆ SetMainSend()

virtual void nw4hbm::snd::detail::StrmPlayer::SetMainSend ( f32 send)
virtual

◆ SetOutputLine()

virtual void nw4hbm::snd::detail::StrmPlayer::SetOutputLine ( int lineFlag)
virtual

◆ SetPan()

virtual void nw4hbm::snd::detail::StrmPlayer::SetPan ( f32 pan)
inlinevirtual

◆ SetPan2()

virtual void nw4hbm::snd::detail::StrmPlayer::SetPan2 ( f32 pan2)
inlinevirtual

◆ SetPitch()

virtual void nw4hbm::snd::detail::StrmPlayer::SetPitch ( f32 pitch)
inlinevirtual

◆ SetRemoteFxSend()

virtual void nw4hbm::snd::detail::StrmPlayer::SetRemoteFxSend ( int remoteIndex,
f32 send )
virtual

◆ SetRemoteOutVolume()

virtual void nw4hbm::snd::detail::StrmPlayer::SetRemoteOutVolume ( int remoteIndex,
f32 volume )
virtual

◆ SetRemoteSend()

virtual void nw4hbm::snd::detail::StrmPlayer::SetRemoteSend ( int remoteIndex,
f32 send )
virtual

◆ SetSurroundPan()

virtual void nw4hbm::snd::detail::StrmPlayer::SetSurroundPan ( f32 surroundPan)
inlinevirtual

◆ SetSurroundPan2()

virtual void nw4hbm::snd::detail::StrmPlayer::SetSurroundPan2 ( f32 surroundPan2)
inlinevirtual

◆ Setup()

void nw4hbm::snd::detail::StrmPlayer::Setup ( const StrmHeader * header)

◆ SetupPlayer()

bool nw4hbm::snd::detail::StrmPlayer::SetupPlayer ( const StrmHeader * header)

◆ SetVolume()

virtual void nw4hbm::snd::detail::StrmPlayer::SetVolume ( f32 volume)
inlinevirtual

◆ Shutdown()

void nw4hbm::snd::detail::StrmPlayer::Shutdown ( )

◆ Start()

virtual bool nw4hbm::snd::detail::StrmPlayer::Start ( )
virtual

◆ Stop()

virtual void nw4hbm::snd::detail::StrmPlayer::Stop ( )
virtual

◆ StopAllPlayers()

static void nw4hbm::snd::detail::StrmPlayer::StopAllPlayers ( )
static

◆ Update()

void nw4hbm::snd::detail::StrmPlayer::Update ( )

◆ UpdateAllPlayers()

static void nw4hbm::snd::detail::StrmPlayer::UpdateAllPlayers ( )
static

◆ UpdateBuffer()

void nw4hbm::snd::detail::StrmPlayer::UpdateBuffer ( )
private

◆ UpdateBufferAllPlayers()

static void nw4hbm::snd::detail::StrmPlayer::UpdateBufferAllPlayers ( )
static

◆ UpdateDataLoopAddress()

void nw4hbm::snd::detail::StrmPlayer::UpdateDataLoopAddress ( s32 endBlock)
private

◆ UpdateLoadingBlockIndex()

void nw4hbm::snd::detail::StrmPlayer::UpdateLoadingBlockIndex ( LoadCommand::Status status)
private

◆ UpdateLoopAddress()

void nw4hbm::snd::detail::StrmPlayer::UpdateLoopAddress ( u32 startSample,
u32 endSample )
private

◆ UpdatePauseStatus()

void nw4hbm::snd::detail::StrmPlayer::UpdatePauseStatus ( )
private

◆ UpdatePlayingBlockIndex()

void nw4hbm::snd::detail::StrmPlayer::UpdatePlayingBlockIndex ( )
private

◆ VoiceCallbackFunc()

static void nw4hbm::snd::detail::StrmPlayer::VoiceCallbackFunc ( AxVoice * voice,
AxVoice::CallbackStatus status,
void * pCallbackArg )
staticprivate

Member Data Documentation

◆ DATA_BLOCK_COUNT_MAX

const int nw4hbm::snd::detail::StrmPlayer::DATA_BLOCK_COUNT_MAX = 32
staticprivate

◆ DATA_BLOCK_COUNT_MIN

const int nw4hbm::snd::detail::StrmPlayer::DATA_BLOCK_COUNT_MIN = 4
staticprivate

◆ DATA_BLOCK_SIZE_MAX

const int nw4hbm::snd::detail::StrmPlayer::DATA_BLOCK_SIZE_MAX = 0x2000
staticprivate

◆ LOAD_BUFFER_SIZE

const int nw4hbm::snd::detail::StrmPlayer::LOAD_BUFFER_SIZE = 0x4000 + 32
static

TODO: How is this calculated?

◆ mActiveFlag

u8 nw4hbm::snd::detail::StrmPlayer::mActiveFlag
private

◆ mAdpcmPredScale

u16 nw4hbm::snd::detail::StrmPlayer::mAdpcmPredScale[CHANNEL_MAX]
private

◆ mBufferBlockCount

int nw4hbm::snd::detail::StrmPlayer::mBufferBlockCount
private

◆ mBufferBlockCountBase

int nw4hbm::snd::detail::StrmPlayer::mBufferBlockCountBase
private

◆ mBufferPool

StrmBufferPool* nw4hbm::snd::detail::StrmPlayer::mBufferPool
private

◆ mCallback

StrmCallback* nw4hbm::snd::detail::StrmPlayer::mCallback
private

◆ mCallbackData

u32 nw4hbm::snd::detail::StrmPlayer::mCallbackData
private

◆ mChangeNumBlocks

int nw4hbm::snd::detail::StrmPlayer::mChangeNumBlocks
private

◆ mChannelCount

s32 nw4hbm::snd::detail::StrmPlayer::mChannelCount
private

◆ mChannels

StrmChannel nw4hbm::snd::detail::StrmPlayer::mChannels[CHANNEL_MAX]
private

◆ mDataBlockSize

int nw4hbm::snd::detail::StrmPlayer::mDataBlockSize
private

◆ mDiskErrorFlag

u8 nw4hbm::snd::detail::StrmPlayer::mDiskErrorFlag
private

◆ mExtLpfFreq

f32 nw4hbm::snd::detail::StrmPlayer::mExtLpfFreq
private

◆ mExtPan

f32 nw4hbm::snd::detail::StrmPlayer::mExtPan
private

◆ mExtPan2

f32 nw4hbm::snd::detail::StrmPlayer::mExtPan2
private

◆ mExtPitch

f32 nw4hbm::snd::detail::StrmPlayer::mExtPitch
private

◆ mExtSurroundPan

f32 nw4hbm::snd::detail::StrmPlayer::mExtSurroundPan
private

◆ mExtSurroundPan2

f32 nw4hbm::snd::detail::StrmPlayer::mExtSurroundPan2
private

◆ mExtVolume

f32 nw4hbm::snd::detail::StrmPlayer::mExtVolume
private

◆ mFillBufferCommandList

LoadCommandList nw4hbm::snd::detail::StrmPlayer::mFillBufferCommandList
private

◆ mFreeLoadCommandList

LoadCommandList nw4hbm::snd::detail::StrmPlayer::mFreeLoadCommandList
private

◆ mFxSend

f32 nw4hbm::snd::detail::StrmPlayer::mFxSend[AUX_BUS_NUM]
private

◆ mLastBlockIndex

int nw4hbm::snd::detail::StrmPlayer::mLastBlockIndex
private

◆ mLoadCoammndArray

LoadCommand nw4hbm::snd::detail::StrmPlayer::mLoadCoammndArray[32]
private

◆ mLoadFinishFlag

u8 nw4hbm::snd::detail::StrmPlayer::mLoadFinishFlag
private

◆ mLoadingBufferBlockCount

int nw4hbm::snd::detail::StrmPlayer::mLoadingBufferBlockCount
private

◆ mLoadingBufferBlockIndex

int nw4hbm::snd::detail::StrmPlayer::mLoadingBufferBlockIndex
private

◆ mLoadingDataBlockIndex

int nw4hbm::snd::detail::StrmPlayer::mLoadingDataBlockIndex
private

◆ mLoadWaitFlag

u8 nw4hbm::snd::detail::StrmPlayer::mLoadWaitFlag
private

◆ mLoopCounter

s32 nw4hbm::snd::detail::StrmPlayer::mLoopCounter
private

◆ mLoopStartBlockIndex

int nw4hbm::snd::detail::StrmPlayer::mLoopStartBlockIndex
private

◆ mMainOutVolume

f32 nw4hbm::snd::detail::StrmPlayer::mMainOutVolume
private

◆ mMainSend

f32 nw4hbm::snd::detail::StrmPlayer::mMainSend
private

◆ mNoRealtimeLoadFlag

u8 nw4hbm::snd::detail::StrmPlayer::mNoRealtimeLoadFlag
private

◆ mOutputLineFlag

int nw4hbm::snd::detail::StrmPlayer::mOutputLineFlag
private

◆ mPauseFlag

u8 nw4hbm::snd::detail::StrmPlayer::mPauseFlag
private

◆ mPauseStatus

u8 nw4hbm::snd::detail::StrmPlayer::mPauseStatus
private

◆ mPlayerLink

ut::LinkListNode nw4hbm::snd::detail::StrmPlayer::mPlayerLink

◆ mPlayFinishFlag

u8 nw4hbm::snd::detail::StrmPlayer::mPlayFinishFlag
private

◆ mPlayingBufferBlockCount

int nw4hbm::snd::detail::StrmPlayer::mPlayingBufferBlockCount
private

◆ mPlayingBufferBlockIndex

int nw4hbm::snd::detail::StrmPlayer::mPlayingBufferBlockIndex
private

◆ mPlayingDataBlockIndex

int nw4hbm::snd::detail::StrmPlayer::mPlayingDataBlockIndex
private

◆ mPrepareCounter

int nw4hbm::snd::detail::StrmPlayer::mPrepareCounter
private

◆ mPreparedFlag

u8 nw4hbm::snd::detail::StrmPlayer::mPreparedFlag
private

◆ mRemoteFxSend

f32 nw4hbm::snd::detail::StrmPlayer::mRemoteFxSend[WPAD_MAX_CONTROLLERS]
private

◆ mRemoteOutVolume

f32 nw4hbm::snd::detail::StrmPlayer::mRemoteOutVolume[WPAD_MAX_CONTROLLERS]
private

◆ mRemoteSend

f32 nw4hbm::snd::detail::StrmPlayer::mRemoteSend[WPAD_MAX_CONTROLLERS]
private

◆ mSkipUpdateAdpcmLoop

u8 nw4hbm::snd::detail::StrmPlayer::mSkipUpdateAdpcmLoop
private

◆ mStartedFlag

u8 nw4hbm::snd::detail::StrmPlayer::mStartedFlag
private

◆ mStartOffset

int nw4hbm::snd::detail::StrmPlayer::mStartOffset
private

◆ mStartOffsetType

StartOffsetType nw4hbm::snd::detail::StrmPlayer::mStartOffsetType
private

◆ mStrmInfo

StrmInfo nw4hbm::snd::detail::StrmPlayer::mStrmInfo
private

◆ mValidAdpcmLoop

u8 nw4hbm::snd::detail::StrmPlayer::mValidAdpcmLoop
private

◆ mVoice

AxVoice* nw4hbm::snd::detail::StrmPlayer::mVoice
private

◆ mVoiceOutCount

s32 nw4hbm::snd::detail::StrmPlayer::mVoiceOutCount
private

The documentation for this class was generated from the following file: