VLC 4.0.0-dev
vlc_playlist_callbacks Struct Reference

Playlist callbacks. More...

#include <vlc_playlist.h>

Data Fields

void(* on_items_reset )(vlc_playlist_t *, vlc_playlist_item_t *const items[], size_t count, void *userdata)
 Called when the whole content has changed (e.g. More...
 
void(* on_items_added )(vlc_playlist_t *playlist, size_t index, vlc_playlist_item_t *const items[], size_t count, void *userdata)
 Called when items have been added to the playlist. More...
 
void(* on_items_moved )(vlc_playlist_t *playlist, size_t index, size_t count, size_t target, void *userdata)
 Called when a slice of items have been moved. More...
 
void(* on_items_removed )(vlc_playlist_t *playlist, size_t index, size_t count, void *userdata)
 Called when a slice of items have been removed from the playlist. More...
 
void(* on_items_updated )(vlc_playlist_t *playlist, size_t index, vlc_playlist_item_t *const items[], size_t count, void *userdata)
 Called when an item has been updated via (pre-)parsing. More...
 
void(* on_playback_repeat_changed )(vlc_playlist_t *playlist, enum vlc_playlist_playback_repeat repeat, void *userdata)
 Called when the playback repeat mode has been changed. More...
 
void(* on_playback_order_changed )(vlc_playlist_t *playlist, enum vlc_playlist_playback_order order, void *userdata)
 Called when the playback order mode has been changed. More...
 
void(* on_current_index_changed )(vlc_playlist_t *playlist, ssize_t index, void *userdata)
 Called when the current item index has changed. More...
 
void(* on_has_prev_changed )(vlc_playlist_t *playlist, bool has_prev, void *userdata)
 Called when the "has previous item" property has changed. More...
 
void(* on_has_next_changed )(vlc_playlist_t *playlist, bool has_next, void *userdata)
 Called when the "has next item" property has changed. More...
 

Detailed Description

Playlist callbacks.

A client may register a listener using vlc_playlist_AddListener() to listen playlist events.

All callbacks are called with the playlist locked (see vlc_playlist_Lock()).

Field Documentation

◆ on_current_index_changed

void(* vlc_playlist_callbacks::on_current_index_changed) (vlc_playlist_t *playlist, ssize_t index, void *userdata)

Called when the current item index has changed.

Note that the current item index may have changed while the current item is still the same: it may have been moved.

Parameters
playlistthe playlist
indexthe new current index (-1 if there is no current item)
userdatauserdata provided to AddListener()

◆ on_has_next_changed

void(* vlc_playlist_callbacks::on_has_next_changed) (vlc_playlist_t *playlist, bool has_next, void *userdata)

Called when the "has next item" property has changed.

This is typically useful to update any "next" button in the UI.

Parameters
playlistthe playlist
has_nexttrue if there is a next item, false otherwise
userdatauserdata provided to AddListener()

◆ on_has_prev_changed

void(* vlc_playlist_callbacks::on_has_prev_changed) (vlc_playlist_t *playlist, bool has_prev, void *userdata)

Called when the "has previous item" property has changed.

This is typically useful to update any "previous" button in the UI.

Parameters
playlistthe playlist
has_prevtrue if there is a previous item, false otherwise
userdatauserdata provided to AddListener()

◆ on_items_added

void(* vlc_playlist_callbacks::on_items_added) (vlc_playlist_t *playlist, size_t index, vlc_playlist_item_t *const items[], size_t count, void *userdata)

Called when items have been added to the playlist.

Parameters
playlistthe playlist
indexthe index of the insertion
itemsthe array of added items
countthe number of items added
userdatauserdata provided to AddListener()

◆ on_items_moved

void(* vlc_playlist_callbacks::on_items_moved) (vlc_playlist_t *playlist, size_t index, size_t count, size_t target, void *userdata)

Called when a slice of items have been moved.

Parameters
playlistthe playlist
indexthe index of the first moved item
countthe number of items moved
targetthe new index of the moved slice
userdatauserdata provided to AddListener()

◆ on_items_removed

void(* vlc_playlist_callbacks::on_items_removed) (vlc_playlist_t *playlist, size_t index, size_t count, void *userdata)

Called when a slice of items have been removed from the playlist.

Parameters
playlistthe playlist
indexthe index of the first removed item
countthe number of items removed
userdatauserdata provided to AddListener()

◆ on_items_reset

void(* vlc_playlist_callbacks::on_items_reset) (vlc_playlist_t *, vlc_playlist_item_t *const items[], size_t count, void *userdata)

Called when the whole content has changed (e.g.

when the playlist has been cleared, shuffled or sorted).

Parameters
playlistthe playlist
itemsthe whole new content of the playlist
countthe number of items
userdatauserdata provided to AddListener()

◆ on_items_updated

void(* vlc_playlist_callbacks::on_items_updated) (vlc_playlist_t *playlist, size_t index, vlc_playlist_item_t *const items[], size_t count, void *userdata)

Called when an item has been updated via (pre-)parsing.

Parameters
playlistthe playlist
indexthe index of the first updated item
itemsthe array of updated items
countthe number of items updated
userdatauserdata provided to AddListener()

Referenced by vlc_playlist_HasItemUpdatedListeners().

◆ on_playback_order_changed

void(* vlc_playlist_callbacks::on_playback_order_changed) (vlc_playlist_t *playlist, enum vlc_playlist_playback_order order, void *userdata)

Called when the playback order mode has been changed.

Parameters
playlistthe playlist
rorderthe new playback order
userdatauserdata provided to AddListener()

◆ on_playback_repeat_changed

void(* vlc_playlist_callbacks::on_playback_repeat_changed) (vlc_playlist_t *playlist, enum vlc_playlist_playback_repeat repeat, void *userdata)

Called when the playback repeat mode has been changed.

Parameters
playlistthe playlist
repeatthe new playback "repeat" mode
userdatauserdata provided to AddListener()

The documentation for this struct was generated from the following file: