insert a breakpoint to stop playlist

Started by Terry, March 06, 2021, 04:35:31 PM

Previous topic - Next topic

Terry

Hello,

When playing, I want to insert a breakpoint to automatically stop playing the song when the playlist index hits that point.
What I do now is insert a null pathname in the playlist to fire "EV_PLAYLIST_SOUND_LOAD_FAILED" and m_audioAPI.PlayListStop.
Do you have any better suggestions?

Thank you.

Administrator

Hello,

not a very elegant approach but could be the unique available when dealing with third-party common playlist formats like m3u, pls and wpl.

If you should be using our PDJ format for your playlists, you could have a better option: as you may know, each <Item> tag added to the playlist may have a number of <CuePoint> sub-tags, each of them with a custom "name" attribute: you could add a <CuePoint> with its "name" attribute set to something readable (for example "breakpoint") like the one below:

<Item pathname="c:\mysounds\myfile.mp3" >
  <CuePoints>
    <CuePoint name="breakpoint" PosMs="20000" />
  </CuePoints>
</Item>

When the CallbackForPlayersEvents delegate is invoked with parameter EV_CUE_POINT_REACHED, check if the name of the cue point is "breakpoint" and, in case of positivity, invoke the m_audioAPI.PlayListStop method.
You can find how to get the name of a cue point within the CallbackForPlayersEvents delegate inside the "CuePoints" sample project.

Hope this helps.

Kind Regards

Severino Delaurenti
MultiMedia Soft