NW4F Snd
Loading...
Searching...
No Matches
snd_BasicSoundPlayer.h
Go to the documentation of this file.
1#ifndef NW_SND_BASIC_SOUND_PLAYER_H_
2#define NW_SND_BASIC_SOUND_PLAYER_H_
3
4#include <nw/snd/snd_Global.h>
5#include <nw/snd/snd_HardwareManager.h>
6#include <nw/snd/snd_PlayerHeapDataManager.h>
7#include <nw/ut/os/ut_Event.h>
8
9namespace nw { namespace snd { namespace internal { namespace driver {
10
32static_assert(sizeof(PlayerParamSet) == 0x8C);
33
35{
36public:
38 virtual ~BasicSoundPlayer() {};
39
40 virtual void Initialize();
41 virtual void Finalize();
42
43 virtual void Start() = 0;
44 virtual void Stop() = 0;
45 virtual void Pause(bool flag) = 0;
46
47 bool IsActive() const { return m_ActiveFlag; }
48 bool IsStarted() const { return m_StartedFlag; }
49 bool IsPause() const { return m_PauseFlag; }
50 bool IsPlayFinished() const { return m_FinishFlag; }
55
56 void SetVolume(f32 volume) { m_PlayerParamSet.volume = volume; }
57 void SetPitch(f32 pitch) { m_PlayerParamSet.pitch = pitch; }
58 void SetLpfFreq(f32 lpfFreq) { m_PlayerParamSet.lpfFreq = lpfFreq; }
59 void SetBiquadFilter(int type, f32 value);
60 void SetPanMode(PanMode mode) { m_PlayerParamSet.panMode = mode; }
61 void SetPanCurve(PanCurve curve) { m_PlayerParamSet.panCurve = curve; }
62 void SetFrontBypass(bool frontBypass) { m_PlayerParamSet.isFrontBypass = frontBypass; }
63 void SetRemoteFilter(int filter) { /* NW_MINMAX_ASSERT(filter,0,0xff); */ m_PlayerParamSet.remoteFilter = static_cast<u8>(filter); }
64 void SetVoiceRendererType(VoiceRendererType mode) { m_PlayerParamSet.rendererType = mode; }
65
66 f32 GetVolume() const { return m_PlayerParamSet.volume; }
67 f32 GetPitch() const { return m_PlayerParamSet.pitch; }
68 f32 GetLpfFreq() const { return m_PlayerParamSet.lpfFreq; }
69 int GetBiquadFilterType() const { return m_PlayerParamSet.biquadType; }
70 f32 GetBiquadFilterValue() const { return m_PlayerParamSet.biquadValue; }
71 PanMode GetPanMode() const { return m_PlayerParamSet.panMode; }
72 PanCurve GetPanCurve() const { return m_PlayerParamSet.panCurve; }
73 bool IsFrontBypass() const { return m_PlayerParamSet.isFrontBypass; }
74 u8 GetRemoteFilter() const { return m_PlayerParamSet.remoteFilter; }
75 VoiceRendererType GetVoiceRendererType() const { return m_PlayerParamSet.rendererType; }
76
77 void SetOutputLine(u32 outputLineFlag) { m_PlayerParamSet.outputLineFlag = outputLineFlag; }
78 u32 GetOutputLine() const { return m_PlayerParamSet.outputLineFlag; }
79
80 void SetTvParam(const OutputParam& param)
81 {
82 m_PlayerParamSet.tvParam = param;
83 }
84 const OutputParam& GetTvParam() const
85 {
86 return m_PlayerParamSet.tvParam;
87 }
88
89 void SetDrcParam(u32 drcIndex, const OutputParam& param)
90 {
91 m_PlayerParamSet.drcParam[drcIndex] = param;
92 }
93 const OutputParam& GetDrcParam(u32 drcIndex) const
94 {
95 return m_PlayerParamSet.drcParam[drcIndex];
96 }
97
98 void SetRemoteParam(u32 remoteIndex, const RemoteOutputParam& param)
99 {
100 m_PlayerParamSet.remoteParam[remoteIndex] = param;
101 }
102 const RemoteOutputParam& GetRemoteParam(u32 remoteIndex) const
103 {
104 return m_PlayerParamSet.remoteParam[remoteIndex];
105 }
106
108 {
109 return m_Event.TryWait();
110 }
111
113 {
114 m_Event.Wait();
115 }
116
118 {
119 m_Event.Reset();
120 }
121
126
131
132protected:
137
138 static s32 ToDelayCount(s32 delayTimeMilliSec)
139 {
140 //NW_ASSERT(delayTimeMilliSec % HardwareManager::SOUND_FRAME_INTERVAL_MSEC == 0);
141 return delayTimeMilliSec / HardwareManager::SOUND_FRAME_INTERVAL_MSEC;
142 }
143
149
151
152private:
155};
156static_assert(sizeof(BasicSoundPlayer) == 0xC0);
157
158} } } } // namespace nw::snd::internal::driver
159
160#endif // NW_SND_BASIC_SOUND_PLAYER_H_
Definition snd_PlayerHeapDataManager.h:12
Definition snd_BasicSoundPlayer.h:35
void SetRemoteParam(u32 remoteIndex, const RemoteOutputParam &param)
Definition snd_BasicSoundPlayer.h:98
void SetOutputLine(u32 outputLineFlag)
Definition snd_BasicSoundPlayer.h:77
bool IsPlayFinished() const
Definition snd_BasicSoundPlayer.h:50
bool IsFinalizedForCannotAllocateResource() const
Definition snd_BasicSoundPlayer.h:51
PanCurve GetPanCurve() const
Definition snd_BasicSoundPlayer.h:72
static s32 ToDelayCount(s32 delayTimeMilliSec)
Definition snd_BasicSoundPlayer.h:138
f32 GetPitch() const
Definition snd_BasicSoundPlayer.h:67
u8 GetRemoteFilter() const
Definition snd_BasicSoundPlayer.h:74
virtual ~BasicSoundPlayer()
Definition snd_BasicSoundPlayer.h:38
const OutputParam & GetTvParam() const
Definition snd_BasicSoundPlayer.h:84
const OutputParam & GetDrcParam(u32 drcIndex) const
Definition snd_BasicSoundPlayer.h:93
void SetPlayerHeapDataManagerImpl(const PlayerHeapDataManager *mgr)
Definition snd_BasicSoundPlayer.h:133
bool m_IsFinalizedForCannotAllocateResource
Definition snd_BasicSoundPlayer.h:150
VoiceRendererType GetVoiceRendererType() const
Definition snd_BasicSoundPlayer.h:75
void SetPanMode(PanMode mode)
Definition snd_BasicSoundPlayer.h:60
u32 GetOutputLine() const
Definition snd_BasicSoundPlayer.h:78
const PlayerHeapDataManager * m_pPlayerHeapDataManager
Definition snd_BasicSoundPlayer.h:154
void SetBiquadFilter(int type, f32 value)
void ClearIsFinalizedForCannotAllocatedResourceFlag()
Definition snd_BasicSoundPlayer.h:127
void SetPitch(f32 pitch)
Definition snd_BasicSoundPlayer.h:57
bool IsActive() const
Definition snd_BasicSoundPlayer.h:47
void SetTvParam(const OutputParam &param)
Definition snd_BasicSoundPlayer.h:80
f32 GetVolume() const
Definition snd_BasicSoundPlayer.h:66
int GetBiquadFilterType() const
Definition snd_BasicSoundPlayer.h:69
PlayerParamSet m_PlayerParamSet
Definition snd_BasicSoundPlayer.h:153
bool IsStarted() const
Definition snd_BasicSoundPlayer.h:48
void SetVoiceRendererType(VoiceRendererType mode)
Definition snd_BasicSoundPlayer.h:64
nw::ut::Event m_Event
Definition snd_BasicSoundPlayer.h:144
const PlayerHeapDataManager * GetPlayerHeapDataManager() const
Definition snd_BasicSoundPlayer.h:122
f32 GetLpfFreq() const
Definition snd_BasicSoundPlayer.h:68
void WaitInstanceFree()
Definition snd_BasicSoundPlayer.h:112
bool m_FinishFlag
Definition snd_BasicSoundPlayer.h:148
f32 GetBiquadFilterValue() const
Definition snd_BasicSoundPlayer.h:70
const RemoteOutputParam & GetRemoteParam(u32 remoteIndex) const
Definition snd_BasicSoundPlayer.h:102
PanMode GetPanMode() const
Definition snd_BasicSoundPlayer.h:71
void SetVolume(f32 volume)
Definition snd_BasicSoundPlayer.h:56
void SetPanCurve(PanCurve curve)
Definition snd_BasicSoundPlayer.h:61
bool m_ActiveFlag
Definition snd_BasicSoundPlayer.h:145
void SetFrontBypass(bool frontBypass)
Definition snd_BasicSoundPlayer.h:62
bool IsFrontBypass() const
Definition snd_BasicSoundPlayer.h:73
bool m_PauseFlag
Definition snd_BasicSoundPlayer.h:147
void InitializeEvent()
Definition snd_BasicSoundPlayer.h:117
bool TryWaitInstanceFree()
Definition snd_BasicSoundPlayer.h:107
bool IsPause() const
Definition snd_BasicSoundPlayer.h:49
void SetRemoteFilter(int filter)
Definition snd_BasicSoundPlayer.h:63
bool m_StartedFlag
Definition snd_BasicSoundPlayer.h:146
void SetLpfFreq(f32 lpfFreq)
Definition snd_BasicSoundPlayer.h:58
void SetDrcParam(u32 drcIndex, const OutputParam &param)
Definition snd_BasicSoundPlayer.h:89
Definition snd_BasicSound.h:136
Definition snd_BasicSound.cpp:3
Definition snd_BasicSound.cpp:3
static const int DRC_OUT_COUNT
Definition snd_Global.h:40
static const int REMOTE_OUT_COUNT
Definition snd_Global.h:181
VoiceRendererType
Definition snd_Global.h:184
PanMode
Definition snd_Global.h:53
PanCurve
Definition snd_Global.h:60
Definition snd_Global.h:193
Definition snd_Global.h:213
Definition snd_BasicSoundPlayer.h:12
u32 outputLineFlag
Definition snd_BasicSoundPlayer.h:22
OutputParam drcParam[DRC_OUT_COUNT]
Definition snd_BasicSoundPlayer.h:26
OutputParam tvParam
Definition snd_BasicSoundPlayer.h:25
bool isFrontBypass
Definition snd_BasicSoundPlayer.h:18
VoiceRendererType rendererType
Definition snd_BasicSoundPlayer.h:23
RemoteOutputParam remoteParam[REMOTE_OUT_COUNT]
Definition snd_BasicSoundPlayer.h:27
s8 biquadType
Definition snd_BasicSoundPlayer.h:17
PanCurve panCurve
Definition snd_BasicSoundPlayer.h:21
PlayerParamSet()
Definition snd_BasicSoundPlayer.h:29
f32 volume
Definition snd_BasicSoundPlayer.h:13
f32 pitch
Definition snd_BasicSoundPlayer.h:14
f32 biquadValue
Definition snd_BasicSoundPlayer.h:16
PanMode panMode
Definition snd_BasicSoundPlayer.h:20
u8 remoteFilter
Definition snd_BasicSoundPlayer.h:19
f32 lpfFreq
Definition snd_BasicSoundPlayer.h:15