Page 1 of 1
[API] layer/connectedClip
Posted: Sat Aug 13, 2022 22:13
by bcrotaz
Finding out if any clips on a layer are connected requires downloading the full status of every clip on the layer with /composition/layer/1 which is a) huge and b) slow.
A new api call would allow get and post for the current connected clip on a layer:
GET,POST /composition/layer/1/clips/connected
GET,POST /composition/layer-by-id/abc123/clips/connected
In my use case I'm populating a layer from a folder of files. I want to know if any clip is connected so that I can reconnect it when the import is complete.
Re: [API] layer/connectedClip
Posted: Fri Aug 16, 2024 20:28
by davidgvr
Hello,
there is another reason to have such an URI : unless I'm mistaken, all REST API responses only contain information
related to currently loaded deck (would appreciate if someone of Resolume can confirm, to be sure I understood the API behavior).
So when you change the active deck, still having clip connected/playing from the previous one, you don't have any possibility (ie. there is no URI giving a response you could parse to identify a specific item with specific property) to know if a clip is currently played on a layer and which one : no clip of the new deck layers as the "connected" state to /^Connected/ .
My use-case is to avoid loading a clip on a layer with a clip already being played. But another more basic use-case is simply to know what clips are being played by layers after any deck change.
I'm skeptical that such a need hasn't been expressed more. Is there an alternative method I've missed ?
No solution on OSC side for the same reason (playing clip being not part of the current deck/layers, it can be targeted by OSC address)
(I also have other needs on the REST API related to "current items" I will post on a separate thread

)
Thanks in advance for any response !
--
David
Re: [API] layer/connectedClip
Posted: Mon Aug 26, 2024 14:07
by Zoltán
If you keep track of the clips played in your app, you should be able to avoid starting the same file again. Composition data should have the file, you watch which clips play.
You're not starting to use the API just right after the deck switch, correct?
Re: [API] layer/connectedClip
Posted: Thu Sep 19, 2024 21:22
by davidgvr
Hello Zoltán,
sorry for my response delay.
In my case, I'm still mainly piloting my show directly inside Resolume UI. My application only handles some scheduled clips from time to time, and so is not aware of all other clips being played directly via Resolume UI.
That's why my first idea was focused on a API that could help my app to get an updated status of the layers.
But to keep your idea of tracking what is being played on Resolume, maybe I could enable a limited set of OSC output messages, on only the relevant addresses related to clips and layers connection/clearing and determine if a clip is being played on a layer, even after a deck change. I prefer not to enable all OSC output messages to avoid useless processing on my app side.
Re: [API] layer/connectedClip
Posted: Tue Sep 24, 2024 14:50
by Zoltán
You can send a
/composition/layers/*/clips/*/connected
with string "?"
to ask for the clip statuses you'll get an int
This has 5 states,
0= empty slot,
1=clip present, not connected or previewed
2=clip previewed, but not connected
3=connected, but not previewed,
4=clip previewed and connected.
This works also with a specific OSC preset set up.