Well, that wasn't easy to do but here is a function that should work for
you:

# Creates a source that merges one track from each passed sources
# as a single merged track and loops. For instance,
rotate_sequence([intro,main,outro])
# creates a source that plays a sequence [intro,main,outro] as single track
and loops back.
# @param ~id Force the value of the source ID.
# @params sources Sequence of sources to be merged
def rotate_sequence(~id="",sources)
  first_ready = ref true
  second_ready = ref true

  def is_first_ready() =
    !first_ready
  end

  def is_second_ready() =
    !second_ready
  end

  def to_first(old,new) =
    if !first_ready then
      first_ready := false
      second_ready := true
    else
      first_ready := true
      second_ready := false
    end

    new
  end

  source = rotate(transitions=[to_first],sources)
  source = merge_tracks(source)

  switch(id=id,track_sensitive=false,[(is_first_ready, source),
(is_second_ready, source)])
end

I'm going to add to to the API for the next release unless perhaps David
sees a potential problem with using the same source it two branches of a
switch..

Let me know if it works for you..

Romain

2016-04-26 22:30 GMT-05:00 Michael Pieper <[email protected]>:

> Am 27.04.2016 um 01:24 schrieb Romain Beauxis:
> > Instead, you should do:
> >
> > intro = playlist("intro")
> > outro = playlist("outro")
> > news  = playlist("news")
> >
> > radio = rotate([intro, news, outro, pl_musik])
> >
> > This should give you a source that plays intro, news, outro, pl_musik
> > and then do it again.
>
> Hi Romain.
>
> Yes this is working but I want to have the tripple intro-news-outro to
> be played every hour. So I don't want to count how much tracks of musik
> has to be played that it might fit to the schedule :-)
>
> so something like this:
>
> radio = switch( id="News", [
>         ( { 00m }, play_news() ),
>         ( { true }, radio)
> ] )
>
> Best regards
>    Michael
>
>
>
>
> ------------------------------------------------------------------------------
> Find and fix application performance issues faster with Applications
> Manager
> Applications Manager provides deep performance insights into multiple
> tiers of
> your business applications. It resolves application problems quickly and
> reduces your MTTR. Get your free trial!
> https://ad.doubleclick.net/ddm/clk/302982198;130105516;z
> _______________________________________________
> Savonet-users mailing list
> [email protected]
> https://lists.sourceforge.net/lists/listinfo/savonet-users
>
>
------------------------------------------------------------------------------
Find and fix application performance issues faster with Applications Manager
Applications Manager provides deep performance insights into multiple tiers of
your business applications. It resolves application problems quickly and
reduces your MTTR. Get your free trial!
https://ad.doubleclick.net/ddm/clk/302982198;130105516;z
_______________________________________________
Savonet-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/savonet-users

Reply via email to