NSMBW-Decomp
A decompilation of New Super Mario Bros. Wii
Loading...
Searching...
No Matches
nw4r::snd::detail::StrmPlayer Class Reference
Inheritance diagram for nw4r::snd::detail::StrmPlayer:
[legend]

Description

Definition at line 47 of file snd_StrmPlayer.h.

Classes

class  StrmDataLoadTask
 
class  StrmHeaderLoadTask
 
struct  StrmTrack
 

Public Types

enum  StartOffsetType {
  START_OFFSET_TYPE_SAMPLE ,
  START_OFFSET_TYPE_MILLISEC
}
 
enum  SetupResult {
  SETUP_SUCCESS ,
  SETUP_ERR_CANNOT_ALLOCATE_BUFFER ,
  SETUP_ERR_UNKNOWN
}
 
- Public Types inherited from nw4r::snd::detail::SoundThread::PlayerCallback
typedef ut::LinkList< PlayerCallback, 0x00 > LinkList
 

Public Member Functions

virtual bool Start ()
 
virtual void Stop ()
 
virtual void Pause (bool flag)
 
virtual bool IsActive () const
 
virtual bool IsStarted () const
 
virtual bool IsPause () const
 
virtual void OnUpdateFrameSoundThread ()
 
virtual void OnUpdateVoiceSoundThread ()
 
virtual void OnShutdownSoundThread ()
 
SetupResult Setup (StrmBufferPool *bufferPool, int allocChannelCount, u16 allocTrackFlag, int voiceOutCount)
 
void Update ()
 
void Shutdown ()
 
bool IsPrepared () const
 
StrmChannelGetTrackChannel (StrmTrack const &track, int channelIndex)
 
StrmTrackGetPlayerTrack (int trackNo)
 
void SetTaskErrorFlag ()
 
void SetTaskCancelFlag ()
 
bool IsAdpcm () const
 
bool CheckDiskDriveError () const
 
void SetAdpcmLoopContext (int channelNum, u16 *predScale)
 
void SetTrackVolume (ulong trackBitFlag, f32 volume)
 
ulong GetPlaySamplePosition () const
 
bool ReadStrmDataInfo (StrmDataInfo *) const
 
void InitParam ()
 
bool SetupPlayer ()
 
bool Prepare (ut::FileStream *fileStream, StartOffsetType startOffsetType, int startOffset)
 
bool LoadHeader (ut::FileStream *fileStream, StartOffsetType startOffsetType, int startOffset)
 
bool LoadStreamData (ut::FileStream *fileStream, int offset, ulong size, ulong blockSize, int bufferBlockIndex, bool needUpdateAdpcmLoop)
 
bool AllocStrmBuffers ()
 
void FreeStrmBuffers ()
 
bool AllocVoices (int voiceOutCount)
 
void FreeVoices ()
 
int CalcLoadingBufferBlockCount () const
 
bool CalcStartOffset (s32 *startBlockIndex, ulong *startBlockOffset, s32 *loopCount)
 
void SetLoopEndToZeroBuffer (int endBufferBlockIndex)
 
void UpdateBuffer ()
 
void UpdatePauseStatus ()
 
void UpdateLoadingBlockIndex ()
 
void UpdatePlayingBlockIndex ()
 
void UpdateLoopAddress (ulong loopStartSamples, ulong loopEndSamples)
 
void UpdateDataLoopAddress (s32 endBlockBufferIndex)
 
void UpdateVoiceParams (StrmTrack *track)
 
- Public Member Functions inherited from nw4r::snd::detail::BasicPlayer
void InitParam ()
 
void SetRemoteOutVolume (int remote, f32 volume)
 
f32 GetRemoteOutVolume (int remote) const
 
f32 GetVolume () const
 
f32 GetPitch () const
 
f32 GetPan () const
 
f32 GetSurroundPan () const
 
f32 GetLpfFreq () const
 
f32 GetBiquadValue () const
 
int GetBiquadType () const
 
int GetRemoteFilter () const
 
int GetOutputLine () const
 
f32 GetMainOutVolume () const
 
f32 GetMainSend () const
 
PanMode GetPanMode () const
 
PanCurve GetPanCurve () const
 
f32 GetFxSend (AuxBus bus) const
 
VoiceOutParam const & GetVoiceOutParam (int index) const
 
ulong GetId () const
 
void SetVolume (f32 volume)
 
void SetPitch (f32 pitch)
 
void SetPan (f32 pan)
 
void SetSurroundPan (f32 surroundPan)
 
void SetLpfFreq (f32 lpfFreq)
 
void SetBiquadFilter (int type, f32 value)
 
void SetRemoteFilter (int filter)
 
void SetOutputLine (int lineFlag)
 
void SetMainOutVolume (f32 volume)
 
void SetMainSend (f32 send)
 
void SetPanMode (PanMode panMode)
 
void SetPanCurve (PanCurve panCurve)
 
void SetFxSend (AuxBus bus, f32 send)
 
void SetVoiceOutParam (int index, VoiceOutParam const &param)
 
void SetId (ulong id)
 

Static Public Member Functions

static ulong GetSampleByByte (ulong byte, SampleFormat format)
 

Static Public Attributes

static int const LOAD_BUFFER_SIZE = 0x4000
 
static int const LOAD_BUFFER_CHANNEL_NUM
 
static int const BUFFER_BLOCK_COUNT_MAX = 32
 
static int const STRM_CHANNEL_NUM_PER_TRACK
 
static int const STRM_CHANNEL_NUM = 16
 
static int const DATA_BLOCK_SIZE_MAX = 0x2000
 
static int const STRM_TRACK_NUM = 8
 

Static Private Member Functions

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

Private Attributes

StrmFileReader::StrmInfo mStrmInfo
 
bool volatile mSetupFlag
 
bool mActiveFlag
 
bool mStartedFlag
 
bool mPreparedFlag
 
bool mTaskErrorFlag
 
bool mTaskCancelFlag
 
bool mLoadingDelayFlag
 
bool mPauseFlag
 
bool mPauseStatus
 
bool mLoadWaitFlag
 
bool mNoRealtimeLoadFlag
 
bool mSkipUpdateAdpcmLoop
 
bool mValidAdpcmLoop
 
bool mPlayFinishFlag
 
bool mLoadFinishFlag
 
bool mAllocStrmBufferFlag
 
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
 
int mLoadWaitCount
 
StartOffsetType mStartOffsetType
 
int mStartOffset
 
StrmHeaderLoadTask mStrmHeaderLoadTask
 
StrmDataLoadTask::LinkList mStrmDataLoadTaskList
 
InstancePool< StrmDataLoadTaskmStrmDataLoadTaskPool
 
StrmDataLoadTask mStrmDataLoadTaskArea [BUFFER_BLOCK_COUNT_MAX]
 
StrmBufferPoolmBufferPool
 
ut::FileStreammFileStream
 
s32 mTrackCount
 
s32 mChannelCount
 
s32 mVoiceOutCount
 
StrmChannel mChannels [STRM_CHANNEL_NUM]
 
StrmTrack mTracks [STRM_TRACK_NUM]
 

Static Private Attributes

static bool sStaticInitFlag
 
static OSMutex sLoadBufferMutex
 
static byte_t sLoadBuffer [LOAD_BUFFER_SIZE]
 

Member Enumeration Documentation

◆ StartOffsetType

enum nw4r::snd::detail::StrmPlayer::StartOffsetType

Definition at line 52 of file snd_StrmPlayer.h.

◆ SetupResult

enum nw4r::snd::detail::StrmPlayer::SetupResult

Definition at line 59 of file snd_StrmPlayer.h.

Member Function Documentation

◆ Start()

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

◆ Stop()

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

◆ Pause()

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

◆ IsActive()

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

Implements nw4r::snd::detail::BasicPlayer.

Definition at line 145 of file snd_StrmPlayer.h.

◆ IsStarted()

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

Implements nw4r::snd::detail::BasicPlayer.

Definition at line 146 of file snd_StrmPlayer.h.

◆ IsPause()

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

Implements nw4r::snd::detail::BasicPlayer.

Definition at line 147 of file snd_StrmPlayer.h.

◆ OnUpdateFrameSoundThread()

virtual void nw4r::snd::detail::StrmPlayer::OnUpdateFrameSoundThread ( )
inlinevirtual

Reimplemented from nw4r::snd::detail::SoundThread::PlayerCallback.

Definition at line 150 of file snd_StrmPlayer.h.

◆ OnUpdateVoiceSoundThread()

virtual void nw4r::snd::detail::StrmPlayer::OnUpdateVoiceSoundThread ( )
inlinevirtual

Reimplemented from nw4r::snd::detail::SoundThread::PlayerCallback.

Definition at line 151 of file snd_StrmPlayer.h.

◆ OnShutdownSoundThread()

virtual void nw4r::snd::detail::StrmPlayer::OnShutdownSoundThread ( )
inlinevirtual

Reimplemented from nw4r::snd::detail::SoundThread::PlayerCallback.

Definition at line 152 of file snd_StrmPlayer.h.

◆ IsPrepared()

bool nw4r::snd::detail::StrmPlayer::IsPrepared ( ) const
inline

Definition at line 160 of file snd_StrmPlayer.h.

◆ SetTaskErrorFlag()

void nw4r::snd::detail::StrmPlayer::SetTaskErrorFlag ( )
inline

Definition at line 164 of file snd_StrmPlayer.h.

◆ SetTaskCancelFlag()

void nw4r::snd::detail::StrmPlayer::SetTaskCancelFlag ( )
inline

Definition at line 165 of file snd_StrmPlayer.h.

◆ IsAdpcm()

bool nw4r::snd::detail::StrmPlayer::IsAdpcm ( ) const
inline

Definition at line 167 of file snd_StrmPlayer.h.

Member Data Documentation

◆ LOAD_BUFFER_SIZE

int const nw4r::snd::detail::StrmPlayer::LOAD_BUFFER_SIZE = 0x4000
static

Definition at line 218 of file snd_StrmPlayer.h.

◆ LOAD_BUFFER_CHANNEL_NUM

int const nw4r::snd::detail::StrmPlayer::LOAD_BUFFER_CHANNEL_NUM
static

Definition at line 219 of file snd_StrmPlayer.h.

◆ BUFFER_BLOCK_COUNT_MAX

int const nw4r::snd::detail::StrmPlayer::BUFFER_BLOCK_COUNT_MAX = 32
static

Definition at line 220 of file snd_StrmPlayer.h.

◆ STRM_CHANNEL_NUM_PER_TRACK

int const nw4r::snd::detail::StrmPlayer::STRM_CHANNEL_NUM_PER_TRACK
static

Definition at line 221 of file snd_StrmPlayer.h.

◆ STRM_CHANNEL_NUM

int const nw4r::snd::detail::StrmPlayer::STRM_CHANNEL_NUM = 16
static

Definition at line 222 of file snd_StrmPlayer.h.

◆ DATA_BLOCK_SIZE_MAX

int const nw4r::snd::detail::StrmPlayer::DATA_BLOCK_SIZE_MAX = 0x2000
static

Definition at line 223 of file snd_StrmPlayer.h.

◆ STRM_TRACK_NUM

int const nw4r::snd::detail::StrmPlayer::STRM_TRACK_NUM = 8
static

Definition at line 224 of file snd_StrmPlayer.h.

◆ sStaticInitFlag

bool nw4r::snd::detail::StrmPlayer::sStaticInitFlag
staticprivate

Definition at line 227 of file snd_StrmPlayer.h.

◆ sLoadBufferMutex

OSMutex nw4r::snd::detail::StrmPlayer::sLoadBufferMutex
staticprivate

Definition at line 228 of file snd_StrmPlayer.h.

◆ sLoadBuffer

byte_t nw4r::snd::detail::StrmPlayer::sLoadBuffer[LOAD_BUFFER_SIZE]
staticprivate

Definition at line 229 of file snd_StrmPlayer.h.

◆ mStrmInfo

StrmFileReader::StrmInfo nw4r::snd::detail::StrmPlayer::mStrmInfo
private

Definition at line 235 of file snd_StrmPlayer.h.

◆ mSetupFlag

bool volatile nw4r::snd::detail::StrmPlayer::mSetupFlag
private

Definition at line 236 of file snd_StrmPlayer.h.

◆ mActiveFlag

bool nw4r::snd::detail::StrmPlayer::mActiveFlag
private

Definition at line 237 of file snd_StrmPlayer.h.

◆ mStartedFlag

bool nw4r::snd::detail::StrmPlayer::mStartedFlag
private

Definition at line 238 of file snd_StrmPlayer.h.

◆ mPreparedFlag

bool nw4r::snd::detail::StrmPlayer::mPreparedFlag
private

Definition at line 239 of file snd_StrmPlayer.h.

◆ mTaskErrorFlag

bool nw4r::snd::detail::StrmPlayer::mTaskErrorFlag
private

Definition at line 240 of file snd_StrmPlayer.h.

◆ mTaskCancelFlag

bool nw4r::snd::detail::StrmPlayer::mTaskCancelFlag
private

Definition at line 241 of file snd_StrmPlayer.h.

◆ mLoadingDelayFlag

bool nw4r::snd::detail::StrmPlayer::mLoadingDelayFlag
private

Definition at line 242 of file snd_StrmPlayer.h.

◆ mPauseFlag

bool nw4r::snd::detail::StrmPlayer::mPauseFlag
private

Definition at line 243 of file snd_StrmPlayer.h.

◆ mPauseStatus

bool nw4r::snd::detail::StrmPlayer::mPauseStatus
private

Definition at line 244 of file snd_StrmPlayer.h.

◆ mLoadWaitFlag

bool nw4r::snd::detail::StrmPlayer::mLoadWaitFlag
private

Definition at line 245 of file snd_StrmPlayer.h.

◆ mNoRealtimeLoadFlag

bool nw4r::snd::detail::StrmPlayer::mNoRealtimeLoadFlag
private

Definition at line 246 of file snd_StrmPlayer.h.

◆ mSkipUpdateAdpcmLoop

bool nw4r::snd::detail::StrmPlayer::mSkipUpdateAdpcmLoop
private

Definition at line 247 of file snd_StrmPlayer.h.

◆ mValidAdpcmLoop

bool nw4r::snd::detail::StrmPlayer::mValidAdpcmLoop
private

Definition at line 248 of file snd_StrmPlayer.h.

◆ mPlayFinishFlag

bool nw4r::snd::detail::StrmPlayer::mPlayFinishFlag
private

Definition at line 249 of file snd_StrmPlayer.h.

◆ mLoadFinishFlag

bool nw4r::snd::detail::StrmPlayer::mLoadFinishFlag
private

Definition at line 250 of file snd_StrmPlayer.h.

◆ mAllocStrmBufferFlag

bool nw4r::snd::detail::StrmPlayer::mAllocStrmBufferFlag
private

Definition at line 251 of file snd_StrmPlayer.h.

◆ mLoopCounter

s32 nw4r::snd::detail::StrmPlayer::mLoopCounter
private

Definition at line 252 of file snd_StrmPlayer.h.

◆ mPrepareCounter

int nw4r::snd::detail::StrmPlayer::mPrepareCounter
private

Definition at line 253 of file snd_StrmPlayer.h.

◆ mChangeNumBlocks

int nw4r::snd::detail::StrmPlayer::mChangeNumBlocks
private

Definition at line 254 of file snd_StrmPlayer.h.

◆ mDataBlockSize

int nw4r::snd::detail::StrmPlayer::mDataBlockSize
private

Definition at line 255 of file snd_StrmPlayer.h.

◆ mBufferBlockCount

int nw4r::snd::detail::StrmPlayer::mBufferBlockCount
private

Definition at line 256 of file snd_StrmPlayer.h.

◆ mBufferBlockCountBase

int nw4r::snd::detail::StrmPlayer::mBufferBlockCountBase
private

Definition at line 257 of file snd_StrmPlayer.h.

◆ mLoadingBufferBlockCount

int nw4r::snd::detail::StrmPlayer::mLoadingBufferBlockCount
private

Definition at line 258 of file snd_StrmPlayer.h.

◆ mLoadingBufferBlockIndex

int nw4r::snd::detail::StrmPlayer::mLoadingBufferBlockIndex
private

Definition at line 259 of file snd_StrmPlayer.h.

◆ mLoadingDataBlockIndex

int nw4r::snd::detail::StrmPlayer::mLoadingDataBlockIndex
private

Definition at line 260 of file snd_StrmPlayer.h.

◆ mPlayingBufferBlockCount

int nw4r::snd::detail::StrmPlayer::mPlayingBufferBlockCount
private

Definition at line 261 of file snd_StrmPlayer.h.

◆ mPlayingBufferBlockIndex

int nw4r::snd::detail::StrmPlayer::mPlayingBufferBlockIndex
private

Definition at line 262 of file snd_StrmPlayer.h.

◆ mPlayingDataBlockIndex

int nw4r::snd::detail::StrmPlayer::mPlayingDataBlockIndex
private

Definition at line 263 of file snd_StrmPlayer.h.

◆ mLoopStartBlockIndex

int nw4r::snd::detail::StrmPlayer::mLoopStartBlockIndex
private

Definition at line 264 of file snd_StrmPlayer.h.

◆ mLastBlockIndex

int nw4r::snd::detail::StrmPlayer::mLastBlockIndex
private

Definition at line 265 of file snd_StrmPlayer.h.

◆ mLoadWaitCount

int nw4r::snd::detail::StrmPlayer::mLoadWaitCount
private

Definition at line 266 of file snd_StrmPlayer.h.

◆ mStartOffsetType

StartOffsetType nw4r::snd::detail::StrmPlayer::mStartOffsetType
private

Definition at line 267 of file snd_StrmPlayer.h.

◆ mStartOffset

int nw4r::snd::detail::StrmPlayer::mStartOffset
private

Definition at line 268 of file snd_StrmPlayer.h.

◆ mStrmHeaderLoadTask

StrmHeaderLoadTask nw4r::snd::detail::StrmPlayer::mStrmHeaderLoadTask
private

Definition at line 269 of file snd_StrmPlayer.h.

◆ mStrmDataLoadTaskList

StrmDataLoadTask::LinkList nw4r::snd::detail::StrmPlayer::mStrmDataLoadTaskList
private

Definition at line 270 of file snd_StrmPlayer.h.

◆ mStrmDataLoadTaskPool

InstancePool<StrmDataLoadTask> nw4r::snd::detail::StrmPlayer::mStrmDataLoadTaskPool
private

Definition at line 271 of file snd_StrmPlayer.h.

◆ mStrmDataLoadTaskArea

StrmDataLoadTask nw4r::snd::detail::StrmPlayer::mStrmDataLoadTaskArea[BUFFER_BLOCK_COUNT_MAX]
private

Definition at line 272 of file snd_StrmPlayer.h.

◆ mBufferPool

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

Definition at line 273 of file snd_StrmPlayer.h.

◆ mFileStream

ut::FileStream* nw4r::snd::detail::StrmPlayer::mFileStream
private

Definition at line 274 of file snd_StrmPlayer.h.

◆ mTrackCount

s32 nw4r::snd::detail::StrmPlayer::mTrackCount
private

Definition at line 275 of file snd_StrmPlayer.h.

◆ mChannelCount

s32 nw4r::snd::detail::StrmPlayer::mChannelCount
private

Definition at line 276 of file snd_StrmPlayer.h.

◆ mVoiceOutCount

s32 nw4r::snd::detail::StrmPlayer::mVoiceOutCount
private

Definition at line 277 of file snd_StrmPlayer.h.

◆ mChannels

StrmChannel nw4r::snd::detail::StrmPlayer::mChannels[STRM_CHANNEL_NUM]
private

Definition at line 278 of file snd_StrmPlayer.h.

◆ mTracks

StrmTrack nw4r::snd::detail::StrmPlayer::mTracks[STRM_TRACK_NUM]
private

Definition at line 279 of file snd_StrmPlayer.h.