XPlor/libs/xassets/xaudiopacketaligned.cpp

54 lines
862 B
C++
Raw Normal View History

2025-09-07 12:36:08 -04:00
#include "xaudiopacketaligned.h"
XAudioPacketAligned::XAudioPacketAligned()
: XAsset()
, mBuffer()
, mBufferSize(0)
, mLoopCount(0)
, aXmaLoop()
, mContext()
2025-08-14 17:30:25 -04:00
{
2025-09-07 12:36:08 -04:00
2025-08-14 17:30:25 -04:00
}
2025-09-07 12:36:08 -04:00
XAudioPacketAligned::~XAudioPacketAligned()
2025-08-14 17:30:25 -04:00
{
2025-09-07 12:36:08 -04:00
2025-08-14 17:30:25 -04:00
}
2025-09-07 12:36:08 -04:00
void XAudioPacketAligned::ParseData(QDataStream *aStream)
2025-08-14 17:30:25 -04:00
{
2025-09-07 12:36:08 -04:00
qint32 bufferPtr, contextPtr;
*aStream
>> bufferPtr
>> mBufferSize
>> mLoopCount;
for (int i = 0; i < 6; i++)
{
XAudioXmaLoopRegion loop;
loop.ParseData(aStream);
}
*aStream >> contextPtr;
if (bufferPtr)
{
aStream->readRawData(mBuffer.data(), mBufferSize);
}
if (contextPtr)
{
*aStream >> mContext;
}
2025-08-14 17:30:25 -04:00
}
2025-09-07 12:36:08 -04:00
void XAudioPacketAligned::Clear()
2025-08-14 17:30:25 -04:00
{
2025-09-07 12:36:08 -04:00
mBuffer.clear();
mBufferSize = 0;
mLoopCount = 0;
aXmaLoop.clear();
mContext = '\0';
2025-08-14 17:30:25 -04:00
}