Skip to content

Commit

Permalink
Release Save ripple mode to persistent ExtState v1.0
Browse files Browse the repository at this point in the history
  • Loading branch information
bowlneudel committed Oct 27, 2020
1 parent 5535c8b commit 2afb926
Showing 1 changed file with 29 additions and 0 deletions.
29 changes: 29 additions & 0 deletions Items Editing/mendel_Save ripple mode to persistent ExtState.lua
@@ -0,0 +1,29 @@
-- @description Save ripple mode to persistent ExtState
-- @author mendel
-- @version 1.0
-- @about
-- # Save ripple mode to persistent ExtState
--
-- A most basic script that simply gets the current ripple mode, and saves it as a persistent ExtState. This state may be recalled by another script, and the ripple mode restored.
--
-- These two scripts are intended to be used in conjunction: as bookends to custom actions that require a programmatic change of the ripple mode.

Ra = reaper.GetToggleCommandState(41991)
R1 = reaper.GetToggleCommandState(41990)

function Save_Ripple_State()
if Ra==1 then
reaper.SetExtState("Ripple","RippleState","A",1)
-- reaper.ShowMessageBox("Ripple Mode Saved: All Tracks", "Ripple Mode", 0)
end
if R1==1 then
reaper.SetExtState("Ripple","RippleState","P",1)
-- reaper.ShowMessageBox("Ripple Mode Saved: Per Track", "Ripple Mode", 0)
end
if Ra+R1==0 then
reaper.SetExtState("Ripple","RippleState","N",1)
-- reaper.ShowMessageBox("Ripple Mode Saved: Off", "Ripple Mode", 0)
end
end

Save_Ripple_State()

0 comments on commit 2afb926

Please sign in to comment.