Page 1 of 1

Set Playlist Track

Posted: 07 Aug 2024 19:30
by benjavides
I would like to create an OSC command: /audio/playback/set/fade
which receives a single int number indicating a song index.
It should start playing that song in the currently open playlist. It should behave in this way:
  • If there is music playing:
    1. load the specified track (in the next avaliable player) and start fading to it.
    2. When the fade finishes, unload the track that was playing.
    3. Load the track that is after the specified index as the “next track”
  • If there is no music playing:
    1. load the specified track and start playing it.
    2. Load the track that is after the specified index as the “next track”
This is what I tried first:
Image
It works as expected if there is music playing. But when there is not, it loads the specified index track as the next one and starts playing the track that was set as the “next one” before the command executed.

My current workaround is to unpause the playlist (if it's paused) before executing the instructions. So that it always acts as if music is running.
Image

The problem with this is that the public will be able to listen to the fading transition between the song that was originally paused and the song that the user is setting.

Is there a better way to achieve what I want?

Re: Set Playlist Track

Posted: 08 Aug 2024 11:32
by radio42
It seams almost the same issue as in your other post.
The LOAD_SELECTED command is executed asyc, as such, the SLEEP needs to be large enough.
Try setting it to 3 seconds or more...