Fix lost control links in copied automation patterns (#4723)

This hack should be removed once the automation system gets fixed.
This commit is contained in:
Hyunjin Song
2018-12-22 11:37:34 +09:00
committed by GitHub
parent 642b5e7d04
commit e1d9d899fd
3 changed files with 16 additions and 0 deletions

View File

@@ -77,6 +77,7 @@ public:
}
static jo_id_t idToSave( jo_id_t id );
static jo_id_t idFromSave( jo_id_t id );
void clearJournal();
void stopAllJournalling();

View File

@@ -787,6 +787,16 @@ void AutomationPattern::resolveAllIDs()
{
a->addObject( dynamic_cast<AutomatableModel *>( o ), false );
}
else
{
// FIXME: Remove this block once the automation system gets fixed
// This is a temporary fix for https://github.com/LMMS/lmms/issues/3781
o = Engine::projectJournal()->journallingObject(ProjectJournal::idFromSave(*k));
if( o && dynamic_cast<AutomatableModel *>( o ) )
{
a->addObject( dynamic_cast<AutomatableModel *>( o ), false );
}
}
}
a->m_idsToResolve.clear();
a->dataChanged();

View File

@@ -164,6 +164,11 @@ jo_id_t ProjectJournal::idToSave( jo_id_t id )
return id & ~EO_ID_MSB;
}
jo_id_t ProjectJournal::idFromSave( jo_id_t id )
{
return id | EO_ID_MSB;
}