VLC 4.0.0-dev
Loading...
Searching...
No Matches
sort.c File Reference
Include dependency graph for sort.c:

Data Structures

struct  vlc_playlist_item_meta
 Struct containing a copy of (parsed) media metadata, used for sorting without locking all the items. More...
 
struct  sort_request
 

Functions

static int vlc_playlist_item_meta_CopyString (const char **to, const char *from)
 
static int vlc_playlist_item_meta_GetNumber (const char *str, int64_t *to)
 
static int vlc_playlist_item_meta_InitField (struct vlc_playlist_item_meta *meta, enum vlc_playlist_sort_key key)
 
static void vlc_playlist_item_meta_DestroyFields (struct vlc_playlist_item_meta *meta)
 
static int vlc_playlist_item_meta_InitFields (struct vlc_playlist_item_meta *meta, const struct vlc_playlist_sort_criterion criteria[], size_t count)
 
static struct vlc_playlist_item_metavlc_playlist_item_meta_New (size_t index, vlc_playlist_item_t *item, const struct vlc_playlist_sort_criterion criteria[], size_t count)
 
static void vlc_playlist_item_meta_Delete (struct vlc_playlist_item_meta *meta)
 
static int CompareStrings (const char *a, const char *b)
 
static int CompareFilenameStrings (const char *a, const char *b)
 
static int CompareVersionStrings (const char *a, const char *b)
 
static int CompareIntegers (int64_t a, int64_t b)
 
static int CompareOptionalIntegers (bool has_a, int64_t a, bool has_b, int64_t b)
 
static int CompareMetaByKey (const struct vlc_playlist_item_meta *a, const struct vlc_playlist_item_meta *b, enum vlc_playlist_sort_key key)
 
static int compare_meta (const void *lhs, const void *rhs, void *userdata)
 
static void vlc_playlist_DeleteMetaArray (struct vlc_playlist_item_meta *array[], size_t count)
 
static struct vlc_playlist_item_meta ** vlc_playlist_NewMetaArray (vlc_playlist_t *playlist, const struct vlc_playlist_sort_criterion criteria[], size_t count)
 
int vlc_playlist_Sort (vlc_playlist_t *playlist, const struct vlc_playlist_sort_criterion criteria[], size_t count)
 Sort the playlist by a list of criteria.
 

Function Documentation

◆ compare_meta()

static int compare_meta ( const void *  lhs,
const void *  rhs,
void *  userdata 
)
static

◆ CompareFilenameStrings()

static int CompareFilenameStrings ( const char *  a,
const char *  b 
)
inlinestatic

References vlc_filenamecmp().

Referenced by CompareMetaByKey().

◆ CompareIntegers()

static int CompareIntegers ( int64_t  a,
int64_t  b 
)
inlinestatic

◆ CompareMetaByKey()

◆ CompareOptionalIntegers()

static int CompareOptionalIntegers ( bool  has_a,
int64_t  a,
bool  has_b,
int64_t  b 
)
inlinestatic

References CompareIntegers().

Referenced by CompareMetaByKey().

◆ CompareStrings()

static int CompareStrings ( const char *  a,
const char *  b 
)
inlinestatic

References strcasecmp().

Referenced by CompareMetaByKey().

◆ CompareVersionStrings()

static int CompareVersionStrings ( const char *  a,
const char *  b 
)
inlinestatic

References strverscmp().

Referenced by CompareMetaByKey().

◆ vlc_playlist_DeleteMetaArray()

static void vlc_playlist_DeleteMetaArray ( struct vlc_playlist_item_meta array[],
size_t  count 
)
static

◆ vlc_playlist_item_meta_CopyString()

static int vlc_playlist_item_meta_CopyString ( const char **  to,
const char *  from 
)
static

◆ vlc_playlist_item_meta_Delete()

static void vlc_playlist_item_meta_Delete ( struct vlc_playlist_item_meta meta)
static

◆ vlc_playlist_item_meta_DestroyFields()

◆ vlc_playlist_item_meta_GetNumber()

static int vlc_playlist_item_meta_GetNumber ( const char *  str,
int64_t *  to 
)
static

◆ vlc_playlist_item_meta_InitField()

static int vlc_playlist_item_meta_InitField ( struct vlc_playlist_item_meta meta,
enum vlc_playlist_sort_key  key 
)
static

References vlc_playlist_item_meta::album, vlc_playlist_item_meta::album_artist, vlc_playlist_item_meta::artist, atoll(), vlc_playlist_item_meta::date, vlc_playlist_item_meta::disc_number, vlc_playlist_item_meta::duration, EMPTY_STR, vlc_playlist_item_meta::file_modified, vlc_playlist_item_meta::file_size, vlc_playlist_item_meta::genre, vlc_playlist_item_meta::has_date, vlc_playlist_item_meta::has_disc_number, vlc_playlist_item_meta::has_rating, vlc_playlist_item_meta::has_track_number, input_item_t::i_duration, INPUT_DURATION_INDEFINITE, INPUT_DURATION_UNSET, input_item_GetInfoLocked(), input_item_GetMetaLocked(), vlc_playlist_item_meta::item, vlc_playlist_item::media, input_item_t::psz_name, vlc_playlist_item_meta::rating, vlc_playlist_item_meta::title_or_name, vlc_playlist_item_meta::track_number, vlc_playlist_item_meta::url, vlc_assert_unreachable, VLC_EGENERIC, vlc_meta_Album, vlc_meta_AlbumArtist, vlc_meta_Artist, vlc_meta_Date, vlc_meta_DiscNumber, vlc_meta_Genre, vlc_meta_Rating, vlc_meta_Title, vlc_meta_TrackNumber, vlc_meta_URL, vlc_playlist_item_meta_CopyString(), vlc_playlist_item_meta_GetNumber(), VLC_PLAYLIST_SORT_KEY_ALBUM, VLC_PLAYLIST_SORT_KEY_ALBUM_ARTIST, VLC_PLAYLIST_SORT_KEY_ARTIST, VLC_PLAYLIST_SORT_KEY_DATE, VLC_PLAYLIST_SORT_KEY_DISC_NUMBER, VLC_PLAYLIST_SORT_KEY_DURATION, VLC_PLAYLIST_SORT_KEY_FILE_MODIFIED, VLC_PLAYLIST_SORT_KEY_FILE_SIZE, VLC_PLAYLIST_SORT_KEY_GENRE, VLC_PLAYLIST_SORT_KEY_RATING, VLC_PLAYLIST_SORT_KEY_TITLE, VLC_PLAYLIST_SORT_KEY_TRACK_NUMBER, VLC_PLAYLIST_SORT_KEY_URL, and VLC_SUCCESS.

Referenced by vlc_playlist_item_meta_InitFields().

◆ vlc_playlist_item_meta_InitFields()

static int vlc_playlist_item_meta_InitFields ( struct vlc_playlist_item_meta meta,
const struct vlc_playlist_sort_criterion  criteria[],
size_t  count 
)
static

◆ vlc_playlist_item_meta_New()

◆ vlc_playlist_NewMetaArray()

static struct vlc_playlist_item_meta ** vlc_playlist_NewMetaArray ( vlc_playlist_t playlist,
const struct vlc_playlist_sort_criterion  criteria[],
size_t  count 
)
static