forked from ReaTeam/ReaScripts
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Release Save ripple mode to persistent ExtState v1.0
- Loading branch information
1 parent
5535c8b
commit 2afb926
Showing
1 changed file
with
29 additions
and
0 deletions.
There are no files selected for viewing
29 changes: 29 additions & 0 deletions
29
Items Editing/mendel_Save ripple mode to persistent ExtState.lua
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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() |