Skip to content

Commit

Permalink
Fix lost control links in copied automation patterns (#4723)
Browse files Browse the repository at this point in the history
This hack should be removed once the automation system gets fixed.
  • Loading branch information
PhysSong authored Dec 22, 2018
1 parent 642b5e7 commit e1d9d89
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 0 deletions.
1 change: 1 addition & 0 deletions include/ProjectJournal.h
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,7 @@ class ProjectJournal
}

static jo_id_t idToSave( jo_id_t id );
static jo_id_t idFromSave( jo_id_t id );

void clearJournal();
void stopAllJournalling();
Expand Down
10 changes: 10 additions & 0 deletions src/core/AutomationPattern.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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();
Expand Down
5 changes: 5 additions & 0 deletions src/core/ProjectJournal.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}




Expand Down

0 comments on commit e1d9d89

Please sign in to comment.