Old 12-22-2018, 09:03 AM   #1
andyp24
Human being with feelings
 
andyp24's Avatar
 
Join Date: Mar 2016
Posts: 1,242
Default Get and Set Ripple State

Hi

I'm fairly sure I found an answer to this a while ago, but now I'm searching again for it (actually being ready to try writing the script this time) I can't see where.

How in ReaScript (Lua) do I get and set the values of the Ripple State, so I can change Ripple editing modes during the script and then reset them to the way they were?

Many thanks
Andy
andyp24 is offline   Reply With Quote
Old 12-22-2018, 10:11 AM   #2
mpl
Human being with feelings
 
mpl's Avatar
 
Join Date: Oct 2013
Location: Moscow, Russia
Posts: 3,984
Default

reaper.GetToggleCommandState( command_id ) with related action IDs
mpl is offline   Reply With Quote
Old 12-22-2018, 11:09 AM   #3
andyp24
Human being with feelings
 
andyp24's Avatar
 
Join Date: Mar 2016
Posts: 1,242
Default

That's the one!

Thanks mpl
andyp24 is offline   Reply With Quote
Old 11-18-2021, 07:32 AM   #4
luiza177
Human being with feelings
 
Join Date: Mar 2020
Posts: 195
Default

Hey all, sorry to revive this thread, but I've been attempting to do exactly this but it doesn't seem to be working. My code basically get the state, turns off ripple editing, then restores the state after doing stuff (in my case, deleting stuff). I've tried using both SetToggleState and just running the action with Main_OnCommand, but neither turns on ripple editing again. Any ideas?

Code:
reaper.Undo_BeginBlock()

function deletePT()
  local delete = reaper.NamedCommandLookup('_SWS_AWBUSDELETE')  
  reaper.Main_OnCommand(delete, 0)
  reaper.GetSet_LoopTimeRange(true, false, 0,0,false)
  reaper.Main_OnCommand(40289, 0) --Item: Unselect all items
end


rippleOn = reaper.GetToggleCommandState(1155)
if rippleOn == 1 then
  rippleAll = reaper.GetToggleCommandState(40311) -- Set ripple editing all tracks
  -- reaper.ShowConsoleMsg(rippleAll)
  reaper.Main_OnCommand(40309, 0) -- Set ripple editing off
  deletePT()
  if rippleAll == 1 then
    rippleAll = reaper.SetToggleCommandState(0, 40311, 1) -- Set ripple editing all tracks
    -- reaper.Main_OnCommand(0, 40311) -- Set ripple editing all tracks
  else
    -- reaper.ShowConsoleMsg("blah")
    rippleAll = reaper.SetToggleCommandState(0, 40310, 1) -- Set ripple editing all tracks
    -- reaper.Main_OnCommand(0, 40310) -- Set ripple editing per-track
  end
else
  deletePT()
end

  
-- reaper.ShowConsoleMsg(rippleState)

reaper.Undo_EndBlock("Delete like PT (ignore Ripple)", 0)
luiza177 is offline   Reply With Quote
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -7. The time now is 02:55 PM.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2024, vBulletin Solutions Inc.