ossia / qml-remote

1 stars 1 forks source link

Information to establish the timeline #1

Closed slebdaoui closed 3 years ago

slebdaoui commented 3 years ago

To establish the timeline in the remote-control we need to be informed by score about the total length of the scenario as well as the current position of the score's timeline.

jcelerier commented 3 years ago

Hello, for the total length, I was thinking : maybe the best would be for you to parse the save file directly ? This way you can get all the relevant informations. It's a simple JSON file that can be parsed with, well, JSON.parse() in JS.

The unit of time is the flick (https://github.com/facebookarchive/Flicks)

jcelerier commented 3 years ago

In ossia/score@829c28550d91e9b6525a08290bb536242e283f6b I added a heartbeat that will send regularly the position of every interval currently playing.

To match that with the file format:

at position=0 time is 0 (no surprise) at position=1 time is equal to the DefaultDuration in the save file (and yes, position can go beyond 1).

I made a small jq script to clean up a bit the save files if you want to look at the important parts without getting lost:

def remove_keys(keyToRemove):
    walk(
        if (type == "object" and (keyToRemove) ) then
            del(keyToRemove)
        else
            .
        end
    );

.Document.BaseScenario.Constraint | remove_keys(.Inlet) | remove_keys(.Inlets) | remove_keys(.Outlet) | remove_keys(.Outlets) | remove_keys(.States) | remove_keys(.Events) | remove_keys(.SmallViewRack) | remove_keys(.FullViewRack)  
jcelerier commented 3 years ago

anything else you need for that ?