13
0

Redraw MIDI monitor only as needed

This reduces CPU overhead and constant stream of cross thread
signals at session's block-size.
This commit is contained in:
Robin Gareus 2021-12-04 19:19:51 +01:00
parent 36a2fb1ba8
commit 0b056c6364
Signed by: rgareus
GPG Key ID: A090BCE02CF57F04

View File

@ -61,6 +61,7 @@ end
function dsp_runmap (bufs, in_map, out_map, n_samples, offset) function dsp_runmap (bufs, in_map, out_map, n_samples, offset)
local pos = self:shmem():atomic_get_int(0) local pos = self:shmem():atomic_get_int(0)
local buffer = self:shmem():to_int(1):array() local buffer = self:shmem():to_int(1):array()
local newdata = false
-- passthrough all data -- passthrough all data
ARDOUR.DSP.process_map (bufs, n_out, in_map, out_map, n_samples, offset) ARDOUR.DSP.process_map (bufs, n_out, in_map, out_map, n_samples, offset)
@ -83,12 +84,16 @@ function dsp_runmap (bufs, in_map, out_map, n_samples, offset)
for j = e:size()+1, evlen do for j = e:size()+1, evlen do
buffer[(pos-1)*evlen + j] = 0 buffer[(pos-1)*evlen + j] = 0
end end
newdata = true
end end
end end
self:shmem():atomic_set_int(0, pos) self:shmem():atomic_set_int(0, pos)
self:queue_draw () if newdata then
print ("new data", pos)
self:queue_draw ()
end
end end
local txt = nil -- a pango context local txt = nil -- a pango context