Hi, reading about this function, and not quite sure how to interpret option 2.
I am trying to build a track layout based on a lua table, where each row corresponds to a track in order that I want all tracks laid out in.
I have a table with original track layout info (no folders). That is, I know original track indices. I also have a table that specifies the structure I want, which might group some tracks into folders.
As I traverse through this table I always know if I am dealing with a folder I have to create, or an existing track that I have to put in a folder, or put at same level as previous deepest level (not as folder)
So the data table has number of rows, where each row has form
Code:
[i]
1. Track/Folder Name
2. IsFolder?
3. Nearest Parent (a row number of this table)
4. Original Track Index (if this row is a track and not folder)
So I could have
Code:
1.
1. Drums
2. 1
3. 0
4. ''
2.
1. Kick
2. 1
3. 1
4. ''
3.
1. Kick In
2. 0
3. 2
4. sometrackindex
4.
1. Kick Out
2. 0
3. 2
4. sometrackindex
5.
1. Synth Pad
2. 0
3. 0
4. sometrackindex
6.
1. Guitars
2. 1
3. 0
4. ''
7.
1. Gtr 1
2. 1
3. 6
4. ''
8.
1. Gtr 1 L
2. 0
3. 7
4. sometrackindex
9.
1. Gtr 1 R
2. 0
3. 7
4. sometrackindex
and so on.
When I create a folder, I understand this can be done with InsertTrackAtIndex. The index will always be i+1, where i is previously addeed row (track or folder) of my structure table that I am travesring. I also know every time I use InsertTrack I need to increment my original track indices.
Following some folder, by nature of my table, I always know what its children are.
I am quite close to understanding what I need to do. Just need to better understand nuances of ReorderSelectedTracks
thanks!