Hi,

I'm trying to use a cross fade function that I've seen on the liquidsoap
documentation web pages.
The function is this:

# Our custom crossfade that
# only crossfade between tracks
def my_crossfade(s) =
  # Our transition function
  def f(_,_, old_m, new_m, old, new) =
print("WORKING")
    # If none of old and new have "type" metadata
    # with value "jingles", we crossfade the source:
    if old_m["type"] != "jingle" and new_m["type"] != "jingle" then
print("CROSSFADE")
add([fade.initial(new), fade.final(old)])
    else
print("SEQUENCE")
sequence([old,new])
    end
 end
 # Now, we apply smart_cross with this function:
 smart_cross(f,s)
end

This function works only at the first sequence between the starting jingle
and the first song.
After the first song, the function is no more activated by Liquidsoap.
I've inserted some print commands to view when the function is called: I
see "WORKING" only one time.

This is my liq file:

set("log.stdout",true)
set("log.file",false)
%include "c:\liquidsoap-win32\library.liq"

# Music
ita = playlist(mode="normal","c:\liquidsoap-win32\mp3\ita.m3u")
int = playlist(mode="normal","c:\liquidsoap-win32\mp3\int.m3u")
# jingles
jingles = playlist(mode="randomize","c:\liquidsoap-win32\mp3\jingles.m3u")
# Security
security = single("c:\liquidsoap-win32\mp3\jingles\01.mp3")

# playlist switch
radio = fallback([
switch([
({ 6h-18h30 }, ita),
({ 18h30-6h }, int)
]),
security
])
# add the jingles
radio = rotate(weights = [1, 2],[jingles, radio])

#METADATA
radio = on_metadata(apply_metadata,radio)

# crossfade
radio = my_crossfade(radio)


 # Stream it out
...

Why the function my_crossfade is called only one time, between the first
jingle and the first song?
What am I doing wrong?

Thanks for your help


Antonio
------------------------------------------------------------------------------
Download BIRT iHub F-Type - The Free Enterprise-Grade BIRT Server
from Actuate! Instantly Supercharge Your Business Reports and Dashboards
with Interactivity, Sharing, Native Excel Exports, App Integration & more
Get technology previously reserved for billion-dollar corporations, FREE
http://pubads.g.doubleclick.net/gampad/clk?id=164703151&iu=/4140/ostg.clktrk
_______________________________________________
Savonet-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/savonet-users

Reply via email to