Get OSC message on surface playback end/loop
  • amongconsequently
    junior Member
    Posts: 3
    Joined: Tue Oct 29, 2024 10:39 am

    Get OSC message on surface playback end/loop

    by amongconsequently » Tue Oct 29, 2024 10:50 am

    Hello,
    I have a setup where I switch the media playing on multiple surfaces through OSC and I need some way to get notified when the media finishes playing or loops.
    I googled a bit and it seems possible to attach a control to specific media content to get an OSC message on playback end, but I'd have to attach the control to every single media item - is there any way to attach it to the surfaces instead, so that i can dynamically load any number of media?
  • mad-matt
    garageCube team
    Posts: 1557
    Joined: Mon Sep 09, 2013 5:50 pm

    Re: Get OSC message on surface playback end/loop

    by mad-matt » Tue Oct 29, 2024 11:29 am

    You can get the values of any parameter with OSC Query (https://github.com/Vidvox/OSCQueryProposal)
    You can request visual name for a surface from address "/surfaces/Quad-1/visual/name"
    Then request the playhead position of a visual with "/visuals/VISUAL_NAME/position_sec" (with OSC query you can get the address range and value, so if value == range max and the movie is set to play once (not looping) then it finished. If it's set to loop, you can just check is position_sec is less than previous value.
    There's no way to get this information directly from surface
  • amongconsequently
    junior Member
    Posts: 3
    Joined: Tue Oct 29, 2024 10:39 am

    Re: Get OSC message on surface playback end/loop

    by amongconsequently » Tue Oct 29, 2024 4:14 pm

    OSCQuery is just what i needed, thanks!
    Additionally, I was experimenting in changing the source file for a media using

    Code: Select all

    /medias/NAME/replace_file
    and passing the absolute path of the source video as string argument, but this doesn't seem to be working. Is there something else I should be doing? I am also wondering on the performance hit when changing the source file instead of changing the media by

    Code: Select all

    /surfaces/SURF_NAME/visual/name

Who is online

Users browsing this forum: No registered users and 46 guests