From f4c978cf88a2c8c98bfa81328a9dcb76370965c5 Mon Sep 17 00:00:00 2001 From: Robin Gareus Date: Thu, 29 Aug 2024 04:26:33 +0200 Subject: [PATCH] Fix MIDI patch/CC state restore #9770 MidiTrack::restore_controls is triggered by SessionLoaded event. Yet MidiControl::actually_set_value checks if _session.loading() is true and postpones sending actual events to the synth (which may not be fully loaded). Before 5d02970de866e, Session::post_engine_init unset "Loading" flag early on, so "loading" was already unset by the time `SessionLoaded` was emitted. --- libs/ardour/session_state.cc | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/libs/ardour/session_state.cc b/libs/ardour/session_state.cc index 0ca1d62f3a..c09ff047f3 100644 --- a/libs/ardour/session_state.cc +++ b/libs/ardour/session_state.cc @@ -419,10 +419,10 @@ Session::post_engine_init () void Session::session_loaded () { - SessionLoaded(); - set_clean (); + SessionLoaded(); + if (_is_new) { save_state (""); }