From f808e772bca00664ceb5cfb7332dac4b8e7af394 Mon Sep 17 00:00:00 2001 From: Paul Davis Date: Mon, 26 Jan 2015 15:54:29 -0500 Subject: [PATCH] fix timing of Butler mapping config parameters to avoid crash. Amazing that this didn't show up on Linux at all, or on the first run after build. Computers ... sigh. --- libs/ardour/ardour/butler.h | 2 ++ libs/ardour/butler.cc | 12 ++++++++---- libs/ardour/session_state.cc | 1 + 3 files changed, 11 insertions(+), 4 deletions(-) diff --git a/libs/ardour/ardour/butler.h b/libs/ardour/ardour/butler.h index 949668dab3..b78952a054 100644 --- a/libs/ardour/ardour/butler.h +++ b/libs/ardour/ardour/butler.h @@ -60,6 +60,8 @@ class LIBARDOUR_API Butler : public SessionHandleRef bool transport_work_requested() const; void drop_references (); + void map_parameters (); + framecnt_t audio_diskstream_capture_buffer_size() const { return audio_dstream_capture_buffer_size; } framecnt_t audio_diskstream_playback_buffer_size() const { return audio_dstream_playback_buffer_size; } uint32_t midi_diskstream_buffer_size() const { return midi_dstream_buffer_size; } diff --git a/libs/ardour/butler.cc b/libs/ardour/butler.cc index cc1d5363b9..6490426c38 100644 --- a/libs/ardour/butler.cc +++ b/libs/ardour/butler.cc @@ -54,10 +54,6 @@ Butler::Butler(Session& s) /* catch future changes to parameters */ Config->ParameterChanged.connect_same_thread (*this, boost::bind (&Butler::config_changed, this, _1)); - - /* use any current ones that we care about */ - boost::function ff (boost::bind (&Butler::config_changed, this, _1)); - Config->map_parameters (ff); } Butler::~Butler() @@ -65,6 +61,14 @@ Butler::~Butler() terminate_thread (); } +void +Butler::map_parameters () +{ + /* use any current ones that we care about */ + boost::function ff (boost::bind (&Butler::config_changed, this, _1)); + Config->map_parameters (ff); +} + void Butler::config_changed (std::string p) { diff --git a/libs/ardour/session_state.cc b/libs/ardour/session_state.cc index 5385f8b7df..8aed89ada3 100644 --- a/libs/ardour/session_state.cc +++ b/libs/ardour/session_state.cc @@ -277,6 +277,7 @@ Session::post_engine_init () Config->map_parameters (ff); config.map_parameters (ft); + _butler->map_parameters (); /* Reset all panners */