
Defines | |
| #define | VLC_INTERNAL_PLAYLIST_SORT_FUNCTIONS |
| #define | SORTFN(SORT, first, second) |
| #define | DEF(s) |
| #define | DEF(a) { cmp_a_##a, cmp_d_##a }, |
Typedefs | |
| typedef int(* | sortfn_t )(const void *, const void *) |
| Return the comparison function appropriate for the SORT_* and ORDER_* arguments given, or NULL for SORT_RANDOM. | |
Functions | |
| static int | meta_strcasecmp_title (const playlist_item_t *first, const playlist_item_t *second) |
| Compare two items using their title or name. | |
| static int | meta_sort (const playlist_item_t *first, const playlist_item_t *second, vlc_meta_type_t meta, bool b_integer) |
| Compare two intems accoring to the given meta type. | |
| static sortfn_t | find_sorting_fn (unsigned i_mode, unsigned i_type) |
| static void | playlist_ItemArraySort (unsigned i_items, playlist_item_t **pp_items, sortfn_t p_sortfn) |
| Sort an array of items recursively. | |
| static int | recursiveNodeSort (playlist_t *p_playlist, playlist_item_t *p_node, sortfn_t p_sortfn) |
| Sort a node recursively. | |
| int | playlist_RecursiveNodeSort (playlist_t *p_playlist, playlist_item_t *p_node, int i_mode, int i_type) |
| Sort a node recursively. | |
| static int | proto_SORT_ALBUM (const playlist_item_t *first, const playlist_item_t *second) |
| static int | proto_SORT_ARTIST (const playlist_item_t *first, const playlist_item_t *second) |
| static int | proto_SORT_DESCRIPTION (const playlist_item_t *first, const playlist_item_t *second) |
| static int | proto_SORT_DURATION (const playlist_item_t *first, const playlist_item_t *second) |
| static int | proto_SORT_GENRE (const playlist_item_t *first, const playlist_item_t *second) |
| static int | proto_SORT_ID (const playlist_item_t *first, const playlist_item_t *second) |
| static int | proto_SORT_RATING (const playlist_item_t *first, const playlist_item_t *second) |
| static int | proto_SORT_TITLE (const playlist_item_t *first, const playlist_item_t *second) |
| static int | proto_SORT_TITLE_NODES_FIRST (const playlist_item_t *first, const playlist_item_t *second) |
| static int | proto_SORT_TITLE_NUMERIC (const playlist_item_t *first, const playlist_item_t *second) |
| static int | proto_SORT_TRACK_NUMBER (const playlist_item_t *first, const playlist_item_t *second) |
| static int | proto_SORT_URI (const playlist_item_t *first, const playlist_item_t *second) |
Variables | |
| static const sortfn_t | sorting_fns [NUM_SORT_FNS][2] |
| #define DEF | ( | s | ) |
static int cmp_a_##s(const void *l,const void *r) \ { return proto_##s(*(const playlist_item_t *const *)l, \ *(const playlist_item_t *const *)r); } \ static int cmp_d_##s(const void *l,const void *r) \ { return -1*proto_##s(*(const playlist_item_t * const *)l, \ *(const playlist_item_t * const *)r); }
| #define DEF | ( | a | ) | { cmp_a_##a, cmp_d_##a }, |
| #define SORTFN | ( | SORT, | ||
| first, | ||||
| second | ||||
| ) |
static inline int proto_##SORT \ ( const playlist_item_t *first, const playlist_item_t *second )
| #define VLC_INTERNAL_PLAYLIST_SORT_FUNCTIONS |
| typedef int(* sortfn_t)(const void *, const void *) |
Return the comparison function appropriate for the SORT_* and ORDER_* arguments given, or NULL for SORT_RANDOM.
| i_mode,: | a SORT_* enum indicating the field to sort on | |
| i_type,: | ORDER_NORMAL or ORDER_REVERSE |
| static sortfn_t find_sorting_fn | ( | unsigned | i_mode, | |
| unsigned | i_type | |||
| ) | [inline, static] |
References NUM_SORT_FNS, and sorting_fns.
Referenced by playlist_RecursiveNodeSort().
| static int meta_sort | ( | const playlist_item_t * | first, | |
| const playlist_item_t * | second, | |||
| vlc_meta_type_t | meta, | |||
| bool | b_integer | |||
| ) | [inline, static] |
Compare two intems accoring to the given meta type.
| first,: | the first item | |
| second,: | the second item | |
| meta,: | the meta type to use to sort the items | |
| b_integer,: | true if the meta are integers |
References playlist_item_t::i_children, input_item_GetMeta(), meta_strcasecmp_title(), playlist_item_t::p_input, and strcasecmp().
Referenced by proto_SORT_ALBUM(), proto_SORT_ARTIST(), proto_SORT_DESCRIPTION(), proto_SORT_GENRE(), proto_SORT_RATING(), and proto_SORT_TRACK_NUMBER().
| static int meta_strcasecmp_title | ( | const playlist_item_t * | first, | |
| const playlist_item_t * | second | |||
| ) | [inline, static] |
Compare two items using their title or name.
| first,: | the first item | |
| second,: | the second item |
References input_item_GetTitleFbName(), playlist_item_t::p_input, and strcasecmp().
Referenced by meta_sort(), proto_SORT_TITLE(), and proto_SORT_TITLE_NODES_FIRST().
| static void playlist_ItemArraySort | ( | unsigned | i_items, | |
| playlist_item_t ** | pp_items, | |||
| sortfn_t | p_sortfn | |||
| ) | [inline, static] |
Sort an array of items recursively.
| i_items,: | number of items | |
| pp_items,: | the array of items | |
| p_sortfn,: | the sorting function |
References vlc_mrand48().
Referenced by recursiveNodeSort().
| static int proto_SORT_ALBUM | ( | const playlist_item_t * | first, | |
| const playlist_item_t * | second | |||
| ) | [inline, static] |
References meta_sort(), vlc_meta_Album, and vlc_meta_TrackNumber.
Referenced by proto_SORT_ARTIST().
| static int proto_SORT_ARTIST | ( | const playlist_item_t * | first, | |
| const playlist_item_t * | second | |||
| ) | [inline, static] |
References meta_sort(), proto_SORT_ALBUM(), and vlc_meta_Artist.
| static int proto_SORT_DESCRIPTION | ( | const playlist_item_t * | first, | |
| const playlist_item_t * | second | |||
| ) | [inline, static] |
References meta_sort(), and vlc_meta_Description.
| static int proto_SORT_DURATION | ( | const playlist_item_t * | first, | |
| const playlist_item_t * | second | |||
| ) | [inline, static] |
References input_item_GetDuration().
| static int proto_SORT_GENRE | ( | const playlist_item_t * | first, | |
| const playlist_item_t * | second | |||
| ) | [inline, static] |
References meta_sort(), and vlc_meta_Genre.
| static int proto_SORT_ID | ( | const playlist_item_t * | first, | |
| const playlist_item_t * | second | |||
| ) | [inline, static] |
| static int proto_SORT_RATING | ( | const playlist_item_t * | first, | |
| const playlist_item_t * | second | |||
| ) | [inline, static] |
References meta_sort(), and vlc_meta_Rating.
| static int proto_SORT_TITLE | ( | const playlist_item_t * | first, | |
| const playlist_item_t * | second | |||
| ) | [inline, static] |
References meta_strcasecmp_title().
| static int proto_SORT_TITLE_NODES_FIRST | ( | const playlist_item_t * | first, | |
| const playlist_item_t * | second | |||
| ) | [inline, static] |
References meta_strcasecmp_title().
| static int proto_SORT_TITLE_NUMERIC | ( | const playlist_item_t * | first, | |
| const playlist_item_t * | second | |||
| ) | [inline, static] |
References input_item_GetTitleFbName().
| static int proto_SORT_TRACK_NUMBER | ( | const playlist_item_t * | first, | |
| const playlist_item_t * | second | |||
| ) | [inline, static] |
References meta_sort(), and vlc_meta_TrackNumber.
| static int proto_SORT_URI | ( | const playlist_item_t * | first, | |
| const playlist_item_t * | second | |||
| ) | [inline, static] |
References input_item_GetURI(), and strcasecmp().
| static int recursiveNodeSort | ( | playlist_t * | p_playlist, | |
| playlist_item_t * | p_node, | |||
| sortfn_t | p_sortfn | |||
| ) | [static] |
Sort a node recursively.
This function must be entered with the playlist lock !
| p_playlist | the playlist | |
| p_node | the node to sort | |
| p_sortfn | the sorting function |
References playlist_item_t::i_children, playlist_ItemArraySort(), and playlist_item_t::pp_children.
Referenced by playlist_RecursiveNodeSort().
static VLC_DEFINE_SORT_FUNCTIONS const sortfn_t sorting_fns [static] |
#define DEF( a ) { VLC_DEFINE_SORT_FUNCTIONS }
Referenced by find_sorting_fn().
1.7.1