MCPcopy Create free account
hub / github.com/BespokeSynth/BespokeSynth / Load

Method Load

Source/ChannelBuffer.cpp:180–203  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

178}
179
180void ChannelBuffer::Load(FileStreamIn& in, int& readLength, LoadMode loadMode)
181{
182 int rev;
183 in >> rev;
184 LoadStateValidate(rev <= kSaveStateRev);
185
186 in >> readLength;
187 if (loadMode == LoadMode::kSetBufferSize)
188 Setup(readLength);
189 else if (loadMode == LoadMode::kRequireExactBufferSize)
190 assert(readLength == mBufferSize);
191 else
192 assert(readLength <= mBufferSize);
193 in >> mActiveChannels;
194 for (int i = 0; i < mActiveChannels; ++i)
195 {
196 bool hasBuffer = true;
197 if (rev >= 1)
198 in >> hasBuffer;
199
200 if (hasBuffer)
201 in.Read(GetChannel(i), readLength);
202 }
203}

Callers 6

LoadStateMethod · 0.45
LoadStateMethod · 0.45
LoadStateMethod · 0.45
LoadStateMethod · 0.45
LoadStateMethod · 0.45
SetSnapshotMethod · 0.45

Calls 2

LoadStateValidateFunction · 0.85
ReadMethod · 0.45

Tested by

no test coverage detected