GUPnPDIDLLiteWriter

GUPnPDIDLLiteWriter — DIDL-Lite fragment writer

Synopsis




                    GUPnPDIDLLiteWriterPrivate;
                    GUPnPDIDLLiteWriter;
#define             GUPNP_DIDL_LITE_WRITER_NAMESPACE_DC
#define             GUPNP_DIDL_LITE_WRITER_NAMESPACE_UPNP
GUPnPDIDLLiteWriter* gupnp_didl_lite_writer_new         (void);
void                gupnp_didl_lite_writer_start_didl_lite
                                                        (GUPnPDIDLLiteWriter *writer,
                                                         const char *lang,
                                                         SoupUri *url_base,
                                                         gboolean need_escape);
void                gupnp_didl_lite_writer_end_didl_lite
                                                        (GUPnPDIDLLiteWriter *writer);
void                gupnp_didl_lite_writer_start_container
                                                        (GUPnPDIDLLiteWriter *writer,
                                                         const char *id,
                                                         const char *parent_id,
                                                         gboolean restricted,
                                                         gboolean searchable);
void                gupnp_didl_lite_writer_end_container
                                                        (GUPnPDIDLLiteWriter *writer);
void                gupnp_didl_lite_writer_start_item   (GUPnPDIDLLiteWriter *writer,
                                                         const char *id,
                                                         const char *parent_id,
                                                         const char *ref_id,
                                                         gboolean restricted);
void                gupnp_didl_lite_writer_end_item     (GUPnPDIDLLiteWriter *writer);
                    GUPnPDIDLLiteResource;
void                gupnp_didl_lite_resource_reset      (GUPnPDIDLLiteResource *res);
void                gupnp_didl_lite_writer_add_res      (GUPnPDIDLLiteWriter *writer,
                                                         GUPnPDIDLLiteResource *res);
void                gupnp_didl_lite_writer_add_desc     (GUPnPDIDLLiteWriter *writer,
                                                         const char *desc,
                                                         const char *id,
                                                         const char *name,
                                                         const char *ns_uri);
void                gupnp_didl_lite_writer_add_string   (GUPnPDIDLLiteWriter *writer,
                                                         const char *property,
                                                         const char *prefix,
                                                         const char *ns_uri,
                                                         const char *value);
void                gupnp_didl_lite_writer_add_string_with_attrs
                                                        (GUPnPDIDLLiteWriter *writer,
                                                         const char *property,
                                                         const char *prefix,
                                                         const char *ns_uri,
                                                         const char *value,
                                                         ...);
void                gupnp_didl_lite_writer_add_string_with_attrs_valist
                                                        (GUPnPDIDLLiteWriter *writer,
                                                         const char *property,
                                                         const char *prefix,
                                                         const char *ns_uri,
                                                         const char *value,
                                                         va_list var_args);
void                gupnp_didl_lite_writer_add_boolean  (GUPnPDIDLLiteWriter *writer,
                                                         const char *property,
                                                         const char *prefix,
                                                         const char *ns_uri,
                                                         gboolean value);
void                gupnp_didl_lite_writer_add_int      (GUPnPDIDLLiteWriter *writer,
                                                         const char *property,
                                                         const char *prefix,
                                                         const char *ns_uri,
                                                         int value);
void                gupnp_didl_lite_writer_add_uint     (GUPnPDIDLLiteWriter *writer,
                                                         const char *property,
                                                         const char *prefix,
                                                         const char *ns_uri,
                                                         guint value);
void                gupnp_didl_lite_writer_add_long     (GUPnPDIDLLiteWriter *writer,
                                                         const char *property,
                                                         const char *prefix,
                                                         const char *ns_uri,
                                                         long value );
void                gupnp_didl_lite_writer_add_ulong    (GUPnPDIDLLiteWriter *writer,
                                                         const char *property,
                                                         const char *prefix,
                                                         const char *ns_uri,
                                                         gulong value);
const char*         gupnp_didl_lite_writer_get_string   (GUPnPDIDLLiteWriter *writer);
void                gupnp_didl_lite_writer_reset        (GUPnPDIDLLiteWriter *writer);

Object Hierarchy


  GObject
   +----GUPnPDIDLLiteWriter

Description

GUPnPDIDLLiteWriter is a helper class for writing DIDL-Lite fragments.

Details

GUPnPDIDLLiteWriterPrivate

typedef struct _GUPnPDIDLLiteWriterPrivate GUPnPDIDLLiteWriterPrivate;


GUPnPDIDLLiteWriter

typedef struct _GUPnPDIDLLiteWriter GUPnPDIDLLiteWriter;


GUPNP_DIDL_LITE_WRITER_NAMESPACE_DC

#define GUPNP_DIDL_LITE_WRITER_NAMESPACE_DC   "dc"


GUPNP_DIDL_LITE_WRITER_NAMESPACE_UPNP

#define GUPNP_DIDL_LITE_WRITER_NAMESPACE_UPNP "upnp"


gupnp_didl_lite_writer_new ()

GUPnPDIDLLiteWriter* gupnp_didl_lite_writer_new         (void);

Returns : A new GUPnPDIDLLiteWriter object.

gupnp_didl_lite_writer_start_didl_lite ()

void                gupnp_didl_lite_writer_start_didl_lite
                                                        (GUPnPDIDLLiteWriter *writer,
                                                         const char *lang,
                                                         SoupUri *url_base,
                                                         gboolean need_escape);

Starts the DIDL-Lite element.

writer : A GUPnPDIDLLiteWriter
lang : The language the DIDL-Lite fragment is in, or NULL
url_base : A SoupUri specifying the URI relative to which incoming URI are resolved, or NULL
need_escape : TRUE to force writer to escape incoming string data

gupnp_didl_lite_writer_end_didl_lite ()

void                gupnp_didl_lite_writer_end_didl_lite
                                                        (GUPnPDIDLLiteWriter *writer);

Closes the DIDL-Lite element.

writer : A GUPnPDIDLLiteWriter

gupnp_didl_lite_writer_start_container ()

void                gupnp_didl_lite_writer_start_container
                                                        (GUPnPDIDLLiteWriter *writer,
                                                         const char *id,
                                                         const char *parent_id,
                                                         gboolean restricted,
                                                         gboolean searchable);

Starts a new container element.

writer : A GUPnPDIDLLiteWriter
id : The object ID
parent_id : The parent object ID
restricted : TRUE if this container is restricted
searchable : TRUE if this container is searchable

gupnp_didl_lite_writer_end_container ()

void                gupnp_didl_lite_writer_end_container
                                                        (GUPnPDIDLLiteWriter *writer);

Closes the current container element.

writer : A GUPnPDIDLLiteWriter

gupnp_didl_lite_writer_start_item ()

void                gupnp_didl_lite_writer_start_item   (GUPnPDIDLLiteWriter *writer,
                                                         const char *id,
                                                         const char *parent_id,
                                                         const char *ref_id,
                                                         gboolean restricted);

Starts a new item element.

writer : A GUPnPDIDLLiteWriter
id : The object ID
parent_id : The parent object ID
ref_id : The RefID, or NULL
restricted : TRUE if this item is restricted

gupnp_didl_lite_writer_end_item ()

void                gupnp_didl_lite_writer_end_item     (GUPnPDIDLLiteWriter *writer);

Closes the current item element.

writer : A GUPnPDIDLLiteWriter

GUPnPDIDLLiteResource

typedef struct {
        char   *uri;           /* Required */
        char   *import_uri;
        char   *protocol_info; /* Required */

        /* Stream data */
        long    size;
        long    duration;
        int     bitrate;
        int     sample_freq;
        int     bits_per_sample;
        char   *protection;

        /* Audio */
        int     n_audio_channels;

        /* Video */
        int     width;
        int     height;
        int     color_depth;
} GUPnPDIDLLiteResource;


gupnp_didl_lite_resource_reset ()

void                gupnp_didl_lite_resource_reset      (GUPnPDIDLLiteResource *res);

Resets all fields of res: strings to NULL and numbers to -1.


gupnp_didl_lite_writer_add_res ()

void                gupnp_didl_lite_writer_add_res      (GUPnPDIDLLiteWriter *writer,
                                                         GUPnPDIDLLiteResource *res);

Adds a new res (resource) element with the parameters specified in res. Note that in order to ignore a numerical field it has to be set to -1.

writer : A GUPnPDIDLLiteWriter
res : A pointer to a GUPnPDIDLLiteResource structure

gupnp_didl_lite_writer_add_desc ()

void                gupnp_didl_lite_writer_add_desc     (GUPnPDIDLLiteWriter *writer,
                                                         const char *desc,
                                                         const char *id,
                                                         const char *name,
                                                         const char *ns_uri);

Adds a new desc (description) element.

writer : A GUPnPDIDLLiteWriter
desc : The description text
id : The object ID
name :
ns_uri : The namespace of (possible) child elements, or NULL

gupnp_didl_lite_writer_add_string ()

void                gupnp_didl_lite_writer_add_string   (GUPnPDIDLLiteWriter *writer,
                                                         const char *property,
                                                         const char *prefix,
                                                         const char *ns_uri,
                                                         const char *value);

Adds a new string property.

writer : A GUPnPDIDLLiteWriter
property : The property name
prefix : The property namespace prefix, or NULL
ns_uri : The namespace URI to be used, or NULL
value : The property value

gupnp_didl_lite_writer_add_string_with_attrs ()

void                gupnp_didl_lite_writer_add_string_with_attrs
                                                        (GUPnPDIDLLiteWriter *writer,
                                                         const char *property,
                                                         const char *prefix,
                                                         const char *ns_uri,
                                                         const char *value,
                                                         ...);

Adds a new string property with attributes.

writer : A GUPnPDIDLLiteWriter
property : The property name
prefix : The property namespace prefix, or NULL
ns_uri : The namespace URI to be used, or NULL
value : The property value
... : A NULL terminated list of attribute name-attribute value string pairs.

gupnp_didl_lite_writer_add_string_with_attrs_valist ()

void                gupnp_didl_lite_writer_add_string_with_attrs_valist
                                                        (GUPnPDIDLLiteWriter *writer,
                                                         const char *property,
                                                         const char *prefix,
                                                         const char *ns_uri,
                                                         const char *value,
                                                         va_list var_args);

Adds a new string property with attributes.

writer : A GUPnPDIDLLiteWriter
property : The property name
prefix : The property namespace prefix, or NULL
ns_uri : The namespace URI to be used, or NULL
value : The property value
var_args : A va_list with attribute name-attribute value string pairs

gupnp_didl_lite_writer_add_boolean ()

void                gupnp_didl_lite_writer_add_boolean  (GUPnPDIDLLiteWriter *writer,
                                                         const char *property,
                                                         const char *prefix,
                                                         const char *ns_uri,
                                                         gboolean value);

Adds a new boolean property.

writer : A GUPnPDIDLLiteWriter
property : The property name
prefix : The property namespace prefix, or NULL
ns_uri : The namespace URI to be used, or NULL
value : The property value

gupnp_didl_lite_writer_add_int ()

void                gupnp_didl_lite_writer_add_int      (GUPnPDIDLLiteWriter *writer,
                                                         const char *property,
                                                         const char *prefix,
                                                         const char *ns_uri,
                                                         int value);

Adds a new integer property.

writer : A GUPnPDIDLLiteWriter
property : The property name
prefix : The property namespace prefix, or NULL
ns_uri : The namespace URI to be used, or NULL
value : The property value

gupnp_didl_lite_writer_add_uint ()

void                gupnp_didl_lite_writer_add_uint     (GUPnPDIDLLiteWriter *writer,
                                                         const char *property,
                                                         const char *prefix,
                                                         const char *ns_uri,
                                                         guint value);

Adds a new unsigned integer property.

writer : A GUPnPDIDLLiteWriter
property : The property name
prefix : The property namespace prefix, or NULL
ns_uri : The namespace URI to be used, or NULL
value : The property value

gupnp_didl_lite_writer_add_long ()

void                gupnp_didl_lite_writer_add_long     (GUPnPDIDLLiteWriter *writer,
                                                         const char *property,
                                                         const char *prefix,
                                                         const char *ns_uri,
                                                         long value );

Adds a new long integer property.

writer : A GUPnPDIDLLiteWriter
property : The property name
prefix : The property namespace prefix, or NULL
ns_uri : The namespace URI to be used, or NULL
Param5 :

gupnp_didl_lite_writer_add_ulong ()

void                gupnp_didl_lite_writer_add_ulong    (GUPnPDIDLLiteWriter *writer,
                                                         const char *property,
                                                         const char *prefix,
                                                         const char *ns_uri,
                                                         gulong value);

Adds a new unsigned long integer property.

writer : A GUPnPDIDLLiteWriter
property : The property name
prefix : The property namespace prefix, or NULL
ns_uri : The namespace URI to be used, or NULL
value : The property value

gupnp_didl_lite_writer_get_string ()

const char*         gupnp_didl_lite_writer_get_string   (GUPnPDIDLLiteWriter *writer);

Returns a pointer the generated DIDL-Lite string.

writer : A GUPnPDIDLLiteWriter
Returns : The generated DIDL-Lite string.

gupnp_didl_lite_writer_reset ()

void                gupnp_didl_lite_writer_reset        (GUPnPDIDLLiteWriter *writer);

Resets writer.

writer : A GUPnPDIDLLiteWriter