aboutsummaryrefslogtreecommitdiffstats
path: root/core/voice.h
diff options
context:
space:
mode:
authorChris Robinson <[email protected]>2023-12-20 01:53:27 -0800
committerChris Robinson <[email protected]>2023-12-20 01:53:27 -0800
commitaa6e04a5562052db172117043165ae999683b052 (patch)
tree11b36fabd9a542aca0f5ad234d365ce8067dd46d /core/voice.h
parent59c466077fd6f16af64afcc6260bb61aa4e632dc (diff)
Ensure struct members are initialized
Diffstat (limited to 'core/voice.h')
-rw-r--r--core/voice.h50
1 files changed, 25 insertions, 25 deletions
diff --git a/core/voice.h b/core/voice.h
index 2ecc8148..aaf1c5fd 100644
--- a/core/voice.h
+++ b/core/voice.h
@@ -66,14 +66,14 @@ struct DirectParams {
NfcFilter NFCtrlFilter;
struct {
- HrtfFilter Old;
- HrtfFilter Target;
- alignas(16) std::array<float,HrtfHistoryLength> History;
+ HrtfFilter Old{};
+ HrtfFilter Target{};
+ alignas(16) std::array<float,HrtfHistoryLength> History{};
} Hrtf;
struct {
- std::array<float,MaxOutputChannels> Current;
- std::array<float,MaxOutputChannels> Target;
+ std::array<float,MaxOutputChannels> Current{};
+ std::array<float,MaxOutputChannels> Target{};
} Gains;
};
@@ -82,8 +82,8 @@ struct SendParams {
BiquadFilter HighPass;
struct {
- std::array<float,MaxAmbiChannels> Current;
- std::array<float,MaxAmbiChannels> Target;
+ std::array<float,MaxAmbiChannels> Current{};
+ std::array<float,MaxAmbiChannels> Target{};
} Gains;
};
@@ -184,7 +184,7 @@ struct Voice {
std::atomic<VoicePropsItem*> mUpdate{nullptr};
- VoiceProps mProps;
+ VoiceProps mProps{};
std::atomic<uint> mSourceID{0u};
std::atomic<State> mPlayState{Stopped};
@@ -194,30 +194,30 @@ struct Voice {
* Source offset in samples, relative to the currently playing buffer, NOT
* the whole queue.
*/
- std::atomic<int> mPosition;
+ std::atomic<int> mPosition{};
/** Fractional (fixed-point) offset to the next sample. */
- std::atomic<uint> mPositionFrac;
+ std::atomic<uint> mPositionFrac{};
/* Current buffer queue item being played. */
- std::atomic<VoiceBufferItem*> mCurrentBuffer;
+ std::atomic<VoiceBufferItem*> mCurrentBuffer{};
/* Buffer queue item to loop to at end of queue (will be NULL for non-
* looping voices).
*/
- std::atomic<VoiceBufferItem*> mLoopBuffer;
+ std::atomic<VoiceBufferItem*> mLoopBuffer{};
std::chrono::nanoseconds mStartTime{};
/* Properties for the attached buffer(s). */
- FmtChannels mFmtChannels;
- FmtType mFmtType;
- uint mFrequency;
- uint mFrameStep; /**< In steps of the sample type size. */
- uint mBytesPerBlock; /**< Or for PCM formats, BytesPerFrame. */
- uint mSamplesPerBlock; /**< Always 1 for PCM formats. */
- AmbiLayout mAmbiLayout;
- AmbiScaling mAmbiScaling;
- uint mAmbiOrder;
+ FmtChannels mFmtChannels{};
+ FmtType mFmtType{};
+ uint mFrequency{};
+ uint mFrameStep{}; /**< In steps of the sample type size. */
+ uint mBytesPerBlock{}; /**< Or for PCM formats, BytesPerFrame. */
+ uint mSamplesPerBlock{}; /**< Always 1 for PCM formats. */
+ AmbiLayout mAmbiLayout{};
+ AmbiScaling mAmbiScaling{};
+ uint mAmbiOrder{};
std::unique_ptr<DecoderBase> mDecoder;
uint mDecoderPadding{};
@@ -225,16 +225,16 @@ struct Voice {
/** Current target parameters used for mixing. */
uint mStep{0};
- ResamplerFunc mResampler;
+ ResamplerFunc mResampler{};
- InterpState mResampleState;
+ InterpState mResampleState{};
std::bitset<VoiceFlagCount> mFlags{};
uint mNumCallbackBlocks{0};
uint mCallbackBlockBase{0};
struct TargetData {
- int FilterType;
+ int FilterType{};
al::span<FloatBufferLine> Buffer;
};
TargetData mDirect;
@@ -249,7 +249,7 @@ struct Voice {
al::vector<HistoryLine,16> mPrevSamples{2};
struct ChannelData {
- float mAmbiHFScale, mAmbiLFScale;
+ float mAmbiHFScale{}, mAmbiLFScale{};
BandSplitter mAmbiSplitter;
DirectParams mDryParams;