[icecast-dev] Params and handling

Michael Smith msmith at xiph.org
Thu Nov 20 20:07:35 PST 2003



On Friday 21 November 2003 14:18, Deven Phillips wrote:
>  From reading through the code, I can understand that the parameters are
> read from the XML config file and stored in the void pointer "data", but
> if I am writing a new playlist module that needs additional parameters,
> how would I go about handling adding this to the code? I have a MySQL
> playlist module written, but I cannot seem to integrate the parameters
> such that the admin would be able to define the MySQL connection options
> in the XML config file.
>
> Any help would be appreciated, and yes, I do realize that my coding
> skills are VERY rusty. Please forgive me if the answer to this question
> SHOULD be obvious.
>
> Deven

Deven,

Are you trying to add your playlist module to ices2? Or ices 0.x? Or something 
else entirely? You forgot to say anything about _what_ code you were reading 
through.

If you're talking about ices2, then it works like this:

1) Create new playlist_mysql.c, add it to Makefile.am so it gets built
2) Edit im_playlist.c, add (around line 50) your new playlist initialisation 
function - you'll probably want to include playlist_mysql.h for the 
declaration of it. The string should be 'mysql', this'll be the config string 
to use this module.
3) In playlist_mysql.c, add your new playlist_mysql_initialise function. This 
gets passed a module_param_t * - this is the first item in a linked list of 
parameters, each one having a name and a value (name and value are both 
strings). Iterate over the list, getting out any parameters you need. You'll 
also need to initialise the playlist structure (playlist_state_t *pl). You 
can allocate and use pl->data as private storage for your playlist module.

4) Write the other functions used for the playlist, most notably 
playlist_mysql_get_next_filename() - the data parameter is your pl->data 
private data pointer, whatever that might be. Use it however you want. You 
need to return a filename, this is the next file that will be played.

Mike

<p>--- >8 ----
List archives:  http://www.xiph.org/archives/
icecast project homepage: http://www.icecast.org/
To unsubscribe from this list, send a message to 'icecast-dev-request at xiph.org'
containing only the word 'unsubscribe' in the body.  No subject is needed.
Unsubscribe messages sent to the list will be ignored/filtered.



More information about the Icecast-dev mailing list