Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

SugarCube - play audio track one after another or multiple playlist ?

maybe the title make you confuse, so i'll make this clear

how to play next audio track when the recent audio playback end normally.
<<audio "bgm_track-one" play>> <<audio "bgm_track-two" play>>
that code will play both track together but how to make track-two play after track-one end ?

i know there's already macro for playlist, but can i make multiple playlists ? because as you can see in http://www.motoslave.net/sugarcube/docs/macros.html#macros-setplaylist , there's no additional information about how to make another playlist

what i want is just like this
<<setplaylist "bgm_track-one" "bgm_track-two">>
<<setplaylist2 "bgm_track-three" "bgm_track-four" "bgm_another-track">>
is this possible ?

Comments

  • The thought behind the playlist macros was that you'd only have one active playlist at a time.  So, no, the current playlist macros do not support multiple active playlists.

    That said, you can easily support multiple playlists (though only one may be active) by simply calling the &lt;&lt;setplaylist&gt;&gt; macro again.  To make switching between these playlists easier, I'd suggest using widgets.  For example:

    <<widget "pls1">>\
    <<playlist stop>>\
    <<setplaylist "bgm_track-one" "bgm_track-two">>\
    <<playlist play>>\
    <</widget>>

    <<widget "pls2">>\
    <<playlist stop>>\
    <<setplaylist "bgm_track-three" "bgm_track-four" "bgm_another-track">>\
    <<playlist play>>\
    <</widget>>
    Usage:

    /% Start playing the first playlist. %/
    <<pls1>>

    /% Then at some later point, switch to the second playlist. %/
    <<pls2>>

    If you actually need multiple playlists active and playing concurrently, then you'd, currently, have to do that manually.
  • great, its works now
Sign In or Register to comment.