MCPcopy Create free account
hub / github.com/audacity/audacity / Merge

Method Merge

libraries/lib-vst/VSTWrapper.cpp:270–305  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

268}
269
270void VSTMessage::Merge(Message && src)
271{
272 VSTMessage& vstSrc = static_cast<VSTMessage&>(src);
273
274 bool chunkWasAssigned = false;
275
276 if ( ! vstSrc.mChunk.empty() )
277 {
278 mChunk = vstSrc.mChunk;
279 chunkWasAssigned = true;
280 }
281
282 vstSrc.mChunk.resize(0); // capacity will be preserved though
283
284 assert(mParamsVec.size() == vstSrc.mParamsVec.size());
285
286 for (size_t i = 0; i < mParamsVec.size(); i++)
287 {
288 if (chunkWasAssigned)
289 {
290 mParamsVec[i] = vstSrc.mParamsVec[i];
291 }
292 else
293 {
294 // if src val is nullopt, do not copy it to dest
295 if (vstSrc.mParamsVec[i] != std::nullopt)
296 {
297 mParamsVec[i] = vstSrc.mParamsVec[i];
298 }
299 }
300
301 // consume the source value
302 vstSrc.mParamsVec[i] = std::nullopt;
303 }
304
305}
306
307bool VSTWrapper::Load()
308{

Callers

nothing calls this directly

Calls 2

emptyMethod · 0.45
sizeMethod · 0.45

Tested by

no test coverage detected