From: Romain B. <to...@ra...> - 2011-06-14 19:51:46
|
Hi again! 2011/6/14 James Ford <jam...@gm...>: > I appreciate your quick response. You're welcome! > I don't want to be a pain but I think my > main problem here is my understanding of using def...as your example shows: > > def transition(old,new) = > sequence([single("/path/to/ > intro.mp3"),new]) > end > > I don't understand what the (old,new) part refers to and how that is even > used in the fallback statement. I think I need to gain an understanding of > how this works to be able to really make use of this. Do you have any tips > for where I could really learn these types of commands for beginners like > myself? I would search for it, but I don't know what it is called :) > > I appreciate your assistance with some direction as I don't think I'm going > to get much farther w/ liquidsoap w/o learning these functions. Thanks! so, this code: def transition(old,new) = sequence([single("/path/to/intro.mp3"),new]) end defines a function. This function takes two arguments, the old source (old) and the new source (new). The function is called when switching from one source to another inside the fallback. old is the source that is being left and new is the source that is being switched to. The result of the function is a source. This source combines the old and new source in order to create the transition of your choice. For instance, in the above code, the old source is immediatly discarded and the transitions consists of a sequence of one track of a single source -- your intro stream -- followed by the new source being switched too. You could enhance it by doing for instance: def transition(old,new) = sequence([single("/path/to/intro.mp3"), fade.initial(new)]) end In this case, the new source would be faded in when switching to it. Hope this helps, Romain |