From 11e92560c19f75ebc683b1f57e3aa1f71a3cf05f Mon Sep 17 00:00:00 2001 From: Christian Fillion Date: Fri, 2 Feb 2024 20:08:54 -0500 Subject: [PATCH] Release SWS CF_Preview API demo v1.0.1 Fix display of the first peak channel --- Development/cfillion_SWS CF_Preview API demo.lua | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/Development/cfillion_SWS CF_Preview API demo.lua b/Development/cfillion_SWS CF_Preview API demo.lua index 22ee256b2..4332fef48 100644 --- a/Development/cfillion_SWS CF_Preview API demo.lua +++ b/Development/cfillion_SWS CF_Preview API demo.lua @@ -298,8 +298,10 @@ local function window() local spacing_x, spacing_h = ImGui.GetStyleVar(ctx, ImGui.StyleVar_ItemSpacing()) local meter_h = math.max(spacing_h, ((avail_h + spacing_h) / peakChans) - spacing_h) for i = 0, peakChans - 1 do - local peak = select(2, reaper.CF_Preview_GetPeak(preview, i)) + local valid, peak = reaper.CF_Preview_GetPeak(preview, i) + ImGui.BeginDisabled(ctx, not valid) ImGui.ProgressBar(ctx, peak, -FLT_MIN, meter_h, ' ') + ImGui.EndDisabled(ctx) end ImGui.PopItemWidth(ctx)