|
VLC
2.1.0-git
|

Go to the source code of this file.
Data Structures | |
| struct | ml_gc_object_t |
| struct | media_library_t |
| Main structure of the media library. More... | |
| struct | ml_media_t |
| Structure to describe a media. More... | |
| struct | ml_result_t |
| Main communication struct between GUI and sql_media_library. More... | |
| struct | ml_element_t |
| Element of a query: criteria type/value pair Used for update and delete queries. More... | |
| struct | ml_ftree_t |
| Binary tree used to parse the WHERE condition for a search. More... | |
| struct | ml_person_t |
| Person class. More... | |
Macros | |
| #define | ML_PERSON_ARTIST "Artist" |
| #define | ML_PERSON_ALBUM_ARTIST "Album Artist" |
| #define | ML_PERSON_ENCODER "Encoder" |
| #define | ML_PERSON_PUBLISHER "Publisher" |
| #define | ml_priv(gc, t) ((t *)(((char *)(gc)) - offsetof(t, ml_gc_data))) |
| #define | ML_GC_MEMBERS ml_gc_object_t ml_gc_data; |
| #define | ml_Get(a) ml_Get( VLC_OBJECT(a) ) |
| #define | ml_Control(a, b, args...) __ml_Control( a, b, ## args ) |
| Control the Media Library. | |
| #define | ml_LockMedia(a) vlc_mutex_lock( &a->lock ) |
| Helpers for locking and unlocking. | |
| #define | ml_UnlockMedia(a) vlc_mutex_unlock( &a->lock ) |
| #define | ml_FreeFindTree(tree) ml_GenericFreeFindTree( tree, true ) |
| #define | ml_ShallowFreeFindTree(tree) ml_GenericFreeFindTree( tree, false ) |
| #define | ml_FtreeAnd(left, right) ml_OpConnectChilds( ML_OP_AND, left, right ) |
| #define | ml_FtreeOr(left, right) ml_OpConnectChilds( ML_OP_OR, left, right ) |
| #define | ml_FtreeNot(left) ml_OpConnectChilds( ML_OP_NOT, left, NULL ) |
| #define | ml_FtreeSpecAsc(tree, str) ml_FtreeSpec( tree, ML_SORT_ASC, 0, str ) |
| #define | ml_FtreeSpecDesc(tree, str) ml_FtreeSpec( tree, ML_SORT_DESC, 0, str ) |
| #define | ml_FtreeSpecLimit(tree, limit) ml_FtreeSpec( tree, ML_LIMIT, limit, NULL ) |
| #define | ml_FtreeSpecDistinct(tree) ml_FtreeSpec( tree, ML_DISTINCT, 0, NULL ) |
| #define | ml_GetInt(ml,...) __ml_GetInt( ml, __VA_ARGS__, ML_LIMIT, 1, ML_END ) |
| Search an INTEGER in the database This uses a Query but returns only one integer (>0), or an error code. | |
| #define | ml_FindPsz(ml,...) __ml_GetPsz( ml, __VA_ARGS__, ML_LIMIT, 1, ML_END ) |
| Search a string (VARCHAR) in the database This uses a Query but returns only one integer (>0), or an error code. | |
| #define | ml_UpdateSimple(ml, sel, lval, id,...) ml_UpdateSimple( ml, sel, lval, id, __VA_ARGS__, ML_END ) |
| #define | ml_GetAlbumArtistsFromMedia(a, b) ml_GetPersonsFromMedia( a, b, ML_PERSON_ALBUM_ARTIST ); |
| #define | ml_GetArtistsFromMedia(a, b) ml_GetPersonsFromMedia( a, b, ML_PERSON_ARTIST ); |
| #define | ml_GetEncodersFromMedia(a, b) ml_GetPersonsFromMedia( a, b, ML_PERSON_ENCODER ); |
| #define | ml_GetPublishersFromMedia(a, b) ml_GetPersonsFromMedia( a, b, ML_PERSON_PUBLISHER ); |
| #define | ml_GetAlbumById(a, id) ml_GetPsz( a, ML_ALBUM, ML_ID, id ) |
| Convenience Macros. | |
| #define | ml_GetArtistById(a, id) ml_GetPsz( a, ML_PEOPLE, ML_PERSON_ARTIST, ML_ID, id ) |
| #define | ml_GetCoverUriById(a, id) ml_GetPsz( a, ML_COVER, ML_ID, id ) |
| #define | ml_GetEncoderById(a, id) ml_GetPsz( a, ML_PEOPLE, ML_PERSON_ENCODER, ML_ID, id ) |
| #define | ml_GetExtraById(a, id) ml_GetPsz( a, ML_EXTRA, ML_ID, id ) |
| #define | ml_GetGenreById(a, id) ml_GetPsz( a, ML_GENRE, ML_ID, id ) |
| #define | ml_GetOriginalTitleById(a, id) ml_GetPsz( a, ML_ORIGINAL_TITLE, ML_ID, id ) |
| #define | ml_GetPublisherById(a, id) ml_GetPsz( a, ML_PEOPLE, ML_PERSON_PUBLISHER, ML_ID, id ) |
| #define | ml_GetTitleById(a, id) ml_GetPsz( a, ML_TITLE, ML_ID, id ) |
| #define | ml_GetUriById(a, id) ml_GetPsz( a, ML_URI, ML_ID, id ) |
| #define | ml_GetAlbumIdById(a, id) ml_GetInt( a, ML_ALBUM_ID, ML_ID, id ) |
| #define | ml_GetArtistIdById(a, id) ml_GetInt( a, ML_PEOPLE_ID, ML_PERSON_ARTIST, ML_ID, id ) |
| #define | ml_GetDurationById(a, id) ml_GetInt( a, ML_DURATION, ML_ID, id ) |
| #define | ml_GetEncoderIdById(a, id) ml_GetInt( a, ML_PEOPLE_ID, ML_PERSON_ENCODER, ML_ID, id ) |
| #define | ml_GetLastPlayedById(a, id) ml_GetInt( a, ML_LAST_PLAYED, ML_ID, id ) |
| #define | ml_GetPlayedCountById(a, id) ml_GetInt( a, ML_PLAYED_COUNT, ML_ID, id ) |
| #define | ml_GetPublisherIdById(a, id) ml_GetInt( a, ML_PEOPLE_ID, ML_PERSON_PUBLISHER, ML_ID, id ) |
| #define | ml_GetScoreById(a, id) ml_GetInt( a, ML_SCORE, ML_ID, id ) |
| #define | ml_GetTrackNumberById(a, id) ml_GetInt( a, ML_TRACK_NUMBER, ML_ID, id ) |
| #define | ml_GetTypeById(a, id) ml_GetInt( a, ML_TYPE, ML_ID, id ) |
| #define | ml_GetYearById(a, id) ml_GetInt( a, ML_YEAR, ML_ID, id ) |
| #define | ml_GetVoteById(a, id) ml_GetInt( a, ML_VOTE, ML_ID, id ) |
| #define | ml_GetAlbumId(a, b) ml_GetInt( a, ML_ALBUM_ID, ML_ALBUM, b ) |
| Albums handling. | |
| #define | ml_GetArtistId(a, b) ml_GetInt( a, ML_PERSON_ID, ML_PERSON_ARTIST, ML_PERSON, ML_PERSON_ARTIST, b ) |
| People handling. | |
| #define | ml_GetEncoderId(a, b) ml_GetInt( a, ML_PERSON_ID, ML_PERSON_ENCODER, ML_PERSON, ML_PERSON_ENCODER, b ) |
| #define | ml_GetPublisherId(a, b) ml_GetInt( a, ML_PERSON_ID, ML_PERSON_PUBLISHER, ML_PERSON, ML_PERSON_PUBLISHER, b ) |
| #define | ml_GetMediaCount(a,...) __ml_GetInt( a, ML_COUNT_MEDIA, __VA_ARGS__, ML_END ) |
| Counts handling. | |
| #define | ml_GetAlbumCount(a,...) __ml_GetInt( a, ML_COUNT_ALBUM, __VA_ARGS__, ML_END ) |
| #define | ml_GetPeopleCount(a,...) __ml_GetInt( a, ML_COUNT_PEOPLE, __VA_ARGS__, ML_END ) |
| #define | ml_Find(a, b,...) __ml_Find( a, b, __VA_ARGS__, ML_END ) |
| #define | ml_FindAlbum(a, b,...) __ml_Find( a, b, ML_ALBUM, __VA_ARGS__, ML_END ) |
| #define | ml_FindArtist(a, b,...) __ml_Find( a, b, ML_PERSON, ML_PERSON_ARTIST, __VA_ARGS__, ML_END ) |
| #define | ml_FindEncoder(a, b,...) __ml_Find( a, b, ML_PERSON, ML_PERSON_ENCODER, __VA_ARGS__, ML_END ) |
| #define | ml_FindGenre(a, b,...) __ml_Find( a, b, ML_GENRE, __VA_ARGS__, ML_END ) |
| #define | ml_FindMedia(a, b,...) __ml_Find( a, b, ML_MEDIA, __VA_ARGS__, ML_END ) |
| #define | ml_FindOriginalTitle(a, b,...) __ml_Find( a, b, ML_ORIGINAL_TITLE, __VA_ARGS__, ML_END ) |
| #define | ml_FindPublisher(a, b,...) __ml_Find( a, b, ML_PERSON, ML_PERSON_PUBLISHER, __VA_ARGS__, ML_END ) |
| #define | ml_FindTitle(a, b,...) __ml_Find( a, b, ML_TITLE, __VA_ARGS__, ML_END ) |
| #define | ml_FindType(a, b,...) __ml_Find( a, b, ML_TYPE, __VA_ARGS__, ML_END ) |
| #define | ml_FindUri(a, b,...) __ml_Find( a, b, ML_URI, __VA_ARGS__, ML_END ) |
| #define | ml_FindYear(a, b,...) __ml_Find( a, b, ML_YEAR, __VA_ARGS__, ML_END ) |
| #define | ml_FindAllAlbums(a, b) ml_FindAlbum( a, b, ML_DISTINCT ) |
| #define | ml_FindAllArtists(a, b) ml_FindArtist( a, b, ML_DISTINCT ) |
| #define | ml_FindAllGenres(a, b) ml_FindGenre( a, b, ML_DISTINCT ) |
| #define | ml_FindAllMedias(a, b) ml_FindMedia( a, b, ML_DISTINCT ) |
| #define | ml_FindAllOriginalTitles(a, b) ml_FindOriginalTitle( a, b, ML_DISTINCT ) |
| #define | ml_FindAllPublishers(a, b,...) ml_FindPublisher( a, b, ML_DISTINCT ) |
| #define | ml_FindAllTitles(a, b) ml_FindTitle( a, b, ML_DISTINCT ) |
| #define | ml_FindAllTypes(a, b) ml_FindType( a, b, ML_DISTINCT ) |
| #define | ml_FindAllUris(a, b) ml_FindUri( a, b, ML_DISTINCT ) |
| #define | ml_FindAllYears(a, b) ml_FindYear( a, b, ML_DISTINCT ) |
| #define | ml_FindAlbumAdv(a, b, c) ml_FindAdv( a, b, ML_ALBUM, NULL, c ) |
| #define | ml_FindArtistAdv(a, b, c) ml_FindAdv( a, b, ML_PERSON, ML_PERSON_ARTIST, c ) |
| #define | ml_FindEncoderAdv(a, b, c) ml_FindAdv( a, b, ML_PERSON, ML_PERSON_ENCODER, c ) |
| #define | ml_FindGenreAdv(a, b, c) ml_FindAdv( a, b, ML_GENRE, NULL, c ) |
| #define | ml_FindMediaAdv(a, b, c) ml_FindAdv( a, b, ML_MEDIA, NULL, c ) |
| #define | ml_FindOriginalTitleAdv(a, b, c) ml_FindAdv( a, b, ML_ORIGINAL_TITLE,NULL, c ) |
| #define | ml_FindPublisherAdv(a, b, c) ml_FindAdv( a, b, ML_PUBLISHER, ML_PERSON_PUBLISHER, c ) |
| #define | ml_FindTitleAdv(a, b, c) ml_FindAdv( a, b, ML_TITLE, NULL, c ) |
| #define | ml_FindTypeAdv(a, b, c) ml_FindAdv( a, b, ML_TYPE, NULL, c ) |
| #define | ml_FindUriAdv(a, b, c) ml_FindAdv( a, b, ML_URI, NULL, c ) |
| #define | ml_FindYearAdv(a, b, c) ml_FindAdv( a, b, ML_YEAR, NULL, c ) |
Typedefs | |
| typedef struct media_library_t | media_library_t |
| typedef struct media_library_sys_t | media_library_sys_t |
| typedef struct ml_media_t | ml_media_t |
| typedef struct ml_result_t | ml_result_t |
| typedef struct ml_element_t | ml_element_t |
| typedef struct ml_person_t | ml_person_t |
| typedef struct ml_ftree_t | ml_ftree_t |
| typedef struct ml_gc_object_t | ml_gc_object_t |
Functions | |
| media_library_t * | ml_Get (vlc_object_t *p_this) |
| Acquire a reference to the media library singleton. | |
| media_library_t * | ml_Create (vlc_object_t *p_this, char *psz_name) |
| Create a Media Library VLC object. | |
| void | ml_Destroy (vlc_object_t *p_this) |
| Destructor for the Media library singleton. | |
| static int | ml_ControlVa (media_library_t *p_media_library, ml_control_e i_type, va_list args) |
| Control the Media Library. | |
| static int | __ml_Control (media_library_t *p_media_library, ml_control_e i_type,...) |
| static int | ml_AttributeIsString (ml_select_e meta) |
| Determine an attribute's type (int or string) | |
| static void | ml_gc_incref (ml_media_t *p_media) |
| Increment reference count of media. | |
| static void | ml_gc_decref (ml_media_t *p_media) |
| Decrease reference count of media. | |
| static void | ml_FreePeople (ml_person_t *p_person) |
| Free a person object. | |
| static void | ml_FreeMediaContent (ml_media_t *p_media) |
| Free only the content of a media. | |
| static void | ml_FreeResult (ml_result_t *p_result) |
| Free a result item. | |
| static void | ml_FreeElement (ml_element_t *p_elt) |
| Free a ml_element_t item. | |
| static void | ml_DestroyResultArray (vlc_array_t *p_result_array) |
| Destroy a vlc_array_t of ml_result_t. | |
| ml_media_t * | media_New (media_library_t *p_ml, int id, ml_select_e select, bool reload) |
| Object constructor for ml_media_t. | |
| static int | ml_CopyPersons (ml_person_t **a, ml_person_t *b) |
| Copy one person list into another. | |
| static int | ml_CopyMedia (ml_media_t *b, ml_media_t *a) |
| Copy all members of a ml_media_t to another. | |
| static void | ml_GenericFreeFindTree (ml_ftree_t *tree, bool freestrings) |
| Free a find tree. | |
| static int | ml_FtreeHasOp (ml_ftree_t *tree) |
| Checks if a given find tree has leaf nodes. | |
| ml_ftree_t * | ml_OpConnectChilds (ml_op_e op, ml_ftree_t *left, ml_ftree_t *right) |
| Connect up a find tree. | |
| ml_ftree_t * | ml_FtreeSpec (ml_ftree_t *tree, ml_select_e crit, int limit, char *sort) |
| Attaches a special node to a tree. | |
| static ml_ftree_t * | ml_FtreeFastAnd (ml_ftree_t *left, ml_ftree_t *right) |
| This function gives quick sequential adding capability. | |
| static input_item_t * | ml_CreateInputItem (media_library_t *p_media_library, int i_media_id) |
| Create input item from media. | |
| static int | __ml_Find (media_library_t *p_media_library, vlc_array_t *p_result_array,...) |
| Search in the database according some criterias. | |
| static int | ml_FindAdv (media_library_t *p_media_library, vlc_array_t *p_result_array, ml_select_e result_type, char *psz_lvalue, ml_ftree_t *tree) |
| Search in the database according some criterias (threaded) | |
| static int | __ml_GetValue (media_library_t *p_media_library, ml_result_t *p_result, va_list args) |
| Find a value in the ML database, fill p_result with it. | |
| static int | __ml_GetInt (media_library_t *p_media_library,...) |
| static char * | __ml_GetPsz (media_library_t *p_media_library,...) |
| static int | ml_Update (media_library_t *p_media_library, ml_select_e selected_type, const char *psz_lvalue, ml_ftree_t *where, vlc_array_t *changes) |
| Generic update in Media Library database. | |
| int | ml_UpdateSimple (media_library_t *p_media_library, ml_select_e selected_type, const char *psz_lvalue, int id,...) |
| Update a given table. | |
| static int | ml_DeleteSimple (media_library_t *p_media_library, int id) |
| Generic DELETE function Delete a media and all its references which don't point to anything else. | |
| static int | ml_Delete (media_library_t *p_media_library, vlc_array_t *p_array) |
| Delete many medias in the media library. | |
| static int | ml_CreateAppendPersonAdv (ml_person_t **pp_person, const char *psz_role, const char *psz_name, int i_id) |
| Create and append a person object to the given list. | |
| static int | ml_CreateAppendPerson (ml_person_t **pp_person, ml_person_t *p_personfrom) |
| Create and append a person object to the given list. | |
| ml_person_t * | ml_GetPersonsFromMedia (media_library_t *p_ml, ml_media_t *p_media, const char *psz_role) |
| Returns a person list of given type. | |
| void | ml_DeletePersonTypeFromMedia (ml_media_t *p_media, const char *psz_role) |
| Delete a certain type of people from a media. | |
| #define ml_Control | ( | a, | |
| b, | |||
| args... | |||
| ) | __ml_Control( a, b, ## args ) |
Control the Media Library.
| i_type | one of ml_control_e values |
| #define ml_FindAlbumAdv | ( | a, | |
| b, | |||
| c | |||
| ) | ml_FindAdv( a, b, ML_ALBUM, NULL, c ) |
| #define ml_FindAllAlbums | ( | a, | |
| b | |||
| ) | ml_FindAlbum( a, b, ML_DISTINCT ) |
| #define ml_FindAllArtists | ( | a, | |
| b | |||
| ) | ml_FindArtist( a, b, ML_DISTINCT ) |
| #define ml_FindAllGenres | ( | a, | |
| b | |||
| ) | ml_FindGenre( a, b, ML_DISTINCT ) |
| #define ml_FindAllMedias | ( | a, | |
| b | |||
| ) | ml_FindMedia( a, b, ML_DISTINCT ) |
| #define ml_FindAllOriginalTitles | ( | a, | |
| b | |||
| ) | ml_FindOriginalTitle( a, b, ML_DISTINCT ) |
| #define ml_FindAllPublishers | ( | a, | |
| b, | |||
| ... | |||
| ) | ml_FindPublisher( a, b, ML_DISTINCT ) |
| #define ml_FindAllTitles | ( | a, | |
| b | |||
| ) | ml_FindTitle( a, b, ML_DISTINCT ) |
| #define ml_FindAllTypes | ( | a, | |
| b | |||
| ) | ml_FindType( a, b, ML_DISTINCT ) |
| #define ml_FindAllUris | ( | a, | |
| b | |||
| ) | ml_FindUri( a, b, ML_DISTINCT ) |
| #define ml_FindAllYears | ( | a, | |
| b | |||
| ) | ml_FindYear( a, b, ML_DISTINCT ) |
| #define ml_FindArtist | ( | a, | |
| b, | |||
| ... | |||
| ) | __ml_Find( a, b, ML_PERSON, ML_PERSON_ARTIST, __VA_ARGS__, ML_END ) |
| #define ml_FindArtistAdv | ( | a, | |
| b, | |||
| c | |||
| ) | ml_FindAdv( a, b, ML_PERSON, ML_PERSON_ARTIST, c ) |
| #define ml_FindEncoder | ( | a, | |
| b, | |||
| ... | |||
| ) | __ml_Find( a, b, ML_PERSON, ML_PERSON_ENCODER, __VA_ARGS__, ML_END ) |
| #define ml_FindEncoderAdv | ( | a, | |
| b, | |||
| c | |||
| ) | ml_FindAdv( a, b, ML_PERSON, ML_PERSON_ENCODER, c ) |
| #define ml_FindGenreAdv | ( | a, | |
| b, | |||
| c | |||
| ) | ml_FindAdv( a, b, ML_GENRE, NULL, c ) |
| #define ml_FindMediaAdv | ( | a, | |
| b, | |||
| c | |||
| ) | ml_FindAdv( a, b, ML_MEDIA, NULL, c ) |
| #define ml_FindOriginalTitle | ( | a, | |
| b, | |||
| ... | |||
| ) | __ml_Find( a, b, ML_ORIGINAL_TITLE, __VA_ARGS__, ML_END ) |
| #define ml_FindOriginalTitleAdv | ( | a, | |
| b, | |||
| c | |||
| ) | ml_FindAdv( a, b, ML_ORIGINAL_TITLE,NULL, c ) |
| #define ml_FindPsz | ( | ml, | |
| ... | |||
| ) | __ml_GetPsz( ml, __VA_ARGS__, ML_LIMIT, 1, ML_END ) |
Search a string (VARCHAR) in the database This uses a Query but returns only one integer (>0), or an error code.
| p_media_library | the media library object |
| va_args | parameters to select the data |
| #define ml_FindPublisher | ( | a, | |
| b, | |||
| ... | |||
| ) | __ml_Find( a, b, ML_PERSON, ML_PERSON_PUBLISHER, __VA_ARGS__, ML_END ) |
| #define ml_FindPublisherAdv | ( | a, | |
| b, | |||
| c | |||
| ) | ml_FindAdv( a, b, ML_PUBLISHER, ML_PERSON_PUBLISHER, c ) |
| #define ml_FindTitleAdv | ( | a, | |
| b, | |||
| c | |||
| ) | ml_FindAdv( a, b, ML_TITLE, NULL, c ) |
| #define ml_FindTypeAdv | ( | a, | |
| b, | |||
| c | |||
| ) | ml_FindAdv( a, b, ML_TYPE, NULL, c ) |
| #define ml_FindUriAdv | ( | a, | |
| b, | |||
| c | |||
| ) | ml_FindAdv( a, b, ML_URI, NULL, c ) |
| #define ml_FindYearAdv | ( | a, | |
| b, | |||
| c | |||
| ) | ml_FindAdv( a, b, ML_YEAR, NULL, c ) |
| #define ml_FreeFindTree | ( | tree | ) | ml_GenericFreeFindTree( tree, true ) |
| #define ml_FtreeAnd | ( | left, | |
| right | |||
| ) | ml_OpConnectChilds( ML_OP_AND, left, right ) |
| #define ml_FtreeNot | ( | left | ) | ml_OpConnectChilds( ML_OP_NOT, left, NULL ) |
| #define ml_FtreeOr | ( | left, | |
| right | |||
| ) | ml_OpConnectChilds( ML_OP_OR, left, right ) |
| #define ml_FtreeSpecAsc | ( | tree, | |
| str | |||
| ) | ml_FtreeSpec( tree, ML_SORT_ASC, 0, str ) |
| #define ml_FtreeSpecDesc | ( | tree, | |
| str | |||
| ) | ml_FtreeSpec( tree, ML_SORT_DESC, 0, str ) |
| #define ml_FtreeSpecDistinct | ( | tree | ) | ml_FtreeSpec( tree, ML_DISTINCT, 0, NULL ) |
| #define ml_FtreeSpecLimit | ( | tree, | |
| limit | |||
| ) | ml_FtreeSpec( tree, ML_LIMIT, limit, NULL ) |
| #define ML_GC_MEMBERS ml_gc_object_t ml_gc_data; |
| #define ml_Get | ( | a | ) | ml_Get( VLC_OBJECT(a) ) |
| #define ml_GetAlbumArtistsFromMedia | ( | a, | |
| b | |||
| ) | ml_GetPersonsFromMedia( a, b, ML_PERSON_ALBUM_ARTIST ); |
Convenience Macros.
Get information using the media ID. This returns only 1 information.
| #define ml_GetAlbumCount | ( | a, | |
| ... | |||
| ) | __ml_GetInt( a, ML_COUNT_ALBUM, __VA_ARGS__, ML_END ) |
| #define ml_GetAlbumId | ( | a, | |
| b | |||
| ) | ml_GetInt( a, ML_ALBUM_ID, ML_ALBUM, b ) |
Albums handling.
| #define ml_GetAlbumIdById | ( | a, | |
| id | |||
| ) | ml_GetInt( a, ML_ALBUM_ID, ML_ID, id ) |
| #define ml_GetArtistById | ( | a, | |
| id | |||
| ) | ml_GetPsz( a, ML_PEOPLE, ML_PERSON_ARTIST, ML_ID, id ) |
| #define ml_GetArtistId | ( | a, | |
| b | |||
| ) | ml_GetInt( a, ML_PERSON_ID, ML_PERSON_ARTIST, ML_PERSON, ML_PERSON_ARTIST, b ) |
People handling.
| #define ml_GetArtistIdById | ( | a, | |
| id | |||
| ) | ml_GetInt( a, ML_PEOPLE_ID, ML_PERSON_ARTIST, ML_ID, id ) |
| #define ml_GetArtistsFromMedia | ( | a, | |
| b | |||
| ) | ml_GetPersonsFromMedia( a, b, ML_PERSON_ARTIST ); |
| #define ml_GetDurationById | ( | a, | |
| id | |||
| ) | ml_GetInt( a, ML_DURATION, ML_ID, id ) |
| #define ml_GetEncoderById | ( | a, | |
| id | |||
| ) | ml_GetPsz( a, ML_PEOPLE, ML_PERSON_ENCODER, ML_ID, id ) |
| #define ml_GetEncoderId | ( | a, | |
| b | |||
| ) | ml_GetInt( a, ML_PERSON_ID, ML_PERSON_ENCODER, ML_PERSON, ML_PERSON_ENCODER, b ) |
| #define ml_GetEncoderIdById | ( | a, | |
| id | |||
| ) | ml_GetInt( a, ML_PEOPLE_ID, ML_PERSON_ENCODER, ML_ID, id ) |
| #define ml_GetEncodersFromMedia | ( | a, | |
| b | |||
| ) | ml_GetPersonsFromMedia( a, b, ML_PERSON_ENCODER ); |
| #define ml_GetInt | ( | ml, | |
| ... | |||
| ) | __ml_GetInt( ml, __VA_ARGS__, ML_LIMIT, 1, ML_END ) |
Search an INTEGER in the database This uses a Query but returns only one integer (>0), or an error code.
| p_media_library | the media library object |
| va_args | parameters to select the data |
| #define ml_GetLastPlayedById | ( | a, | |
| id | |||
| ) | ml_GetInt( a, ML_LAST_PLAYED, ML_ID, id ) |
| #define ml_GetMediaCount | ( | a, | |
| ... | |||
| ) | __ml_GetInt( a, ML_COUNT_MEDIA, __VA_ARGS__, ML_END ) |
Counts handling.
| #define ml_GetOriginalTitleById | ( | a, | |
| id | |||
| ) | ml_GetPsz( a, ML_ORIGINAL_TITLE, ML_ID, id ) |
| #define ml_GetPeopleCount | ( | a, | |
| ... | |||
| ) | __ml_GetInt( a, ML_COUNT_PEOPLE, __VA_ARGS__, ML_END ) |
| #define ml_GetPlayedCountById | ( | a, | |
| id | |||
| ) | ml_GetInt( a, ML_PLAYED_COUNT, ML_ID, id ) |
| #define ml_GetPublisherById | ( | a, | |
| id | |||
| ) | ml_GetPsz( a, ML_PEOPLE, ML_PERSON_PUBLISHER, ML_ID, id ) |
| #define ml_GetPublisherId | ( | a, | |
| b | |||
| ) | ml_GetInt( a, ML_PERSON_ID, ML_PERSON_PUBLISHER, ML_PERSON, ML_PERSON_PUBLISHER, b ) |
| #define ml_GetPublisherIdById | ( | a, | |
| id | |||
| ) | ml_GetInt( a, ML_PEOPLE_ID, ML_PERSON_PUBLISHER, ML_ID, id ) |
| #define ml_GetPublishersFromMedia | ( | a, | |
| b | |||
| ) | ml_GetPersonsFromMedia( a, b, ML_PERSON_PUBLISHER ); |
| #define ml_GetTrackNumberById | ( | a, | |
| id | |||
| ) | ml_GetInt( a, ML_TRACK_NUMBER, ML_ID, id ) |
| #define ml_LockMedia | ( | a | ) | vlc_mutex_lock( &a->lock ) |
Helpers for locking and unlocking.
Referenced by ml_CopyMedia().
| #define ML_PERSON_ALBUM_ARTIST "Album Artist" |
| #define ML_PERSON_ARTIST "Artist" |
| #define ML_PERSON_ENCODER "Encoder" |
| #define ML_PERSON_PUBLISHER "Publisher" |
| #define ml_priv | ( | gc, | |
| t | |||
| ) | ((t *)(((char *)(gc)) - offsetof(t, ml_gc_data))) |
| #define ml_ShallowFreeFindTree | ( | tree | ) | ml_GenericFreeFindTree( tree, false ) |
| #define ml_UnlockMedia | ( | a | ) | vlc_mutex_unlock( &a->lock ) |
Referenced by ml_CopyMedia().
| #define ml_UpdateSimple | ( | ml, | |
| sel, | |||
| lval, | |||
| id, | |||
| ... | |||
| ) | ml_UpdateSimple( ml, sel, lval, id, __VA_ARGS__, ML_END ) |
| typedef struct media_library_sys_t media_library_sys_t |
| typedef struct media_library_t media_library_t |
| typedef struct ml_element_t ml_element_t |
| typedef struct ml_ftree_t ml_ftree_t |
| typedef struct ml_gc_object_t ml_gc_object_t |
| typedef struct ml_media_t ml_media_t |
| typedef struct ml_person_t ml_person_t |
| typedef struct ml_result_t ml_result_t |
| enum ml_comp_e |
| enum ml_control_e |
Arguments for VLC Control for the media library.
| ML_SET_DATABASE |
arg1 = char *psz_host arg2 = int i_port arg3 = char *psz_user arg4 = char *psz_pass |
| ML_INIT_DATABASE |
No arg. |
| ML_ADD_INPUT_ITEM |
arg1 = input_item_t* |
| ML_ADD_PLAYLIST_ITEM |
arg1 = playlist_item_t * |
| ML_ADD_MONITORED |
arg1 = char* |
| ML_DEL_MONITORED |
arg1 = char* |
| ML_GET_MONITORED |
arg1 = vlc_array_t* |
| enum ml_op_e |
| enum ml_result_type_e |
| enum ml_select_e |
List of Query select types.
In a query array or variable argument list, each select type is followed by an argument (X) of variable type (char* or int,
| ML_ALBUM |
Album Title. |
| ML_ALBUM_ID |
Album ID. |
| ML_ALBUM_COVER |
Album Cover art url. |
| ML_ARTIST |
Artist, interpreted as ML_PEOPLE && ML_PEOPLE_ROLE = ML_PERSON_ARTIST. |
| ML_ARTIST_ID |
Artist ID, interpreted as ML_PEOPLE_ID && ML_PEOPLE_ROLE = ML_PERSON_ARTIST. |
| ML_COMMENT |
Comment about media. |
| ML_COUNT_MEDIA |
Number of medias. |
| ML_COUNT_ALBUM |
Number of albums. |
| ML_COUNT_PEOPLE |
Number of people. |
| ML_COVER |
Cover art url. |
| ML_DURATION |
Duration in ms. |
| ML_DISC_NUMBER |
Disc number of the track. |
| ML_EXTRA |
Extra/comment (string) on the media. |
| ML_FIRST_PLAYED |
First time media was played. |
| ML_FILESIZE |
Size of the media file. |
| ML_GENRE |
Genre of the media (if any) |
| ML_ID |
Media ID. |
| ML_IMPORT_TIME |
Date when media was imported. |
| ML_LANGUAGE |
Language. |
| ML_LAST_PLAYED |
Last play UNIX timestamp. |
| ML_LAST_SKIPPED |
Time when media was last skipped. |
| ML_ORIGINAL_TITLE |
Media original title (if any) |
| ML_PEOPLE |
Any People associated with this media. |
| ML_PEOPLE_ID |
Id of a person. |
| ML_PEOPLE_ROLE |
Person role. |
| ML_PLAYED_COUNT |
Media play count. |
| ML_PREVIEW |
Url of the video preview. |
| ML_SKIPPED_COUNT |
Number of times skipped. |
| ML_SCORE |
Computed media score. |
| ML_TITLE |
Media title. |
| ML_TRACK_NUMBER |
Media track number (if any) |
| ML_TYPE |
Media type.
|
| ML_URI |
Media full URI. |
| ML_VOTE |
Media user vote value. |
| ML_YEAR |
Media publishing year. |
| ML_DIRECTORY |
Monitored directory. |
| ML_MEDIA |
Full media descriptor.
|
| ML_MEDIA_SPARSE |
Sparse media.
|
| ML_MEDIA_EXTRA |
Sparse + Extra = Full media. |
| ML_LIMIT |
Limit a query to X results. |
| ML_SORT_DESC |
Sort a query descending on argument X. |
| ML_SORT_ASC |
Sort a query ascending on argument X. |
| ML_DISTINCT |
Add DISTINCT to SELECT statements. |
| ML_END |
End of argument list. |
| enum ml_type_e |
Media types (audio, video, etc...)
|
inlinestatic |
References ml_ControlVa().
|
inlinestatic |
Search in the database according some criterias.
| p_media_library | the media library object |
| result | a pointer to a result array |
| ... | parameters to select the data |
References media_library_t::functions, and media_library_t::pf_Find.
|
inlinestatic |
< No error
References __ml_GetValue(), ml_result_t::i, ml_result_t::value, and VLC_SUCCESS.
|
inlinestatic |
< No error
References __ml_GetValue(), ml_result_t::psz, ml_result_t::value, and VLC_SUCCESS.
|
inlinestatic |
Find a value in the ML database, fill p_result with it.
| p_media_library | Media library object |
| p_result | Object to put result into |
| Args | [ SelectType [ PersonType ] Value ] ... ML_END |
< No error
< Unspecified error
References media_library_t::functions, media_library_t::pf_Find, vlc_array_count(), vlc_array_destroy(), vlc_array_item_at_index(), vlc_array_new(), VLC_EGENERIC, and VLC_SUCCESS.
Referenced by __ml_GetInt(), and __ml_GetPsz().
| ml_media_t* media_New | ( | media_library_t * | p_ml, |
| int | id, | ||
| ml_select_e | select, | ||
| bool | reload | ||
| ) |
Object constructor for ml_media_t.
| p_ml | The media library object |
| id | If 0, this item isn't in database. If non zero, it is and it will be a singleton |
| select | Type of object |
| reload | Whether to reload from database |
References VLC_UNUSED.
|
inlinestatic |
Determine an attribute's type (int or string)
| meta | Attribute to test |
References ML_ALBUM, ML_ALBUM_ID, ML_ARTIST, ML_ARTIST_ID, ML_COMMENT, ML_COUNT_ALBUM, ML_COUNT_MEDIA, ML_COUNT_PEOPLE, ML_COVER, ML_DISC_NUMBER, ML_DURATION, ML_EXTRA, ML_FILESIZE, ML_FIRST_PLAYED, ML_GENRE, ML_ID, ML_IMPORT_TIME, ML_LANGUAGE, ML_LAST_PLAYED, ML_LIMIT, ML_ORIGINAL_TITLE, ML_PEOPLE, ML_PEOPLE_ID, ML_PEOPLE_ROLE, ML_PLAYED_COUNT, ML_PREVIEW, ML_SCORE, ML_SKIPPED_COUNT, ML_TITLE, ML_TRACK_NUMBER, ML_TYPE, ML_URI, ML_VOTE, and ML_YEAR.
Referenced by ml_FreeElement(), and ml_GenericFreeFindTree().
|
inlinestatic |
Control the Media Library.
| p_media_library | the media library object |
| i_type | one of ml_control_e values |
| ... | optional arguments. |
References media_library_t::functions, and media_library_t::pf_Control.
Referenced by __ml_Control().
|
inlinestatic |
Copy all members of a ml_media_t to another.
| b | Destination media, already allocated |
| a | Source media, cannot be NULL, const |
< Unspecified error
< No error
< No error
References ml_media_t::b_sparse, FREENULL, ml_media_t::i_album_id, ml_media_t::i_bitrate, ml_media_t::i_bpm, ml_media_t::i_disc_number, ml_media_t::i_duration, ml_media_t::i_filesize, ml_media_t::i_first_played, ml_media_t::i_id, ml_media_t::i_import_time, ml_media_t::i_last_played, ml_media_t::i_last_skipped, ml_media_t::i_played_count, ml_media_t::i_samplerate, ml_media_t::i_score, ml_media_t::i_skipped_count, ml_media_t::i_track_number, ml_media_t::i_type, ml_media_t::i_vote, ml_media_t::i_year, ml_CopyPersons(), ml_FreePeople(), ml_LockMedia, ml_UnlockMedia, ml_media_t::p_people, ml_media_t::psz_album, ml_media_t::psz_comment, ml_media_t::psz_cover, ml_media_t::psz_extra, ml_media_t::psz_genre, ml_media_t::psz_language, ml_media_t::psz_orig_title, ml_media_t::psz_preview, ml_media_t::psz_title, ml_media_t::psz_uri, strdup(), VLC_EGENERIC, and VLC_SUCCESS.
|
inlinestatic |
Copy one person list into another.
| a | To list |
| b | From list |
< No error
< No error
References ml_CreateAppendPerson(), ml_person_t::p_next, and VLC_SUCCESS.
Referenced by ml_CopyMedia().
| media_library_t* ml_Create | ( | vlc_object_t * | p_this, |
| char * | psz_name | ||
| ) |
Create a Media Library VLC object.
| p_this | Parent to attach the ML object to. |
| psz_name | Name for the module |
Referenced by libvlc_InternalInit().
|
inlinestatic |
Create and append a person object to the given list.
| pp_person | pointer to person list. Set the address to NULL to create a new list |
| personfrom | Person object to copy from |
References ml_person_t::i_id, ml_CreateAppendPersonAdv(), ml_person_t::psz_name, and ml_person_t::psz_role.
Referenced by ml_CopyPersons().
|
inlinestatic |
Create and append a person object to the given list.
| pp_person | pointer to person list. Set the address to null to create new list |
| i_role | The role of the person |
| psz_name | The name string. Will be strdup'd |
| i_id | The id in the database |
< No error
< Unspecified error
< No error
References psz_name, ml_person_t::psz_name, strdup(), VLC_EGENERIC, and VLC_SUCCESS.
Referenced by ml_CreateAppendPerson().
|
inlinestatic |
Create input item from media.
| p_media_library | This ML instance. |
| i_media_id | ID of the media to use to create an input_item. |
References media_library_t::functions, and media_library_t::pf_InputItemFromMedia.
|
inlinestatic |
Delete many medias in the media library.
| p_media_library | Media library object |
| p_array | Array of ids to delete |
References media_library_t::functions, and media_library_t::pf_Delete.
| void ml_DeletePersonTypeFromMedia | ( | ml_media_t * | p_media, |
| const char * | psz_role | ||
| ) |
Delete a certain type of people from a media.
| p_media | Media to delete from |
| i_type | Type of person to delete |
References VLC_UNUSED.
|
inlinestatic |
Generic DELETE function Delete a media and all its references which don't point to anything else.
| p_media_library | This media_library_t object |
| id | the id of the media to delete |
References ml_element_t::criteria, media_library_t::functions, ml_element_t::i, ML_ID, media_library_t::pf_Delete, ml_element_t::value, vlc_array_append(), vlc_array_destroy(), and vlc_array_new().
| void ml_Destroy | ( | vlc_object_t * | p_this | ) |
Destructor for the Media library singleton.
| p_this | Parent the ML object is attached to |
Referenced by libvlc_InternalCleanup().
|
inlinestatic |
Destroy a vlc_array_t of ml_result_t.
| ml_result_array | The result array to free |
References ml_FreeResult(), vlc_array_count(), and vlc_array_item_at_index().
|
inlinestatic |
Search in the database according some criterias (threaded)
| p_media_library | the media library object |
| result_array | a pointer to a result array |
| result_type | type of data to retrieve |
| psz_lvalue | This should contain any necessary lvalue/key for the given result_type. Used for ML_PEOPLE. Otherwise NULL |
| args | parameters to select the data |
References media_library_t::functions, and media_library_t::pf_FindAdv.
|
inlinestatic |
Free a ml_element_t item.
| p_find | Find object to free |
References ml_element_t::criteria, ml_element_t::lvalue, ml_AttributeIsString(), ML_PEOPLE, ml_element_t::str, and ml_element_t::value.
|
inlinestatic |
Free only the content of a media.
| p_media | Media object |
References ml_media_t::b_sparse, FREENULL, ml_media_t::i_album_id, ml_media_t::i_bitrate, ml_media_t::i_bpm, ml_media_t::i_disc_number, ml_media_t::i_duration, ml_media_t::i_filesize, ml_media_t::i_first_played, ml_media_t::i_id, ml_media_t::i_import_time, ml_media_t::i_last_played, ml_media_t::i_last_skipped, ml_media_t::i_played_count, ml_media_t::i_samplerate, ml_media_t::i_score, ml_media_t::i_skipped_count, ml_media_t::i_track_number, ml_media_t::i_type, ml_media_t::i_vote, ml_media_t::i_year, ml_FreePeople(), ML_UNKNOWN, ml_media_t::p_people, ml_media_t::psz_album, ml_media_t::psz_comment, ml_media_t::psz_cover, ml_media_t::psz_extra, ml_media_t::psz_genre, ml_media_t::psz_language, ml_media_t::psz_orig_title, ml_media_t::psz_preview, ml_media_t::psz_title, and ml_media_t::psz_uri.
|
inlinestatic |
Free a person object.
| p_media | Person object to free |
References ml_person_t::p_next, ml_person_t::psz_name, and ml_person_t::psz_role.
Referenced by ml_CopyMedia(), and ml_FreeMediaContent().
|
inlinestatic |
Free a result item.
| p_result | Result item to free |
References ml_gc_decref(), ML_TYPE_MEDIA, ML_TYPE_PSZ, ml_result_t::p_media, ml_result_t::psz, ml_result_t::type, and ml_result_t::value.
Referenced by ml_DestroyResultArray().
|
inlinestatic |
This function gives quick sequential adding capability.
| left | Tree to add to. This may be NULL |
| right | Tree to append. May not be NULL |
References ml_FtreeHasOp(), ML_OP_AND, ML_OP_NONE, and ml_OpConnectChilds().
|
inlinestatic |
Checks if a given find tree has leaf nodes.
| Find | tree |
References ml_ftree_t::criteria, ml_ftree_t::left, ML_OP_NONE, ml_ftree_t::op, and ml_ftree_t::right.
Referenced by ml_FtreeFastAnd().
| ml_ftree_t* ml_FtreeSpec | ( | ml_ftree_t * | tree, |
| ml_select_e | crit, | ||
| int | limit, | ||
| char * | sort | ||
| ) |
Attaches a special node to a tree.
| tree | Tree to attach special node to |
| crit | Criteria may be SORT_ASC, SORT_DESC, LIMIT or DISTINCT |
| limit | Limit used if LIMIT criteria used |
| Sort | string used if SORT criteria is used |
References VLC_UNUSED.
|
inlinestatic |
Decrease reference count of media.
| p_media | The media object |
References ml_media_t::ml_gc_data, ml_gc_object_t::pf_destructor, ml_gc_object_t::pool, and ml_gc_object_t::refs.
Referenced by ml_FreeResult().
|
inlinestatic |
Increment reference count of media.
| p_media | The media object |
References ml_media_t::ml_gc_data, and ml_gc_object_t::refs.
|
inlinestatic |
Free a find tree.
| Find | tree to free |
| true | to free any associated strings, false to not free them |
References ml_ftree_t::criteria, ml_ftree_t::left, ml_ftree_t::lvalue, ml_AttributeIsString(), ML_OP_NONE, ML_PEOPLE, ml_ftree_t::op, ml_ftree_t::right, ml_ftree_t::str, and ml_ftree_t::value.
| media_library_t* ml_Get | ( | vlc_object_t * | p_this | ) |
Acquire a reference to the media library singleton.
| p_this | The object holding the media library |
| ml_person_t* ml_GetPersonsFromMedia | ( | media_library_t * | p_ml, |
| ml_media_t * | p_media, | ||
| const char * | psz_role | ||
| ) |
Returns a person list of given type.
| p_ml | The ML object |
| p_media | The Media object |
| i_type | The person type |
References VLC_UNUSED.
| ml_ftree_t* ml_OpConnectChilds | ( | ml_op_e | op, |
| ml_ftree_t * | left, | ||
| ml_ftree_t * | right | ||
| ) |
Connect up a find tree.
| op | operator to connect with If op = ML_OP_NONE, then you are connecting to a tree consisting of only SPECIAL nodes. If op = ML_OP_NOT, then right MUST be NULL op must not be ML_OP_SPECIAL, |
| left | part of the tree |
| right | part of the tree |
References VLC_UNUSED.
Referenced by ml_FtreeFastAnd().
|
inlinestatic |
Generic update in Media Library database.
| p_media_library | the media library object |
| selected_type | the type of the element we're selecting |
| where | list of ids/uris to be changed |
| changes | list of changes to make in the entries |
References media_library_t::functions, and media_library_t::pf_Update.
| int ml_UpdateSimple | ( | media_library_t * | p_media_library, |
| ml_select_e | selected_type, | ||
| const char * | psz_lvalue, | ||
| int | id, | ||
| ... | |||
| ) |
Update a given table.
| p_media_library | The media library object |
| selected_type | The table to update |
| psz_lvalue | The role of the person if selected_type = ML_PEOPLE |
| id | The id of the row to update |
| ... | The update data. [SelectType [RoleType] Value] |
1.8.1.2