## TotemPlPlaylist

TotemPlPlaylist — playlist object

## Stability Level

Stable, unless otherwise indicated

## Functions

TotemPlPlaylist * | totem_pl_playlist_new ()
guint | totem_pl_playlist_size ()
void | totem_pl_playlist_prepend ()
void | totem_pl_playlist_append ()
void | totem_pl_playlist_insert ()
gboolean | totem_pl_playlist_iter_first ()
gboolean | totem_pl_playlist_iter_next ()
gboolean | totem_pl_playlist_iter_prev ()
gboolean | totem_pl_playlist_get_value ()
void | totem_pl_playlist_get_valist ()
void | totem_pl_playlist_get ()
gboolean | totem_pl_playlist_set_value ()
void | totem_pl_playlist_set_valist ()
void | totem_pl_playlist_set ()

## Types and Values

| TotemPlPlaylist
| TotemPlPlaylistClass

## Includes

    #include <totem-pl-playlist.h>

## Description

TotemPlPlaylist represents a playlist, provides API to either navigate through the playlist elements, or perform additions or modifications. See also `totem_pl_parser_save()`.

## Functions

### totem_pl_playlist_new ()

    TotemPlPlaylist *
    totem_pl_playlist_new (void);

Creates a new TotemPlPlaylist object.

#### Returns

The newly created TotemPlPlaylist

### totem_pl_playlist_size ()

    guint
    totem_pl_playlist_size (TotemPlPlaylist *playlist);

Returns the number of elements in `playlist` .

#### Parameters

playlist | a TotemPlPlaylist |

#### Returns

The number of elements

### totem_pl_playlist_prepend ()

    void
    totem_pl_playlist_prepend (TotemPlPlaylist *playlist,
                               TotemPlPlaylistIter *iter);

Prepends a new empty element to `playlist` , and modifies `iter` so it points to it. To fill in values, you need to call `totem_pl_playlist_set()` or `totem_pl_playlist_set_value()`.

#### Parameters

playlist | a TotemPlPlaylist |
iter | an unset TotemPlPlaylistIter for returning the location. | [out]

### totem_pl_playlist_append ()

    void
    totem_pl_playlist_append (TotemPlPlaylist *playlist,
                              TotemPlPlaylistIter *iter);

Appends a new empty element to `playlist` , and modifies `iter` so it points to it. To fill in values, you need to call `totem_pl_playlist_set()` or `totem_pl_playlist_set_value()`.

#### Parameters

playlist | a TotemPlPlaylist |
iter | an unset TotemPlPlaylistIter for returning the location. | [out]

### totem_pl_playlist_insert ()

    void
    totem_pl_playlist_insert (TotemPlPlaylist *playlist,
                              gint position,
                              TotemPlPlaylistIter *iter);

Inserts a new empty element to `playlist` at `position` , and modifies `iter` so it points to it. To fill in values, you need to call `totem_pl_playlist_set()` or `totem_pl_playlist_set_value()`.

`position` may be minor than 0 to prepend elements, or bigger than the current `playlist` size to append elements.

#### Parameters

playlist | a TotemPlPlaylist |
position | position in the playlist |
iter | an unset TotemPlPlaylistIter for returning the location. | [out]

### totem_pl_playlist_iter_first ()

    gboolean
    totem_pl_playlist_iter_first (TotemPlPlaylist *playlist,
                                  TotemPlPlaylistIter *iter);

Modifies `iter` so it points to the first element in `playlist` .

#### Parameters

playlist | a TotemPlPlaylist |
iter | an unset TotemPlPlaylistIter for returning the location. | [out]

#### Returns

`TRUE` if there is such first element.

### totem_pl_playlist_iter_next ()

    gboolean
    totem_pl_playlist_iter_next (TotemPlPlaylist *playlist,
                                 TotemPlPlaylistIter *iter);

Modifies `iter` so it points to the next element it previously pointed to. This function will return `FALSE` if there was no next element, or `iter` didn't actually point to any element in `playlist` .

#### Parameters

playlist | a TotemPlPlaylist |
iter | a TotemPlPlaylistIter pointing to some item in `playlist` . | [in]

#### Returns

`TRUE` if there was next element.

### totem_pl_playlist_iter_prev ()

    gboolean
    totem_pl_playlist_iter_prev (TotemPlPlaylist *playlist,
                                 TotemPlPlaylistIter *iter);

Modifies `iter` so it points to the previous element it previously pointed to. This function will return `FALSE` if there was no previous element, or `iter` didn't actually point to any element in `playlist` .

#### Parameters

playlist | a TotemPlPlaylist |
iter | a TotemPlPlaylistIter pointing to some item in `playlist` . | [in]

#### Returns

`TRUE` if there was previous element.

### totem_pl_playlist_get_value ()

    gboolean
    totem_pl_playlist_get_value (TotemPlPlaylist *playlist,
                                 TotemPlPlaylistIter *iter,
                                 const gchar *key,
                                 GValue *value);

Gets the value for `key` (Such as `TOTEM_PL_PARSER_FIELD_URI`) in the playlist item pointed by `iter` .

#### Parameters

playlist | a TotemPlPlaylist |
iter | a TotemPlPlaylistIter pointing to some item in `playlist` |
key | data key |
value | an empty GValue to set |

#### Returns

`TRUE` if `iter` contains data for `key` .

### totem_pl_playlist_get_valist ()

    void
    totem_pl_playlist_get_valist (TotemPlPlaylist *playlist,
                                  TotemPlPlaylistIter *iter,
                                  va_list args);

See `totem_pl_playlist_get()`, this function takes a va_list.

#### Parameters

playlist | a TotemPlPlaylist |
iter | a TotemPlPlaylistIter pointing to some item in `playlist` |
args | a va_list |

### totem_pl_playlist_get ()

    void
    totem_pl_playlist_get (TotemPlPlaylist *playlist,
                           TotemPlPlaylistIter *iter,
                           ...);

Gets the value for one or more keys from the element pointed by `iter` .

#### Parameters

playlist | a TotemPlPlaylist |
iter | a TotemPlPlaylistIter pointing to some item in `playlist` |
... | pairs of key/return location for value, terminated by `NULL` |

### totem_pl_playlist_set_value ()

    gboolean
    totem_pl_playlist_set_value (TotemPlPlaylist *playlist,
                                 TotemPlPlaylistIter *iter,
                                 const gchar *key,
                                 GValue *value);

Sets the value for `key` in the element pointed by `iter` .

#### Parameters

playlist | a TotemPlPlaylist |
iter | a TotemPlPlaylistIter pointing to some item in `playlist` |
key | key to set the value for |
value | GValue containing the key value |

#### Returns

`TRUE` if the value could be stored in `playlist`

### totem_pl_playlist_set_valist ()

    void
    totem_pl_playlist_set_valist (TotemPlPlaylist *playlist,
                                  TotemPlPlaylistIter *iter,
                                  va_list args);

See `totem_pl_playlist_set()`, this function takes a va_list.

#### Parameters

playlist | a TotemPlPlaylist |
iter | a TotemPlPlaylistIter pointing to some item in `playlist` |
args | a va_list |

### totem_pl_playlist_set ()

    void
    totem_pl_playlist_set (TotemPlPlaylist *playlist,
                           TotemPlPlaylistIter *iter,
                           ...);

Sets the value for one or several keys in the element pointed by `iter` .

#### Parameters

playlist | a TotemPlPlaylist |
iter | a TotemPlPlaylistIter pointing to some item in `playlist` |
... | key/value string pairs, terminated with `NULL` |

## Types and Values

### TotemPlPlaylist

    typedef struct {
            GObject parent_instance;
    } TotemPlPlaylist;

All the fields in the TotemPlPlaylist structure are private and should never be accessed directly.

### TotemPlPlaylistClass

    typedef struct {
            GObjectClass parent_class;
    } TotemPlPlaylistClass;

All the fields in the TotemPlPlaylistClass structure are private and should never be accessed directly.

#### Members