I am trying to save some session data as binary to speed up loading and saving the data. But when I save the session, none of the binary data appears in the XML, and I don’t see why not. Here is the code:
//
pRegionXml->setAttribute( "FileIndex", (String)fileIndex );
pRegionXml->setAttribute( "FileOffset", (String)frameOffsetInFile );
pRegionXml->setAttribute( "StartFrame", (String)firstFrameInTimeline );
int64 count = this->size();
pRegionXml->setAttribute( "NumFrames", (String)count );
//
if (pInputCyclePeriods != nullptr)
{
//
MemoryBlock cyclePeriodData( pInputCyclePeriods, (count*sizeof(double)) );
pRegionXml->setAttribute( "CyclePeriods", cyclePeriodData.toBase64Encoding() );
}
//
if (pOutputData != nullptr)
{
//
MemoryBlock outputData( pOutputData, (count*sizeof(OutputData)) );
pRegionXml->setAttribute( "OutputData", outputData.toBase64Encoding() );
}
The resulting XML in the session includes this for that node:
<RegionData FileIndex="0" FileOffset="0" StartFrame="-402" NumFrames="15247872"/>
So, it looks like we’re trying to add about 15 million pieces of data there, each of which is 4 floats, or 16 bytes, for a total of 243Mb. Is that simply too large to save as a String?
Should I bypass the XML and simply memcpy() the data into the chunk itself?
Or, do I really need to write the data to an external file instead, and deal with the issues of users taking their sessions to other machines, and not knowing they have to copy the data file(s) as well?