Skip to content

Commit

Permalink
Release FX Devices v1.0beta9.6.5 (#1216)
Browse files Browse the repository at this point in the history
-Fix parameters in ImGui not syncing with plugin when adjusting parameter values through plugin window.
-Fix unable to select any item in layout edit mode.
-add .lua to theme editor functions file name.
-Prevent crash when saving shortcut bindings without and action ID
  • Loading branch information
BryanChi authored Jul 19, 2023
1 parent 7985509 commit 327bbdf
Show file tree
Hide file tree
Showing 4 changed files with 14,605 additions and 680 deletions.
13 changes: 7 additions & 6 deletions FX/BryanChi_FX Devices.lua
Original file line number Diff line number Diff line change
@@ -1,10 +1,11 @@
-- @description FX Devices
-- @author Bryan Chi
-- @version 1.0beta9.6.4
-- @version 1.0beta9.6.5
-- @changelog
-- -Added Keyboard Shortcut Editor.
--
-- -Cleaned up script by splitting functions into corresponding individual files in 'Functions' folder.
-- -Fix parameters in ImGui not syncing with plugin when adjusting parameter values through plugin window.
-- -Fix unable to select any item in layout edit mode.
-- -add .lua to theme editor functions file name.
-- -Prevent crash when saving shortcut bindings without and action ID
-- @provides
-- [effect] BryanChi_FX Devices/FXD Macros.jsfx
-- [effect] BryanChi_FX Devices/FXD ReSpectrum.jsfx
Expand Down Expand Up @@ -53,13 +54,13 @@
-- BryanChi_FX Devices/Functions/FX Adder.lua
-- BryanChi_FX Devices/Functions/Layout Editor functions.lua
-- BryanChi_FX Devices/Functions/Modulation.lua
-- BryanChi_FX Devices/Functions/Theme Editor Functions
-- BryanChi_FX Devices/Functions/Theme Editor Functions.lua
-- @about
-- Please check the forum post for info:
-- https://forum.cockos.com/showthread.php?t=263622

--------------------------== declare Initial Variables & Functions ------------------------
VersionNumber = 'V1.0beta9.6.4 '
VersionNumber = 'V1.0beta9.6.5 '
FX_Add_Del_WaitTime=2
r=reaper

Expand Down
21 changes: 14 additions & 7 deletions FX/BryanChi_FX Devices/Functions/Layout Editor functions.lua
Original file line number Diff line number Diff line change
Expand Up @@ -419,7 +419,7 @@

if is_active and -mouse_delta[2] ~= 0.0 then
local stepscale = 1
if ModifierHeld == Shift then stepscale = 3 end
if Mods == Shift then stepscale = 3 end
local step = (v_max - v_min) / (200.0*stepscale)
p_value = p_value + (-mouse_delta[2] * step)
if p_value < v_min then p_value = v_min end
Expand Down Expand Up @@ -722,6 +722,8 @@
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

Expand Down Expand Up @@ -1011,7 +1013,9 @@
local AlreadyAddPrm = false

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

FX[FxGUID][Fx_P].V = LT_ParamValue

reaper.ImGui_DrawList_AddRectFilled(draw_list, PosL, PosT,PosR,PosB, 0x99999922, Rounding)
reaper.ImGui_DrawList_AddRect(draw_list, PosL, PosT,PosR,PosB, 0x99999966,Rounding)
Expand Down Expand Up @@ -1438,6 +1442,8 @@
local AlreadyAddPrm = false

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

FX[FxGUID][Fx_P].V = LT_ParamValue
reaper.ImGui_DrawList_AddRectFilled(draw_list, PosL, PosT,PosR,PosB, 0x99999922, Rounding)
reaper.ImGui_DrawList_AddRect(draw_list, PosL, PosT,PosR,PosB, 0x99999966,Rounding)
Expand Down Expand Up @@ -2229,15 +2235,16 @@

--- if mouse is on an item
if MouseX > L and MouseX<R-5 and MouseY >T and MouseY < B then
if LBtnRel and Max_L_MouseDownDuration<0.1 and ModifierHeld==0 then
if LBtnRel and Max_L_MouseDownDuration<0.1 and Mods==0 then
LE.Sel_Items={}
table.insert(LE.Sel_Items,Fx_P)
end

if IsLBtnClicked and ModifierHeld==0 then
if IsLBtnClicked and Mods==0 then

LE.SelectedItem = Fx_P

elseif IsLBtnClicked and ModifierHeld==Shift then
elseif IsLBtnClicked and Mods==Shift then
local ClickOnSelItem, ClickedItmNum
for i, v in pairs (LE.Sel_Items) do
if v == Fx_P then
Expand Down Expand Up @@ -2357,7 +2364,7 @@
elseif ItemWidth < 5 and ItemType =='V-Slider' then ItemWidth = 4
end

if ModifierHeld == 0 then ItemWidth = ItemWidth+ Dx end
if Mods == 0 then ItemWidth = ItemWidth+ Dx end

if ItemType =='Sldr' or ItemType =='V-Slider' or ItemType =='Drag' or ItemType == 'Selection' or ItemType == 'Switch' then
FX[FxGUID][Fx_P].Sldr_W = ItemWidth
Expand All @@ -2374,7 +2381,7 @@
local Dx,Dy = r.ImGui_GetMouseDelta(ctx)
if not FX[FxGUID][Fx_P].Sldr_W then FX[FxGUID][Fx_P].Sldr_W = Df.KnobRadius end
local DiagDrag = (Dx+Dy) /2
if ModifierHeld == 0 then
if Mods == 0 then
FX[FxGUID][Fx_P].Sldr_W = FX[FxGUID][Fx_P].Sldr_W+ DiagDrag;
end
if LBtnRel and LE.ChangeRaius==Fx_P then FX[FxGUID][Fx_P].Sldr_W = roundUp(FX[FxGUID][Fx_P].Sldr_W, LE.GridSize/2) end
Expand Down
Loading

0 comments on commit 327bbdf

Please sign in to comment.