From 6a14c2728e75554ede342fd7668d970699850dfe Mon Sep 17 00:00:00 2001
From: ergen <rhetr@users.noreply.github.com>
Date: Fri, 17 Jul 2026 14:31:47 -0400
Subject: [PATCH] send patch preference

---
 gtk2_ardour/rc_option_editor.cc                | 10 ++++++++++
 libs/ardour/ardour/rc_configuration_vars.inc.h |  1 +
 libs/ardour/triggerbox.cc                      |  2 +-
 3 files changed, 12 insertions(+), 1 deletion(-)

diff --git a/gtk2_ardour/rc_option_editor.cc b/gtk2_ardour/rc_option_editor.cc
index 2c9bae1186..f976e16509 100644
--- a/gtk2_ardour/rc_option_editor.cc
+++ b/gtk2_ardour/rc_option_editor.cc
@@ -3690,6 +3690,16 @@ These settings will only take effect after %1 is restarted.\n\
 	add_option (_("Editor/Modifiers"), new KeyboardOptions);
 	add_option (_("Editor/Modifiers"), new OptionEditorBlank ());
 
+	/* Cue Page *****************************************************************/
+
+	add_option (_("Cue"), new OptionEditorHeading (_("Default Clip Properties")));
+	add_option (_("Cue"),
+			new BoolOption (
+				"allow-patch-changes",
+				_("Send MIDI patches on clip trigger"),
+				sigc::mem_fun (*_rc_config, &RCConfiguration::get_allow_patch_changes),
+				sigc::mem_fun (*_rc_config, &RCConfiguration::set_allow_patch_changes)
+				));
 
 	/* MIDI *********************************************************************/
 
diff --git a/libs/ardour/ardour/rc_configuration_vars.inc.h b/libs/ardour/ardour/rc_configuration_vars.inc.h
index 87afd076b2..dcfa3ca88b 100644
--- a/libs/ardour/ardour/rc_configuration_vars.inc.h
+++ b/libs/ardour/ardour/rc_configuration_vars.inc.h
@@ -221,6 +221,7 @@ CONFIG_VARIABLE_SPECIAL (std::string, default_session_parent_dir, "default-sessi
 #endif
 CONFIG_VARIABLE (std::string, clip_library_dir, "clip-library-dir", "@default@") /* writable folder */
 CONFIG_VARIABLE (std::string, sample_lib_path, "sample-lib-path", "") /* custom paths */
+CONFIG_VARIABLE (bool, allow_patch_changes, "allow-patch-changes", true)
 CONFIG_VARIABLE (bool, allow_special_bus_removal, "allow-special-bus-removal", false)
 CONFIG_VARIABLE (int32_t, processor_usage, "processor-usage", -1)
 CONFIG_VARIABLE (int32_t, cpu_dma_latency, "cpu-dma-latency", -1) /* >=0 to enable */
diff --git a/libs/ardour/triggerbox.cc b/libs/ardour/triggerbox.cc
index a6a9db3259..b3f647f032 100644
--- a/libs/ardour/triggerbox.cc
+++ b/libs/ardour/triggerbox.cc
@@ -232,7 +232,7 @@ Trigger::Trigger (uint32_t n, TriggerBox& b)
 	, _velocity_effect (Properties::velocity_effect, 0.)
 	, _stretchable (Properties::stretchable, true)
 	, _cue_isolated (Properties::cue_isolated, false)
-	, _allow_patch_changes (Properties::allow_patch_changes, true)
+	, _allow_patch_changes (Properties::allow_patch_changes, Config->get_allow_patch_changes())
 	, _stretch_mode (Properties::stretch_mode, Trigger::Crisp)
 	, _name (Properties::name, "")
 	, _color (Properties::color, 0xBEBEBEFF)
-- 
2.43.0

