GUPnPMediaCollection: GUPnP A/V Reference Manual

## GUPnPMediaCollection GUPnPMediaCollection — Media collection writer |

## Functions

GUPnPMediaCollection * | gupnp_media_collection_new ()
GUPnPMediaCollection * | gupnp_media_collection_new_from_string ()
void | gupnp_media_collection_set_title ()
const char * | gupnp_media_collection_get_title ()
void | gupnp_media_collection_set_author ()
const char * | gupnp_media_collection_get_author ()
GUPnPDIDLLiteItem * | gupnp_media_collection_add_item ()
char * | gupnp_media_collection_get_string ()
GList * | gupnp_media_collection_get_items ()
gboolean | gupnp_media_collection_get_mutable ()

## Types and Values

| GUPnPMediaCollection

## Description

GUPnPMediaCollection is a helper class for writing media collection files.

## Functions

### gupnp_media_collection_new ()

    GUPnPMediaCollection *
    gupnp_media_collection_new (void);

Create a new writable media collection.

#### Returns

A new GUPnPMediaCollection.

[transfer full]

### gupnp_media_collection_new_from_string ()

    GUPnPMediaCollection *
    gupnp_media_collection_new_from_string
                                   (const char *data);

Parse a new GUPnPMediaCollection from a block of XML data.

#### Parameters

data | XML string. |

#### Returns

A new GUPnPMediaCollection.

[transfer full]

### gupnp_media_collection_set_title ()

    void
    gupnp_media_collection_set_title (GUPnPMediaCollection *collection,
                                      const char *title);

Set the title of a GUPnPMediaCollection.

#### Parameters

collection | GUPnPMediaCollection |
title | New Title of this collection; |

### gupnp_media_collection_get_title ()

    const char *
    gupnp_media_collection_get_title (GUPnPMediaCollection *collection);

#### Parameters

collection | GUPnPMediaCollection |

#### Returns

The title of this media collection or `NULL` if not set.

[nullable][transfer none]

### gupnp_media_collection_set_author ()

    void
    gupnp_media_collection_set_author (GUPnPMediaCollection *collection,
                                       const char *author);

Set the author of the media collection

#### Parameters

collection | GUPnPMediaCollection |
author | New author of this media collection. |

### gupnp_media_collection_get_author ()

    const char *
    gupnp_media_collection_get_author (GUPnPMediaCollection *collection);

#### Parameters

collection | GUPnPMediaCollection |

#### Returns

The author of this media collection or `NULL` if not set.

### gupnp_media_collection_add_item ()

    GUPnPDIDLLiteItem *
    gupnp_media_collection_add_item (GUPnPMediaCollection *collection);

#### Parameters

collection | GUPnPMediaCollection |

#### Returns

A new GUPnPDIDLLiteItem object. Unref after use.

[transfer full]

### gupnp_media_collection_get_string ()

    char *
    gupnp_media_collection_get_string (GUPnPMediaCollection *collection);

#### Parameters

collection | GUPnPMediaCollection |

#### Returns

XML string representing this media collection. `g_free()` after use. If the colleciton is not mutable, returns a copy of the original string.

[transfer full]

### gupnp_media_collection_get_items ()

    GList *
    gupnp_media_collection_get_items (GUPnPMediaCollection *collection);

#### Parameters

collection | GUPnPMediaCollection |

#### Returns

A GList containing the elemens of this collection, in proper order. Unref all items and free the list after use.

[transfer full][element-type GUPnPDIDLLiteItem]

### gupnp_media_collection_get_mutable ()

    gboolean
    gupnp_media_collection_get_mutable (GUPnPMediaCollection *collection);

#### Parameters

collection | GUPnPMediaCollection |

#### Returns

TRUE if the collections is modifiable, FALSE otherwise.

## Types and Values

### GUPnPMediaCollection

    typedef struct _GUPnPMediaCollection GUPnPMediaCollection;