Skip to content

Commit

Permalink
Update Layout Editor functions.lua
Browse files Browse the repository at this point in the history
  • Loading branch information
BryanChi authored Sep 4, 2023
1 parent 20b4aa3 commit b14b703
Showing 1 changed file with 0 additions and 114 deletions.
114 changes: 0 additions & 114 deletions FX/BryanChi_FX Devices/Functions/Layout Editor functions.lua
Original file line number Diff line number Diff line change
Expand Up @@ -2281,117 +2281,3 @@ function AddGuideLines(Clr, L, T, R, B)
r.ImGui_DrawList_AddLine(Glob.FDL, R, T, R, T - 9999, Clr)
end

--if user turn knob on ImGui
if Tweaking == P_Num .. FxGUID then
FX[FxGUID][Fx_P].V = p_value
if not FP.WhichCC then
r.TrackFX_SetParamNormalized(LT_Track, FX_Idx, P_Num, p_value)
else
Unlink_Parm(LT_TrackNum, LT_FXNum, P_Num)
r.TrackFX_SetParamNormalized(LT_Track, FX_Idx, P_Num, FX[FxGUID][Fx_P].V)
end
end




if AssigningMacro ~= nil then
reaper.ImGui_DrawList_AddCircleFilled(draw_list, center[1], center[2], radius_outer,
EightColors.bgWhenAsgnMod[AssigningMacro], 16)
end


local AlreadyAddPrm = false

if LT_ParamNum == P_Num and focusedFXState == 1 and LT_FXGUID == FxGUID and not FP.WhichCC then
local LT_ParamValue = r.TrackFX_GetParamNormalized(LT_Track, LT_FX_Number, LT_ParamNum)

p_value = LT_ParamValue
FX[FxGUID][Fx_P].V = p_value

local L, T = r.ImGui_GetItemRectMin(ctx);

r.ImGui_DrawList_AddCircle(draw_list, center[1], center[2], radius_outer, 0xffffffff, 16)
for m = 1, 8, 1 do
if AssigningMacro == m then
reaper.ImGui_PopStyleColor(ctx, 2)
end
end
end


if PM.TimeNow ~= nil then
if r.time_precise() > PM.TimeNow + 1 then
r.gmem_write(7, 0) --tells jsfx to stop retrieving P value
r.gmem_write(8, 0)
PM.TimeNow = nil
end
end

IfTryingToAddExistingPrm(Fx_P, FxGUID, 'Circle', center[1], center[2], nil, nil, radius_outer)



MakeModulationPossible(FxGUID, Fx_P, FX_Idx, P_Num, p_value, Sldr_Width, 'knob')


if FP.ModAMT then -- Draw modlines circular
for Macro, v in ipairs(MacroNums) do
if FP.ModAMT[Macro] then
--if Modulation has been assigned to params
local P_V_Norm = r.TrackFX_GetParamNormalized(LT_Track, FX_Idx, P_Num)

--- indicator of where the param is currently
local PosAftrMod = ANGLE_MIN + (ANGLE_MAX - ANGLE_MIN) * P_V_Norm


r.ImGui_DrawList_PathArcTo(draw_list, center[1], center[2], radius_outer * 0.75, angle,
ANGLE_MIN + (ANGLE_MAX - ANGLE_MIN) * P_V_Norm)
r.ImGui_DrawList_PathStroke(draw_list, EightColors.Bright[Macro], nil, radius_outer / 2)
r.ImGui_DrawList_PathClear(draw_list)

--- shows modulation range
r.ImGui_DrawList_PathArcTo(draw_list, center[1], center[2], radius_outer - 1, angle,
SetMinMax(angle + (ANGLE_MAX - ANGLE_MIN) * FP.ModAMT[Macro], ANGLE_MIN, ANGLE_MAX))
reaper.ImGui_DrawList_PathStroke(draw_list, EightColors.HighSat_MidBright[Macro], nil, radius_outer * 0.1)
r.ImGui_DrawList_PathClear(draw_list)

ParamHasMod_Any = true
end
end
end -- of reapeat for every macro

if Trk.Prm.Assign and F_Tp == Trk.Prm.Assign and AssigningMacro then
local M = AssigningMacro

RightBtnDragX, RightBtnDragY = r.ImGui_GetMouseDragDelta(ctx, x, y, 1)

FP.ModAMT[M] = ((-RightBtnDragY / 100) or 0) + (FP.ModAMT[M] or 0)

if FP.ModAMT[M] + p_value > 1 then FP.ModAMT[M] = 1 - p_value end
if FP.ModAMT[M] + p_value < 0 then FP.ModAMT[M] = -p_value end

r.ImGui_DrawList_PathArcTo(draw_list, center[1], center[2], radius_outer - 1, angle,
angle + (ANGLE_MAX - ANGLE_MIN) * FP.ModAMT[M])
reaper.ImGui_DrawList_PathStroke(draw_list, EightColors.bgWhenAsgnModAct[AssigningMacro], nil, radius_outer * 0.1)
r.ImGui_DrawList_PathClear(draw_list)
r.gmem_write(4, 1) --tells jsfx that user is changing Mod Amount
r.gmem_write(1000 * AssigningMacro + Trk.Prm.Assign, FP.ModAMT[M])
r.ImGui_ResetMouseDragDelta(ctx, 1)

r.SetProjExtState(0, 'FX Devices', 'Param -' .. Trk.Prm.Assign .. 'Macro - ' .. AssigningMacro .. FxGUID,
FP.ModAMT[M])
end

--repeat for every param stored on track...


if FX[FxGUID].Morph_Value_Edit or Mods == Alt + Ctrl then r.ImGui_EndDisabled(ctx) end


if LblTextSize ~= 'No Font' then r.ImGui_PopFont(ctx) end

return value_changed, p_value
end


0 comments on commit b14b703

Please sign in to comment.