From 87ab0a9e0ff1888bac89ce4686e9edc94dfb12c2 Mon Sep 17 00:00:00 2001 From: Paul Davis Date: Thu, 10 Oct 2024 10:25:49 -0600 Subject: [PATCH] add config vars to control max size of captured MIDI and audio clips --- libs/ardour/ardour/rc_configuration_vars.h | 3 +++ libs/ardour/triggerbox.cc | 4 ++-- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/libs/ardour/ardour/rc_configuration_vars.h b/libs/ardour/ardour/rc_configuration_vars.h index d476d557b8..0eb1c240ba 100644 --- a/libs/ardour/ardour/rc_configuration_vars.h +++ b/libs/ardour/ardour/rc_configuration_vars.h @@ -295,3 +295,6 @@ CONFIG_VARIABLE (bool, show_video_server_dialog, "show-video-server-dialog", fal CONFIG_VARIABLE (float, export_preroll, "export-preroll", 2.0) // seconds CONFIG_VARIABLE (float, export_silence_threshold, "export-silence-threshold", -90) // dB CONFIG_VARIABLE (float, ppqn_factor_for_export, "ppqn-factor-for-export", 1) // Temporal::ticks_per_beat + +CONFIG_VARIABLE (float, max_midi_clip_size, "max-midi-clip-size", 1024) // number of MIDI events +CONFIG_VARIABLE (float, max_audio_clip_duration, "max-audio-clip-duration" , 30.) // seconds diff --git a/libs/ardour/triggerbox.cc b/libs/ardour/triggerbox.cc index 184e34b07a..fadca5905c 100644 --- a/libs/ardour/triggerbox.cc +++ b/libs/ardour/triggerbox.cc @@ -3519,9 +3519,9 @@ TriggerBox::arm_from_another_thread (Trigger& slot, samplepos_t now, uint32_t ch if (_data_type == DataType::MIDI) { ai->midi_buf = new RTMidiBufferBeats; - ai->midi_buf->resize (1024); // XXX Config->max_slot_midi_event_size + ai->midi_buf->resize (Config->get_max_midi_clip_size()); } else { - ai->audio_buf.alloc (_session.sample_rate() * 30, chans); // XXX Config->max_slot_audio_duration + ai->audio_buf.alloc ((samplecnt_t) round (_session.sample_rate() * Config->get_max_audio_clip_duration()), chans); AudioTrigger* at = dynamic_cast (&slot); assert (at); ai->stretcher = at->alloc_stretcher ();