MCPcopy Create free account
hub / github.com/LMMS/lmms / linkModels

Method linkModels

src/core/AutomatableModel.cpp:444–463  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

442
443
444void AutomatableModel::linkModels( AutomatableModel* model1, AutomatableModel* model2 )
445{
446 if (!model1->m_linkedModels.contains( model2 ) && model1 != model2)
447 {
448 // copy data
449 model1->m_value = model2->m_value;
450 if (model1->valueBuffer() && model2->valueBuffer())
451 {
452 std::copy_n(model2->valueBuffer()->data(),
453 model1->valueBuffer()->length(),
454 model1->valueBuffer()->data());
455 }
456 // send dataChanged() before linking (because linking will
457 // connect the two dataChanged() signals)
458 emit model1->dataChanged();
459 // finally: link the models
460 model1->linkModel( model2 );
461 model2->linkModel( model1 );
462 }
463}
464
465
466

Callers

nothing calls this directly

Calls 4

linkModelMethod · 0.80
valueBufferMethod · 0.45
dataMethod · 0.45
lengthMethod · 0.45

Tested by

no test coverage detected