Not really, cf http://savonet.sourceforge.net/doc-svn/language.html
More like
[...]
list.map(fun (key_value) -> if key_value==("title","") then
if m["filename"] ==
"usr/local/www/rcr/ogg/announce/opener/opener-sstol.ogg" then
("title","opener-sstol.ogg")
elsif m["filename'] == "usr/local/www/rcr/ogg/announce/SOD.ogg" then
("title","Good_Morning.ogg")
elsif ...
...
else ("title", "default value for instance m["filename"] but put
whatever you want")
end
else key_value end,
[...]
Le 07/12/2010 21:35, [email protected] a écrit :
> Thanks Clem,
>
> I figured I wouldn't be able to change the 'icogg.ogg'.
>
> As far as the value 'm["filename"]' - would it be possbile to nest
> further conditionals within that first if-then statement?
>
> Something along the line of:
>
> if m["filename'] ==
> "usr/local/www/rcr/ogg/announce/opener/opener-sstol.ogg"
> then ("title",m["opener-sstol.ogg"[)
>
> if m["filename'] == "usr/local/www/rcr/ogg/announce/SOD.ogg"
> then ("title",m["Good_Morning.ogg"[)
>
> Is the syntax correct (particularly around the opening 'if' and are
> should the
> url be enclosed by '( . . . )'?
>
> Again thanks for spotting the error!
> Andre
>
>
>
> On Tue, 07 Dec 2010 14:56:03 -0500, Clement Renard
> <[email protected]> wrote:
>
>>
>> Hi again,
>>
>> I'm not a liquidsoap specialist so I won't be of much help but :
>> - you can indeed display what you want : the relevant line is :
>> if key_value==("title","") then
>> ("title",m["filename"]) else key_value end
>> Here you put as title metadata the value m["filename"] ie the value
>> of filename metadata. However you can put whatever you want instead.
>> - I don't think you can change what shows initially on client
>> player.because it cannot guess so it waits for first metadata.
>>
>> Regards,
>>
>> Clem
>>
>> Le 07/12/2010 20:03, [email protected] a écrit :
>>> Hi Bernard!
>>>
>>> Thanks!
>>>
>>> I had noticed the 'a', but thought I had replaced it with 'icogg'.
>>>
>>> Anyway, it now does give the filename alright - ALL of it:
>>>
>>> 'usr/local/www/rcr/ogg/announce/opener/opener-sstol.ogg'
>>>
>>> If it was PHP, I'd be able to shorten the name just to the final
>>> 'opener-sstol.ogg'.
>>>
>>> Is there anyway that I could create a map so that, for this filename
>>> (and for all
>>> other filenames, for that matter), it would display either
>>> 'opener-sstol.ogg' or
>>> maybe an even *prettier* name of my choosing?
>>>
>>> I'm not too familiar with liquidsoap's programming language (as you
>>> probably
>>> already guessed :) and have difficulty adjusting existing code to my
>>> needs.
>>>
>>> Btw, is it normal that on initial connection
>>> (http://xxx.xxx.xxx.xxx/icogg.ogg) that
>>> it displays only 'icogg.ogg' in the listener's player url? Is there
>>> anyway of changing
>>> that to read something more informative, like the station's name?
>>>
>>>
>>> Thanks,
>>> Andre
>>>
>>>
>>> On Tue, 07 Dec 2010 13:27:46 -0500, Clement Renard
>>> <[email protected]> wrote:
>>>
>>>>
>>>> Hello Andre,
>>>>
>>>> The error was at the next line :
>>>>
>>>> icogg = fill_in(sstol)
>>>> icogg = smart_crossfade(start_next=0.4, fade_in=0.2, fade_out=0.2,
>>>> conservative=true, a)
>>>> ^
>>>>
>>>> Here you need to put iccogg instead of a.
>>>>
>>>> However with the script as you posted it I don't think you can hear
>>>> anything but SOD.ogg...
>>>>
>>>> HTH,
>>>>
>>>> Clem
>>>>
>>>> Le 07/12/2010 18:10, [email protected] a écrit :
>>>>> Hi Romain!
>>>>>
>>>>> Thanks for the debug line.
>>>>>
>>>>> I checked the logs, and nothing shows up! I'm wondering whether
>>>>> the use of
>>>>> 'single' and 'playlist.safe' might be interferring with this
>>>>> function.
>>>>>
>>>>> I've tried moving the function before the source assignations, and
>>>>> to move
>>>>> the call for each source prior to it being assigned 'single', but
>>>>> to no
>>>>> avail.
>>>>>
>>>>> When I connect, the player's info box has only 'icogg.ogg' in the
>>>>> window.
>>>>> Once
>>>>> pre-buffering has finished, 'it changes to 'Unknown'. Neither of
>>>>> these
>>>>> behaviours
>>>>> is desired, but I have no idea where to change them. I thought
>>>>> David's
>>>>> function
>>>>> would do the trick -- and it did -- once or twice with the
>>>>> non-functioning
>>>>> liq
>>>>> scripts I had written (but those scripts had been moved to trash).
>>>>>
>>>>> Now that I have a functioning script, the function does not seem
>>>>> to work.
>>>>> Where
>>>>> would I check for output seeing that I'm running CLI to teh remote
>>>>> server?
>>>>>
>>>>> Any help to get this 'Unknown' behaviour changed would be greatly
>>>>> appreciated.
>>>>> Once that is done, I can get online -- finally!
>>>>>
>>>>> Thanks,
>>>>> Andre
>>>>>
>>>>>
>>>>>
>>>>> On Tue, 07 Dec 2010 11:17:19 -0500, Romain
>>>>> Beauxis<[email protected]>
>>>>> wrote:
>>>>>
>>>>>> Hi Andre!
>>>>>>
>>>>>> Le lundi 6 décembre 2010 22:42:48, [email protected] a écrit :
>>>>>>> # Fill-in Title for ID3 Tag
>>>>>>>
>>>>>>> def fill_in(s)
>>>>>>> # the function f takes a list of pairs m
>>>>>>> representing
>>>>>>> the metadata # and it maps an anonymous function on each pair #
>>>>>>> replacing
>>>>>>> empty title definitions by title=filename def f(m)
>>>>>>> list.map(fun (key_value) ->
>>>>>>> if key_value==("title","") then
>>>>>>> ("title",m["filename"]) else key_value end,
>>>>>>> m)
>>>>>>> end
>>>>>>> map_metadata(f,s)
>>>>>>> end
>>>>>>>
>>>>>>> # Then just wrap your source at an appropriate
>>>>>>> spot:
>>>>>>> # source = fill_in(source)
>>>>>>>
>>>>>>>
>>>>>>> icogg = fill_in(sstol)
>>>>>> This seems ok on the surface. What you can do to debug and see
>>>>>> what is
>>>>>> going
>>>>>> on is add a line like this in the definition of f(m):
>>>>>>
>>>>>> print("\n\nFor metadata: #{m}\n\n")
>>>>>>
>>>>>> This should print the metadata everytime they are passed to the
>>>>>> function.
>>>>>>
>>>>>> Romain
>>>>>
>>>>
>>>>
>>>> ------------------------------------------------------------------------------
>>>>
>>>> What happens now with your Lotus Notes apps - do you make another
>>>> costly
>>>> upgrade, or settle for being marooned without product support? Time
>>>> to move
>>>> off Lotus Notes and onto the cloud with Force.com, apps are easier
>>>> to build,
>>>> use, and manage than apps on traditional platforms. Sign up for the
>>>> Lotus
>>>> Notes Migration Kit to learn more. http://p.sf.net/sfu/salesforce-d2d
>>>> _______________________________________________
>>>> Savonet-users mailing list
>>>> [email protected]
>>>> https://lists.sourceforge.net/lists/listinfo/savonet-users
>>>
>>>
>>
>
>
------------------------------------------------------------------------------
What happens now with your Lotus Notes apps - do you make another costly
upgrade, or settle for being marooned without product support? Time to move
off Lotus Notes and onto the cloud with Force.com, apps are easier to build,
use, and manage than apps on traditional platforms. Sign up for the Lotus
Notes Migration Kit to learn more. http://p.sf.net/sfu/salesforce-d2d
_______________________________________________
Savonet-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/savonet-users