From 783212439330d4b7f669b258bff3366102ffd0de Mon Sep 17 00:00:00 2001 From: Hyunjin Song Date: Sun, 9 Dec 2018 16:03:36 +0900 Subject: [PATCH 1/2] Fix lost control links in copied automation patterns This hack should be removed once the automation system gets fixed. --- src/core/AutomationPattern.cpp | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/src/core/AutomationPattern.cpp b/src/core/AutomationPattern.cpp index 25da6defbdf..689ec757668 100644 --- a/src/core/AutomationPattern.cpp +++ b/src/core/AutomationPattern.cpp @@ -787,6 +787,16 @@ void AutomationPattern::resolveAllIDs() { a->addObject( dynamic_cast( 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( *k + ( 1 << 23 ) ); + if( o && dynamic_cast( o ) ) + { + a->addObject( dynamic_cast( o ), false ); + } + } } a->m_idsToResolve.clear(); a->dataChanged(); From 993a15cbe7e6e0cb23e96447f0e126585c90f244 Mon Sep 17 00:00:00 2001 From: Hyunjin Song Date: Fri, 21 Dec 2018 10:56:34 +0900 Subject: [PATCH 2/2] Don't expose EO_ID_MSD per https://github.com/LMMS/lmms/pull/4723#discussion_r240599559 and https://github.com/LMMS/lmms/pull/4723#discussion_r243115626 --- include/ProjectJournal.h | 1 + src/core/AutomationPattern.cpp | 2 +- src/core/ProjectJournal.cpp | 5 +++++ 3 files changed, 7 insertions(+), 1 deletion(-) diff --git a/include/ProjectJournal.h b/include/ProjectJournal.h index a89c9725a2d..e0e738b707c 100644 --- a/include/ProjectJournal.h +++ b/include/ProjectJournal.h @@ -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(); diff --git a/src/core/AutomationPattern.cpp b/src/core/AutomationPattern.cpp index 689ec757668..2ee41b5f269 100644 --- a/src/core/AutomationPattern.cpp +++ b/src/core/AutomationPattern.cpp @@ -791,7 +791,7 @@ void AutomationPattern::resolveAllIDs() { // 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( *k + ( 1 << 23 ) ); + o = Engine::projectJournal()->journallingObject(ProjectJournal::idFromSave(*k)); if( o && dynamic_cast( o ) ) { a->addObject( dynamic_cast( o ), false ); diff --git a/src/core/ProjectJournal.cpp b/src/core/ProjectJournal.cpp index 57646aeaa79..ce811dbc595 100644 --- a/src/core/ProjectJournal.cpp +++ b/src/core/ProjectJournal.cpp @@ -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; +} +