From 0e20fbaeb07794bcadc1042a71556e099190749f Mon Sep 17 00:00:00 2001
From: Alexandros Theodotou <alex@zrythm.org>
Date: Fri, 27 Aug 2021 18:33:50 +0100
Subject: [PATCH] fix MIDI devices not getting connected to tracks after
 loading a project

---
 src/project.c | 7 +++++++
 1 file changed, 7 insertions(+)

diff --git a/src/project.c b/src/project.c
index a55ed615fd..ac816be459 100644
--- a/src/project.c
+++ b/src/project.c
@@ -1330,6 +1330,13 @@ project_load (
       channel_reconnect_ext_input_ports (ch);
     }
 
+  /* pause engine and reconnect graph */
+  EngineState state;
+  engine_wait_for_pause (
+    AUDIO_ENGINE, &state, true);
+  router_recalc_graph (ROUTER, F_NOT_SOFT);
+  engine_resume (AUDIO_ENGINE, &state);
+
   return 0;
 }
 
-- 
GitLab