
#ifndef __M3_SERVER_H__
#define __M3_SERVER_H__

#include "../mecha/mecha.h"
#include "../modhttp/http.h"
#include "m3_client.h"

typedef struct s_M3Server M3Server;

M3Server * m3_server_new (void);
void m3_server_destroy (void *ptr);

bool m3_server_parse (M3Server *instance, const char *siteid, const xmlTtag *m3Tag);

const char * m3_server_metadata_title_get (M3Server *instance);
const char * m3_server_metadata_url_get (M3Server *instance);
const char * m3_server_browser_url_get (M3Server *instance);
const char * m3_server_file_displayname_get (M3Server *instance);
const char * m3_server_mountpoint_get (M3Server *instance);
int m3_server_connected_clients (M3Server *instance);
int m3_server_skipped_ip_address (M3Server *instance);

void m3_server_skip_track (M3Server *instance, httpTtrans *trans);

bool m3_server_reload_playlist (M3Server *instance);

void m3_server_client_add (M3Server *instance, M3Client *client);
void m3_server_client_remove (M3Server *instance, M3Client *client);

bool m3_server_add_file (M3Server *instance, const char *playlist, const char *fileName);

#endif
