2011/12/12 David Baelde <david.bae...@gmail.com>:
> Thank you Romain for this important evolution of Flows.
>
> I have added an user/password for my private radio, then I got my token with
>  http://flows.liquidsoap.fm/radio?name=Friends
>
> I'm taking this opportunity to advertise some sample code that anyone
> can copy to get metadata notifications on their website. With the new
> token, it is more robust as Romain said:
>  http://mrpingouin.is-a-geek.net/radio.html
>
> Eventually this simple example will go to the doc, but I'm not sure
> when. Romain, do you plan any more changes? I liked the "cmd" and
> "data", now it's "radio" if the command is "metadata". A good point is
> that it's the same structure (as far as I checked) as the one received
> on the "join" event. Will it always be "cmd" (to know what changed)
> and "radio" (to know the current state)? Actually my question may be
> silly cause the only notification command seems to be "metadata" for
> now.

When refactoring the code, it happenned that notifications ended-up
reflecting exactly how the flows protocol works in a way where we had
and desired to send all available information about the radio
currently sending a message.

It thus made sense to make it explicit that each message contained a
given command and the radio data associated with that command.

I'll document all this in details but here is a brief overview of the
notification protocol.

Each radio token is associated to notifications concerning that radio.
Additionally, the "flows" channel receives notification for any radio.
This is the one used on the flows webpage.

After connecting, the socket sends a "join" message along with either
a token or "flows". It then receives either an "error" message, with a
string describing the error or a "joined" message, along with the
current information about the requested radio. The "flows" channel,
however, receives data about all radios currently registered along
with the "joined" message.

Then all following received messages are notifications of commands
sends to the flow system. Each message contains a javascript objects
data of the form:
{ cmd  : <command name>
  radio : <latest radio data> }
radio contains the latest information about the radio emitting this
message. Command is one of the following:

"add radio": This message is sent every time a radio is registered
through flows. It is received for new and existing radios upon
starting up.

"ping radio": This message is received when a radio wishes to notify
that it is still alive. It is regulartly send by register_flow though
I do not remember its frequency at the moment.

"clear streams": Sent by a radio in order to clear all existing streams.

"add stream": Sent by a radio to register a new stream

"metadata": Sent by the radio to notify of new metadata, currently
only title and artist.

I'll write more about this in the near future.

Finally, concerning the order, it is nothing that can't be fixed. I'll
try to add an option to the webpage as soon as possible..

Romain

------------------------------------------------------------------------------
Learn Windows Azure Live!  Tuesday, Dec 13, 2011
Microsoft is holding a special Learn Windows Azure training event for 
developers. It will provide a great way to learn Windows Azure and what it 
provides. You can attend the event by watching it streamed LIVE online.  
Learn more at http://p.sf.net/sfu/ms-windowsazure
_______________________________________________
Savonet-users mailing list
Savonet-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/savonet-users

Reply via email to