I'm trying to create a "rewind" feature that jumps back to the previous label in a timeline. Using tl.previousLabel(), without any arguments, gets the name of the most recent label (and yields the same result as tl.currentLabel() ). If I want to get the name of the label BEFORE the most recent label, and if my labels are created at arbitrary times, I can't provide the number of seconds to the previousLabel() to search through.
I've created a function to do this by gathering the array of labels, finding the index of the current label in that array, then getting the (index-1) item from the array. It works great, but it seems cumbersome. There must be an elegant way to find the name of the previous label?