Old 08-02-2017, 10:57 AM   #1
bFooz
Human being with feelings
 
Join Date: Jul 2010
Location: Slovakia
Posts: 2,588
Default API: InsertTrackAtindex broken

It seems that InsertTrackAtindex is broken. It does not properly works with undo/redo and there is a big chance of deleting items:

1 - create 2 tracks with items on both
2 - run this script
Code:
reaper.Undo_BeginBlock() 

reaper.InsertTrackAtIndex(1, false)

--just to create  some undo  
reaper.Main_OnCommand( "22", 0 )

reaper.Undo_EndBlock( "Insert track BUG", 0 ) 
reaper.UpdateArrange()  
reaper.TrackList_AdjustWindows(false)
3 - hit Undo
4 - hit Redo
5 - watch items being deleted and not staying in their tracks properly



Also there is a problem of not updating the scrollbar properly as mentioned in another post from 2014.

This is a big one for me, there were times I have been desperate why I have my stuff out of place and missing and I have finally got to the reason. Devs, thanks in advance for fixing this.
bFooz is offline   Reply With Quote
Old 08-06-2017, 10:51 AM   #2
Justin
Administrator
 
Justin's Avatar
 
Join Date: Jan 2005
Location: NYC
Posts: 15,721
Default

Yeah, we can improve this.

For best compatibility with old versions, I suggest adding:
Code:
 Undo_OnStateChangeEx("whatever",-1,-1)
Justin 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:44 PM.


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