[RoarAudio] Device/Server enumeration

Philipp Schafft lion at lion.leolix.org
Tue Sep 14 04:54:13 CEST 2010


For apllications it may be nice to provide a list of servers as default
so the user can simply select them from a drop down menu or select list.

To address this there is a new feature in libroar to get such a list.

but before you continue to read here is a word of warning:
The user should always be abled to just write a server address in a
freeform input to allow unknown network based servers or specal local
addresses. The following is usefull for *supporting* the user by
providing hints and defaults but the user must not be restricted to the
returned list of servers.

To get a list of servers you call the function roar_enum_servers().
It takes some arguments. The first is the flags argument. This will
change the used algos. Normal applications should set this to
ROAR_ENUM_FLAG_NONE. Changeing this will result in diffrent quality of
hits and diffrent number of hits (because some search algos may be
disbaled by some flags). This function may run some secs if not set
NONBLOCK (see docs). This is normal. If you can disable the algos which
take most of the time but this will result in (significantly) worse

The other to args are a stream direction and a socktype (like AF_*, just
diffrent consts). Those can be used to filter servers to get a list
which matchs more accorate to your needs.

All of those parameters (expect the NONBLOCK flags) are hints-only.
libroar may ignore them.

The function will return an array of server addresses with optional
server description and location.

The array needs to be freed after use.

I attach a small example which should make everything left clear.

If you have comments, suggestions, idaes for new data sources,... let me
know by pressing your reply button ;)

 (Rah of PH2)
-------------- next part --------------
A non-text attachment was scrubbed...
Name: enum-test.c
Type: text/x-csrc
Size: 456 bytes
Desc: not available
URL: <http://lists.keep-cool.org/pipermail/roaraudio/attachments/20100914/57c5d251/attachment.c>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 482 bytes
Desc: This is a digitally signed message part
URL: <http://lists.keep-cool.org/pipermail/roaraudio/attachments/20100914/57c5d251/attachment.pgp>

More information about the RoarAudio mailing list