Go Back   Cockos Incorporated Forums > REAPER Forums > REAPER Bug Reports

Reply
 
Thread Tools Display Modes
Old 04-14-2024, 10:50 AM   #1
smandrap
Human being with feelings
 
smandrap's Avatar
 
Join Date: Feb 2021
Location: Right here
Posts: 1,575
Default [API] SetMediaTrackInfo_Value('C_LANEPLAYS:'N) and Undo

Test case:
  • Project with 1 track, fixed lanes ON
  • 2 Lanes on track, lane 1 playing
  • Run the following
    Code:
    local function DeleteActiveFixedLane(track)
      reaper.SetMediaTrackInfo_Value(track, 'C_LANEPLAYS:0', 0)
      reaper.SetMediaTrackInfo_Value(track, 'C_LANEPLAYS:1', 2)
      
      --Track lanes: Delete lanes (including media items) that are not playing
      reaper.Main_OnCommand(42691, 0)
      
      reaper.SetMediaTrackInfo_Value(track, 'C_LANEPLAYS:1', 0)
    end
    
    reaper.Undo_BeginBlock()
    DeleteActiveFixedLane(reaper.GetTrack(0, 0))
    reaper.Undo_EndBlock('test', 1)
  • Undo
  • Run the above script again

EXPECTED RESULT: Lane 1 is deleted, Undo restores Lanes, Lane 1 is deleted again

WHAT HAPPENS: Lane 1 is deleted, Undo restores Lanes, Lane 1 is not deleted when the script runs again.



Now: not sure if this is user(me) error, but it smells that it runs fine the first time, or any time the lane play state is set manually, But not after an undo

Can someone shed some light on this?
__________________
My Scripts
smandrap is online now   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 11:28 PM.


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