So imagine a scenario in which a user has RV open and is using Screening Room to view clips. They have selected three clips and chosen "Play Selected" which puts those three clips back-to-back on the timeline. Suppose each clip is a 50 frame sequence with image files in the range file.0101.exr to file.0150.exr. What we have is a timeline that RV thinks of as going from 1 to 150, with three clips whose frame ranges are 101-150 each.
[101 ...clip1... 150][101 ...clip2... 150][101 ...clip3... 150] <-- series of back-to-back clips
[1.......................................................................................150] <-- timeline as reported by RV's frameStart() and frameEnd()
My App (showing info for currently viewed clip):
[101 ...clip1... 150] (currentFrame: 101) <-- this is frame 1 of the timeline, but my app doesn't really know that
So how do I map between the timeline and the clip frame ranges? For instance, by tracking frame-changed events and querying sourcesRendered(), I am able to indicate which clip is currently being viewed, and even show its file frame range (via getCurrentAttributes()). Now suppose my remote application lets the user choose a frame to "go to" in RV. The user selects frame 104 (of the first clip because that is what is currently in view). I can't call "setFrame(104)" because that will set the timeline to the fourth frame of the third clip, not the fourth frame of the first clip (which RV thinks of as frame 4). What method is recommended for determining how each clip's frame range maps to the timeline frame range?