dmap-connection

## dmap-connection dmap-connection |

## Synopsis

    gboolean            (*DMAPConnectionCallback)           (DMAPConnection *connection,
                                                             gboolean result,
                                                             const char *reason,
                                                             gpointer user_data);
    enum                DMAPConnectionState;
    void                (*DMAPResponseHandler)              (DMAPConnection *connection,
                                                             guint status,
                                                             GNode *structure,
                                                             gpointer user_data);
    char *              (*authenticate)                     (DMAPConnection *connection,
                                                             const char *name);
    void                (*connected)                        (DMAPConnection *connection);
    void                (*connecting)                       (DMAPConnection *connection,
                                                             DMAPConnectionState state,
                                                             float progress);
    void                (*disconnected)                     (DMAPConnection *connection);
    void                dmap_connection_authenticate_message
                                                            (DMAPConnection *connection,
                                                             SoupSession *session,
                                                             SoupMessage *message,
                                                             SoupAuth *auth,
                                                             const char *password);
    SoupMessage *       dmap_connection_build_message       (DMAPConnection *connection,
                                                             const gchar *path,
                                                             gboolean need_hash,
                                                             gdouble version,
                                                             gint req_id,
                                                             gboolean send_close);
    void                dmap_connection_connect             (DMAPConnection *connection,
                                                             DMAPConnectionCallback callback,
                                                             gpointer user_data);
    void                dmap_connection_disconnect          (DMAPConnection *connection,
                                                             DMAPConnectionCallback callback,
                                                             gpointer user_data);
    gboolean            dmap_connection_get                 (DMAPConnection *self,
                                                             const gchar *path,
                                                             gboolean need_hash,
                                                             DMAPResponseHandler handler,
                                                             gpointer user_data);
    SoupMessageHeaders * dmap_connection_get_headers        (DMAPConnection *connection,
                                                             const char *uri);
    GSList *            dmap_connection_get_playlists       (DMAPConnection *connection);
    gboolean            dmap_connection_is_connected        (DMAPConnection *connection);
    void                dmap_connection_setup               (DMAPConnection *connection);
    DMAPContentCode     (*get_protocol_version_cc)          (DMAPConnection *connection);
    gchar *             (*get_query_metadata)               (DMAPConnection *connection);
    DMAPRecord *        (*handle_mlcl)                      (DMAPConnection *connection,
                                                             DMAPRecordFactory *factory,
                                                             GNode *mlcl,
                                                             gint *item_id);
    void                (*operation_done)                   (DMAPConnection *connection);

## Object Hierarchy

      GEnum
       +----DMAPConnectionState

## Description

## Details

### DMAPConnectionCallback ()

    gboolean            (*DMAPConnectionCallback)           (DMAPConnection *connection,
                                                             gboolean result,
                                                             const char *reason,
                                                             gpointer user_data);

### enum DMAPConnectionState

    typedef enum {
    	DMAP_GET_INFO = 0,
    	DMAP_LOGIN,
    	DMAP_GET_REVISION_NUMBER,
    	DMAP_GET_DB_INFO,
    	DMAP_GET_SONGS,
    	DMAP_GET_PLAYLISTS,
    	DMAP_GET_PLAYLIST_ENTRIES,
    	DMAP_LOGOUT,
    	DMAP_DONE
    } DMAPConnectionState;

### DMAPResponseHandler ()

    void                (*DMAPResponseHandler)              (DMAPConnection *connection,
                                                             guint status,
                                                             GNode *structure,
                                                             gpointer user_data);

### authenticate ()

    char *              (*authenticate)                     (DMAPConnection *connection,
                                                             const char *name);

### connected ()

    void                (*connected)                        (DMAPConnection *connection);

### connecting ()

    void                (*connecting)                       (DMAPConnection *connection,
                                                             DMAPConnectionState state,
                                                             float progress);

### disconnected ()

    void                (*disconnected)                     (DMAPConnection *connection);

### dmap_connection_authenticate_message ()

    void                dmap_connection_authenticate_message
                                                            (DMAPConnection *connection,
                                                             SoupSession *session,
                                                             SoupMessage *message,
                                                             SoupAuth *auth,
                                                             const char *password);

Attach an authentication credential to a request. This method should be called by a function that is connected to the "authenticate" signal. The signal will provide the connection, session, message and auth to that function. That function should obtain a password and provide it to this method.

`connection` : | A DMAPConnection
`session` : | A SoupSession
`message` : | A SoupMessage
`auth` : | A SoupAuth
`password` : | A password

### dmap_connection_build_message ()

    SoupMessage *       dmap_connection_build_message       (DMAPConnection *connection,
                                                             const gchar *path,
                                                             gboolean need_hash,
                                                             gdouble version,
                                                             gint req_id,
                                                             gboolean send_close);

### dmap_connection_connect ()

    void                dmap_connection_connect             (DMAPConnection *connection,
                                                             DMAPConnectionCallback callback,
                                                             gpointer user_data);

### dmap_connection_disconnect ()

    void                dmap_connection_disconnect          (DMAPConnection *connection,
                                                             DMAPConnectionCallback callback,
                                                             gpointer user_data);

### dmap_connection_get ()

    gboolean            dmap_connection_get                 (DMAPConnection *self,
                                                             const gchar *path,
                                                             gboolean need_hash,
                                                             DMAPResponseHandler handler,
                                                             gpointer user_data);

### dmap_connection_get_headers ()

    SoupMessageHeaders * dmap_connection_get_headers        (DMAPConnection *connection,
                                                             const char *uri);

### dmap_connection_get_playlists ()

    GSList *            dmap_connection_get_playlists       (DMAPConnection *connection);

### dmap_connection_is_connected ()

    gboolean            dmap_connection_is_connected        (DMAPConnection *connection);

### dmap_connection_setup ()

    void                dmap_connection_setup               (DMAPConnection *connection);

### get_protocol_version_cc ()

    DMAPContentCode     (*get_protocol_version_cc)          (DMAPConnection *connection);

### get_query_metadata ()

    gchar *             (*get_query_metadata)               (DMAPConnection *connection);

### handle_mlcl ()

    DMAPRecord *        (*handle_mlcl)                      (DMAPConnection *connection,
                                                             DMAPRecordFactory *factory,
                                                             GNode *mlcl,
                                                             gint *item_id);

### operation_done ()

    void                (*operation_done)                   (DMAPConnection *connection);