medialibrary: Fix and update the playlist 'Convert' function
[vlc.git] / include / vlc_media_library.h
blobb038566d7a9751e7fb4c78c86d2033b41f0e5cd4
1 /*****************************************************************************
2 * vlc_media_library.h: SQL-based media library
3 *****************************************************************************
4 * Copyright (C) 2008-2010 the VideoLAN Team and AUTHORS
6 * Authors: Antoine Lejeune <phytos@videolan.org>
7 * Jean-Philippe André <jpeg@videolan.org>
8 * Rémi Duraffort <ivoire@videolan.org>
9 * Adrien Maglo <magsoft@videolan.org>
10 * Srikanth Raju <srikiraju at gmail dot com>
12 * This program is free software; you can redistribute it and/or modify it
13 * under the terms of the GNU Lesser General Public License as published by
14 * the Free Software Foundation; either version 2.1 of the License, or
15 * (at your option) any later version.
17 * This program is distributed in the hope that it will be useful,
18 * but WITHOUT ANY WARRANTY; without even the implied warranty of
19 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
20 * GNU Lesser General Public License for more details.
22 * You should have received a copy of the GNU Lesser General Public License
23 * along with this program; if not, write to the Free Software Foundation,
24 * Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301, USA.
25 *****************************************************************************/
27 #ifndef VLC_MEDIA_LIBRARY_H
28 # define VLC_MEDIA_LIBRARY_H
30 #include <assert.h>
31 #include <vlc_common.h>
33 # ifdef __cplusplus
34 extern "C" {
35 # endif
37 typedef enum vlc_ml_media_type_t
39 VLC_ML_MEDIA_TYPE_UNKNOWN,
40 VLC_ML_MEDIA_TYPE_VIDEO,
41 VLC_ML_MEDIA_TYPE_AUDIO,
42 } vlc_ml_media_type_t;
44 typedef enum vlc_ml_media_subtype_t
46 VLC_ML_MEDIA_SUBTYPE_UNKNOWN,
47 VLC_ML_MEDIA_SUBTYPE_SHOW_EPISODE,
48 VLC_ML_MEDIA_SUBTYPE_MOVIE,
49 VLC_ML_MEDIA_SUBTYPE_ALBUMTRACK,
50 } vlc_ml_media_subtype_t;
52 typedef enum vlc_ml_file_type_t
54 VLC_ML_FILE_TYPE_UNKNOWN,
55 VLC_ML_FILE_TYPE_MAIN,
56 VLC_ML_FILE_TYPE_PART,
57 VLC_ML_FILE_TYPE_SOUNDTRACK,
58 VLC_ML_FILE_TYPE_SUBTITLE,
59 VLC_ML_FILE_TYPE_PLAYLIST,
60 } vlc_ml_file_type_t;
62 typedef enum vlc_ml_track_type_t
64 VLC_ML_TRACK_TYPE_UNKNOWN,
65 VLC_ML_TRACK_TYPE_VIDEO,
66 VLC_ML_TRACK_TYPE_AUDIO,
67 } vlc_ml_track_type_t;
69 typedef enum vlc_ml_thumbnail_size_t
71 VLC_ML_THUMBNAIL_SMALL,
72 VLC_ML_THUMBNAIL_BANNER,
74 VLC_ML_THUMBNAIL_SIZE_COUNT
75 } vlc_ml_thumbnail_size_t;
77 typedef enum vlc_ml_thumbnail_status_t
79 VLC_ML_THUMBNAIL_STATUS_MISSING,
80 VLC_ML_THUMBNAIL_STATUS_AVAILABLE,
81 VLC_ML_THUMBNAIL_STATUS_FAILURE,
82 VLC_ML_THUMBNAIL_STATUS_PERSISTENT_FAILURE,
83 VLC_ML_THUMBNAIL_STATUS_CRASH,
84 } vlc_ml_thumbnail_status_t;
86 typedef enum vlc_ml_history_type_t
88 VLC_ML_HISTORY_TYPE_MEDIA,
89 VLC_ML_HISTORY_TYPE_NETWORK,
90 } vlc_ml_history_type_t;
92 typedef struct vlc_ml_thumbnail_t
94 char* psz_mrl;
95 /**
96 * True if a thumbnail is available, or if thumbnail generation was
97 * attempted but failed
99 vlc_ml_thumbnail_status_t i_status;
100 } vlc_ml_thumbnail_t;
102 typedef struct vlc_ml_movie_t
104 char* psz_summary;
105 char* psz_imdb_id;
106 } vlc_ml_movie_t;
108 typedef struct vlc_ml_show_episode_t
110 char* psz_summary;
111 char* psz_tvdb_id;
112 uint32_t i_episode_nb;
113 uint32_t i_season_number;
114 } vlc_ml_show_episode_t;
116 typedef struct vlc_ml_show_t
118 int64_t i_id;
119 char* psz_name;
120 char* psz_summary;
121 char* psz_artwork_mrl;
122 char* psz_tvdb_id;
123 unsigned int i_release_year;
124 uint32_t i_nb_episodes;
125 uint32_t i_nb_seasons;
126 } vlc_ml_show_t;
128 typedef struct vlc_ml_album_track_t
130 int64_t i_artist_id;
131 int64_t i_album_id;
132 int64_t i_genre_id;
134 int i_track_nb;
135 int i_disc_nb;
136 } vlc_ml_album_track_t;
138 typedef struct vlc_ml_label_t
140 int64_t i_id;
141 char* psz_name;
142 } vlc_ml_label_t;
144 typedef struct vlc_ml_label_list_t
146 size_t i_nb_items;
147 vlc_ml_label_t p_items[];
148 } vlc_ml_label_list_t;
150 typedef struct vlc_ml_file_t
152 char* psz_mrl;
153 vlc_ml_file_type_t i_type;
154 bool b_external;
155 bool b_removable;
156 bool b_present;
157 } vlc_ml_file_t;
159 typedef struct vlc_ml_file_list_t
161 size_t i_nb_items;
162 vlc_ml_file_t p_items[];
163 } vlc_ml_file_list_t;
165 typedef struct vlc_ml_media_track_t
167 char* psz_codec;
168 char* psz_language;
169 char* psz_description;
170 vlc_ml_track_type_t i_type;
171 uint32_t i_bitrate;
172 union
174 struct
176 // Audio
177 uint32_t i_nbChannels;
178 uint32_t i_sampleRate;
179 } a;
180 struct
182 // Video
183 uint32_t i_height;
184 uint32_t i_width;
185 uint32_t i_sarNum;
186 uint32_t i_sarDen;
187 uint32_t i_fpsNum;
188 uint32_t i_fpsDen;
189 } v;
191 } vlc_ml_media_track_t;
193 typedef struct vlc_ml_media_track_list_t
195 size_t i_nb_items;
196 vlc_ml_media_track_t p_items[];
197 } vlc_ml_media_track_list_t;
199 typedef struct vlc_ml_media_t
201 int64_t i_id;
203 vlc_ml_media_type_t i_type;
204 vlc_ml_media_subtype_t i_subtype;
206 vlc_ml_file_list_t* p_files;
207 vlc_ml_media_track_list_t* p_tracks;
209 int32_t i_year;
210 /* Duration in milliseconds */
211 int64_t i_duration;
212 uint32_t i_playcount;
213 float f_progress;
214 time_t i_last_played_date;
215 char* psz_title;
217 vlc_ml_thumbnail_t thumbnails[VLC_ML_THUMBNAIL_SIZE_COUNT];
219 bool b_is_favorite;
221 union
223 vlc_ml_show_episode_t show_episode;
224 vlc_ml_movie_t movie;
225 vlc_ml_album_track_t album_track;
227 } vlc_ml_media_t;
229 typedef struct vlc_ml_playlist_t
231 int64_t i_id;
233 char* psz_name;
235 char* psz_mrl;
237 char* psz_artwork_mrl;
239 uint32_t i_creation_date;
241 bool b_is_read_only;
242 } vlc_ml_playlist_t;
244 typedef struct vlc_ml_artist_t
246 int64_t i_id;
247 char* psz_name;
248 char* psz_shortbio;
249 vlc_ml_thumbnail_t thumbnails[VLC_ML_THUMBNAIL_SIZE_COUNT];
250 char* psz_mb_id;
252 unsigned int i_nb_album;
253 unsigned int i_nb_tracks;
254 } vlc_ml_artist_t;
256 typedef struct vlc_ml_artist_list_t
258 size_t i_nb_items;
259 vlc_ml_artist_t p_items[];
260 } vlc_ml_artist_list_t;
262 typedef struct vlc_ml_album_t {
263 int64_t i_id;
264 char* psz_title;
265 char* psz_summary;
266 vlc_ml_thumbnail_t thumbnails[VLC_ML_THUMBNAIL_SIZE_COUNT];
267 char* psz_artist;
268 int64_t i_artist_id;
270 size_t i_nb_tracks;
271 unsigned int i_duration;
272 unsigned int i_year;
273 } vlc_ml_album_t;
275 typedef struct vlc_ml_genre_t
277 int64_t i_id;
278 char* psz_name;
279 size_t i_nb_tracks;
280 } vlc_ml_genre_t;
282 typedef struct vlc_ml_media_list_t
284 size_t i_nb_items;
285 vlc_ml_media_t p_items[];
286 } vlc_ml_media_list_t;
288 typedef struct vlc_ml_album_list_t
290 size_t i_nb_items;
291 vlc_ml_album_t p_items[];
292 } vlc_ml_album_list_t;
294 typedef struct vlc_ml_show_list_t
296 size_t i_nb_items;
297 vlc_ml_show_t p_items[];
298 } vlc_ml_show_list_t;
300 typedef struct vlc_ml_genre_list_t
302 size_t i_nb_items;
303 vlc_ml_genre_t p_items[];
304 } vlc_ml_genre_list_t;
306 typedef struct vlc_ml_playlist_list_t
308 size_t i_nb_items;
309 vlc_ml_playlist_t p_items[];
310 } vlc_ml_playlist_list_t;
312 typedef struct vlc_ml_entry_point_t
314 char* psz_mrl; /**< This entrypoint's MRL. Will be NULL if b_present is false */
315 bool b_present; /**< The presence state for this entrypoint. */
316 bool b_banned; /**< Will be true if the user required this entrypoint to be excluded */
317 } vlc_ml_entry_point_t;
319 typedef struct vlc_ml_entry_point_list_t
321 size_t i_nb_items;
322 vlc_ml_entry_point_t p_items[];
323 } vlc_ml_entry_point_list_t;
325 typedef struct vlc_ml_bookmark_t
327 int64_t i_media_id; /**< The associated media ID */
328 int64_t i_time; /**< The bookmark time. The unit is arbitrary */
329 char* psz_name; /**< The bookmark name */
330 char* psz_description; /**< The bookmark description */
331 } vlc_ml_bookmark_t;
333 typedef struct vlc_ml_boomkmark_list_t
335 size_t i_nb_items;
336 vlc_ml_bookmark_t p_items[];
337 } vlc_ml_bookmark_list_t;
339 /* Opaque medialibrary pointer, to be used by any non-medialibrary module */
340 typedef struct vlc_medialibrary_t vlc_medialibrary_t;
341 /* "Private" medialibrary pointer, to be used by the core & medialibrary modules */
342 typedef struct vlc_medialibrary_module_t vlc_medialibrary_module_t;
343 /* Opaque event callback type */
344 typedef struct vlc_ml_event_callback_t vlc_ml_event_callback_t;
346 typedef enum vlc_ml_sorting_criteria_t
349 * Default depends on the entity type:
350 * - By track number (and disc number) for album tracks
351 * - Alphabetical order for others
353 VLC_ML_SORTING_DEFAULT,
354 VLC_ML_SORTING_ALPHA,
355 VLC_ML_SORTING_DURATION,
356 VLC_ML_SORTING_INSERTIONDATE,
357 VLC_ML_SORTING_LASTMODIFICATIONDATE,
358 VLC_ML_SORTING_RELEASEDATE,
359 VLC_ML_SORTING_FILESIZE,
360 VLC_ML_SORTING_ARTIST,
361 VLC_ML_SORTING_PLAYCOUNT,
362 VLC_ML_SORTING_ALBUM,
363 VLC_ML_SORTING_FILENAME,
364 VLC_ML_SORTING_TRACKNUMBER,
365 } vlc_ml_sorting_criteria_t;
367 typedef struct vlc_ml_query_params_t vlc_ml_query_params_t;
368 struct vlc_ml_query_params_t
370 const char* psz_pattern;
371 uint32_t i_nbResults;
372 uint32_t i_offset;
373 vlc_ml_sorting_criteria_t i_sort;
374 bool b_desc;
377 enum vlc_ml_get_queries
379 VLC_ML_GET_MEDIA, /**< arg1: Media ID; ret: vlc_ml_media_t* */
380 VLC_ML_GET_MEDIA_BY_MRL, /**< arg1: Media MRL; ret: vlc_ml_media_t* */
381 VLC_ML_GET_INPUT_ITEM, /**< arg1: Media ID; ret: input_item_t* */
382 VLC_ML_GET_INPUT_ITEM_BY_MRL,/**< arg1: Media MRL; ret: input_item_t* */
383 VLC_ML_GET_ALBUM, /**< arg1: Album ID; ret: vlc_ml_album_t* */
384 VLC_ML_GET_ARTIST, /**< arg1: Artist ID; ret: vlc_ml_artist_t* */
385 VLC_ML_GET_GENRE, /**< arg1: Genre ID; ret: vlc_ml_genre_t* */
386 VLC_ML_GET_SHOW, /**< arg1: Show ID; ret: vlc_ml_show_t* */
387 VLC_ML_GET_PLAYLIST, /**< arg1: Playlist ID; ret: vlc_ml_playlist_t* */
390 enum vlc_ml_list_queries
392 /* General listing: */
394 VLC_ML_LIST_VIDEOS, /**< arg1 (out): vlc_ml_media_list_t** */
395 VLC_ML_COUNT_VIDEOS, /**< arg1 (out): size_t* */
396 VLC_ML_LIST_AUDIOS, /**< arg1 (out): vlc_ml_media_list_t** */
397 VLC_ML_COUNT_AUDIOS, /**< arg1 (out): size_t* */
398 VLC_ML_LIST_ALBUMS, /**< arg1 (out): vlc_ml_album_list_t** */
399 VLC_ML_COUNT_ALBUMS, /**< arg1 (out): size_t* */
400 VLC_ML_LIST_GENRES, /**< arg1 (out): vlc_ml_genre_list_t** */
401 VLC_ML_COUNT_GENRES, /**< arg1 (out): size_t* */
402 VLC_ML_LIST_ARTISTS, /**< arg1 bool: includeAll; arg2 (out): vlc_ml_genre_list_t** */
403 VLC_ML_COUNT_ARTISTS, /**< arg1 bool: includeAll; arg2 (out): size_t* */
404 VLC_ML_LIST_SHOWS, /**< arg1 (out): vlc_ml_show_list_t** */
405 VLC_ML_COUNT_SHOWS, /**< arg1 (out): size_t* */
406 VLC_ML_LIST_PLAYLISTS, /**< arg1 (out): vlc_ml_playlist_list_t** */
407 VLC_ML_COUNT_PLAYLISTS, /**< arg1 (out): size_t* */
408 VLC_ML_LIST_HISTORY, /**< arg1 (out): vlc_ml_media_list_t** */
409 VLC_ML_COUNT_HISTORY, /**< arg1 (out): size_t* */
410 VLC_ML_LIST_HISTORY_BY_TYPE, /**< arg1 vlc_ml_media_type_t: the media type. arg2 (out): vlc_ml_media_list_t** */
411 VLC_ML_COUNT_HISTORY_BY_TYPE, /**< arg1 vlc_ml_media_type_t: the media type. arg2 (out): vlc_ml_media_list_t***/
412 VLC_ML_LIST_STREAM_HISTORY, /**< arg1 (out): vlc_ml_media_list_t** */
413 VLC_ML_COUNT_STREAM_HISTORY, /**< arg1 (out): size_t* */
415 /* Album specific listings */
416 VLC_ML_LIST_ALBUM_TRACKS, /**< arg1: The album id. arg2 (out): vlc_ml_media_list_t** */
417 VLC_ML_COUNT_ALBUM_TRACKS, /**< arg1: The album id. arg2 (out): size_t* */
418 VLC_ML_LIST_ALBUM_ARTISTS, /**< arg1: The album id. arg2 (out): vlc_ml_album_list_t** */
419 VLC_ML_COUNT_ALBUM_ARTISTS, /**< arg1: The album id. arg2 (out): size_t* */
421 /* Artist specific listings */
422 VLC_ML_LIST_ARTIST_ALBUMS, /**< arg1: The artist id. arg2(out): vlc_ml_album_list_t** */
423 VLC_ML_COUNT_ARTIST_ALBUMS, /**< arg1: The artist id. arg2(out): size_t* */
424 VLC_ML_LIST_ARTIST_TRACKS, /**< arg1: The artist id. arg2(out): vlc_ml_media_list_t** */
425 VLC_ML_COUNT_ARTIST_TRACKS, /**< arg1: The artist id. arg2(out): size_t* */
427 /* Genre specific listings */
428 VLC_ML_LIST_GENRE_ARTISTS, /**< arg1: genre id; arg2 (out): vlc_ml_artist_list_t** */
429 VLC_ML_COUNT_GENRE_ARTISTS, /**< arg1: genre id; arg2 (out): size_t* */
430 VLC_ML_LIST_GENRE_TRACKS, /**< arg1: genre id; arg2 (out): vlc_ml_media_list_t** */
431 VLC_ML_COUNT_GENRE_TRACKS, /**< arg1: genre id; arg2 (out): size_t* */
432 VLC_ML_LIST_GENRE_ALBUMS, /**< arg1: genre id; arg2 (out): vlc_ml_album_list_t** */
433 VLC_ML_COUNT_GENRE_ALBUMS, /**< arg1: genre id; arg2 (out): size_t* */
435 /* Show specific listings */
436 VLC_ML_LIST_SHOW_EPISODES, /**< arg1: show id; arg2(out): vlc_ml_media_list_t** */
437 VLC_ML_COUNT_SHOW_EPISODES, /**< arg1: show id; arg2(out): size_t* */
439 /* Media specific listings */
440 VLC_ML_LIST_MEDIA_LABELS, /**< arg1: media id; arg2 (out): vlc_ml_label_list_t** */
441 VLC_ML_COUNT_MEDIA_LABELS, /**< arg1: media id; arg2 (out): size_t* */
442 VLC_ML_LIST_MEDIA_BOOKMARKS, /**< arg1: media id; arg2 (out): vlc_ml_bookmark_list_t** */
444 /* Playlist specific listings */
445 VLC_ML_LIST_PLAYLIST_MEDIA, /**< arg1: playlist id; arg2 (out): vlc_ml_media_list_t** */
446 VLC_ML_COUNT_PLAYLIST_MEDIA, /**< arg1: playlist id; arg2 (out): size_t* */
448 /* Children entities listing */
449 VLC_ML_LIST_MEDIA_OF, /**< arg1: parent entity type; arg2: parent entity id; arg3(out): ml_media_list_t** */
450 VLC_ML_COUNT_MEDIA_OF, /**< arg1: parent entity type; arg2: parent entity id; arg3(out): size_t* */
451 VLC_ML_LIST_ARTISTS_OF, /**< arg1: parent entity type; arg2: parent entity id; arg3(out): ml_artist_list_t** */
452 VLC_ML_COUNT_ARTISTS_OF, /**< arg1: parent entity type; arg2: parent entity id; arg3(out): size_t* */
453 VLC_ML_LIST_ALBUMS_OF, /**< arg1: parent entity type; arg2: parent entity id; arg3(out): ml_album_list_t** */
454 VLC_ML_COUNT_ALBUMS_OF, /**< arg1: parent entity type; arg2: parent entity id; arg3(out): size_t* */
457 enum vlc_ml_parent_type
459 VLC_ML_PARENT_UNKNOWN,
460 VLC_ML_PARENT_ALBUM,
461 VLC_ML_PARENT_ARTIST,
462 VLC_ML_PARENT_SHOW,
463 VLC_ML_PARENT_GENRE,
464 VLC_ML_PARENT_PLAYLIST,
467 enum vlc_ml_control
469 /* Adds a folder to discover through the medialibrary */
470 VLC_ML_ADD_FOLDER, /**< arg1: mrl (const char*) res: can't fail */
471 VLC_ML_REMOVE_FOLDER, /**< arg1: mrl (const char*) res: can't fail */
472 VLC_ML_BAN_FOLDER, /**< arg1: mrl (const char*) res: can't fail */
473 VLC_ML_UNBAN_FOLDER, /**< arg1: mrl (const char*) res: can't fail */
474 VLC_ML_LIST_FOLDERS, /**< arg1: entrypoints (vlc_ml_entry_point_list_t**); res: can fail */
475 VLC_ML_LIST_BANNED_FOLDERS, /**< arg1: entrypoints (vlc_ml_entry_point_list_t**); res: can fail */
476 VLC_ML_IS_INDEXED, /**< arg1: mrl (const char*) arg2 (out): bool*; res: can fail */
478 * Reload a specific folder, or all.
479 * arg1: mrl (const char*), NULL to reload all folders
480 * res: can't fail
482 VLC_ML_RELOAD_FOLDER,
484 /* Pause/resume background operations, such as media discovery & media analysis */
485 VLC_ML_PAUSE_BACKGROUND, /**< no args; can't fail */
486 VLC_ML_RESUME_BACKGROUND, /**< no args; can't fail */
488 /* Misc operations */
489 VLC_ML_CLEAR_HISTORY, /**< no args; can't fail */
491 /* Create media */
492 VLC_ML_NEW_EXTERNAL_MEDIA, /**< arg1: const char*; arg2(out): vlc_ml_media_t** */
493 VLC_ML_NEW_STREAM, /**< arg1: const char*; arg2(out): vlc_ml_media_t** */
495 /* Media management */
496 VLC_ML_MEDIA_UPDATE_PROGRESS, /**< arg1: media id; arg2: playback position; can fail */
497 VLC_ML_MEDIA_GET_MEDIA_PLAYBACK_STATE, /**< arg1: media id; arg2: vlc_ml_playback_state; arg3: char**; */
498 VLC_ML_MEDIA_SET_MEDIA_PLAYBACK_STATE, /**< arg1: media id; arg2: vlc_ml_playback_state; arg3: const char*; */
499 VLC_ML_MEDIA_GET_ALL_MEDIA_PLAYBACK_STATES, /**< arg1: media id; arg2(out): vlc_ml_playback_states_all* */
500 VLC_ML_MEDIA_SET_ALL_MEDIA_PLAYBACK_STATES, /**< arg1: media id; arg2: const vlc_ml_playback_states_all* */
501 VLC_ML_MEDIA_SET_THUMBNAIL, /**< arg1: media id; arg2: const char*; arg3: vlc_ml_thumbnail_size_t */
502 VLC_ML_MEDIA_GENERATE_THUMBNAIL, /**< arg1: media id; arg2: vlc_ml_thumbnail_size_t; arg3: width; arg4: height; arg5: position */
503 VLC_ML_MEDIA_ADD_EXTERNAL_MRL, /**< arg1: media id; arg2: const char*; arg3: type(vlc_ml_file_type_t) */
504 VLC_ML_MEDIA_SET_TYPE, /**< arg1: media id; arg2: vlc_ml_media_type_t */
505 VLC_ML_MEDIA_ADD_BOOKMARK, /**< arg1: media id; arg2: int64_t */
506 VLC_ML_MEDIA_REMOVE_BOOKMARK, /**< arg1: media id; arg2: int64_t */
507 VLC_ML_MEDIA_REMOVE_ALL_BOOKMARKS, /**< arg1: media id */
508 VLC_ML_MEDIA_UPDATE_BOOKMARK, /**< arg1: media id; arg2: int64_t; arg3: const char*; arg4: const char* */
510 /* Playlist management */
511 VLC_ML_PLAYLIST_CREATE, /**< arg1: const char*; arg2(out): vlc_ml_playlist_t**; can fail */
512 VLC_ML_PLAYLIST_DELETE, /**< arg1: playlist id; can fail */
513 VLC_ML_PLAYLIST_APPEND, /**< arg1: playlist id; arg2: media id; can fail */
514 VLC_ML_PLAYLIST_INSERT, /**< arg1: playlist id; arg2: media id; arg3: position; can fail */
515 VLC_ML_PLAYLIST_MOVE, /**< arg1: playlist id; arg2: from; arg3: to; can fail */
516 VLC_ML_PLAYLIST_REMOVE /**< arg1: playlist id; arg2: position; can fail */
520 * User playback settings.
521 * All values/units are up to the caller and are not interpreted by the media
522 * library.
523 * All values are stored and returned as strings.
524 * When calling vlc_medialibrary_t::pf_control with vlc_ml_MEDIA_GET_MEDIA_PLAYBACK_STATE,
525 * the value will be returned stored in the provided char**. If the state was
526 * not set yet, NULL will be returned.
527 * When setting a state, NULL can be provided as a value to unset it.
529 enum vlc_ml_playback_state
531 VLC_ML_PLAYBACK_STATE_RATING,
532 VLC_ML_PLAYBACK_STATE_SPEED,
533 VLC_ML_PLAYBACK_STATE_TITLE,
534 VLC_ML_PLAYBACK_STATE_CHAPTER,
535 VLC_ML_PLAYBACK_STATE_PROGRAM,
536 VLC_ML_PLAYBACK_STATE_SEEN,
537 VLC_ML_PLAYBACK_STATE_VIDEO_TRACK,
538 VLC_ML_PLAYBACK_STATE_ASPECT_RATIO,
539 VLC_ML_PLAYBACK_STATE_ZOOM,
540 VLC_ML_PLAYBACK_STATE_CROP,
541 VLC_ML_PLAYBACK_STATE_DEINTERLACE,
542 VLC_ML_PLAYBACK_STATE_VIDEO_FILTER,
543 VLC_ML_PLAYBACK_STATE_AUDIO_TRACK,
544 VLC_ML_PLAYBACK_STATE_GAIN,
545 VLC_ML_PLAYBACK_STATE_AUDIO_DELAY,
546 VLC_ML_PLAYBACK_STATE_SUBTITLE_TRACK,
547 VLC_ML_PLAYBACK_STATE_SUBTITLE_DELAY,
548 VLC_ML_PLAYBACK_STATE_APP_SPECIFIC,
551 typedef struct vlc_ml_playback_states_all
553 float rate;
554 float zoom;
555 int current_title;
556 char* current_video_track;
557 char* current_audio_track;
558 char *current_subtitle_track;
559 char* aspect_ratio;
560 char* crop;
561 char* deinterlace;
562 char* video_filter;
563 } vlc_ml_playback_states_all;
565 enum vlc_ml_event_type
568 * Entity modification callbacks. The affected entity will be passed:
569 * - As a vlc_ml_<type>_t, depending on the type of the modified/inserted
570 * entity, in vlc_ml_event_t::modification::p_<type>
571 * for ADDED and UPDATED variants.
572 * - as an id, in vlc_ml_event_t::deletion::i_entity_id
573 * When _DELETED callbacks get invoked, the entity will already have been
574 * deleted from the database, and cannot be retrieved anymore
576 VLC_ML_EVENT_MEDIA_ADDED,
577 VLC_ML_EVENT_MEDIA_UPDATED,
578 VLC_ML_EVENT_MEDIA_DELETED,
579 VLC_ML_EVENT_ARTIST_ADDED,
580 VLC_ML_EVENT_ARTIST_UPDATED,
581 VLC_ML_EVENT_ARTIST_DELETED,
582 VLC_ML_EVENT_ALBUM_ADDED,
583 VLC_ML_EVENT_ALBUM_UPDATED,
584 VLC_ML_EVENT_ALBUM_DELETED,
585 VLC_ML_EVENT_PLAYLIST_ADDED,
586 VLC_ML_EVENT_PLAYLIST_UPDATED,
587 VLC_ML_EVENT_PLAYLIST_DELETED,
588 VLC_ML_EVENT_GENRE_ADDED,
589 VLC_ML_EVENT_GENRE_UPDATED,
590 VLC_ML_EVENT_GENRE_DELETED,
591 VLC_ML_EVENT_BOOKMARKS_ADDED,
592 VLC_ML_EVENT_BOOKMARKS_UPDATED,
593 VLC_ML_EVENT_BOOKMARKS_DELETED,
595 * A discovery started.
596 * For each VLC_ML_EVENT_DISCOVERY_STARTED event, there will be
597 * 1 VLC_ML_EVENT_DISCOVERY_COMPLETED event, and N
598 * VLC_ML_EVENT_DISCOVERY_PROGRESS events.
599 * The entry point being discovered is stored in
600 * vlc_ml_event_t::discovery_started::psz_entry_point.
602 VLC_ML_EVENT_DISCOVERY_STARTED,
604 * Sent when a discovery or reload operation starts analyzing a new folder.
605 * The discovered entry point is stored in
606 * vlc_ml_event_t::discovery_progress::psz_entry_point.
608 VLC_ML_EVENT_DISCOVERY_PROGRESS,
610 * Sent when an entry point discovery is completed.
611 * The entry point that was being discovered is stored in
612 * vlc_ml_event_t::discovery_completed::psz_entry_point.
613 * The success or failure state is stored in
614 * vlc_ml_event_t::discovery_completed::b_success
616 VLC_ML_EVENT_DISCOVERY_COMPLETED,
618 * An entry point reload operation started.
619 * For all the entry points being reloaded, N VLC_EVENT_DISCOVERY_PROGRESS
620 * and 1 VLC_EVENT_RELOAD_COMPLETED event will be sent.
621 * The entry point being reloaded is stored in
622 * vlc_ml_event_t::reload_started::psz_entry_point.
624 VLC_ML_EVENT_RELOAD_STARTED,
626 * Sent when an entry point reload is completed.
627 * The entry point that was being reloaded is stored in
628 * vlc_ml_event_t::reload_completed::psz_entry_point.
629 * The success or failure state is stored in
630 * vlc_ml_event_t::reload_completed::b_success
632 VLC_ML_EVENT_RELOAD_COMPLETED,
634 * Sent when a new entry point gets added to the database.
635 * The entry point that was added is stored in
636 * vlc::ml_event_t::entry_point_added::psz_entry_point, and the success or failure
637 * state is stored in vlc_ml_event_t::entry_point_added::b_success
638 * If successful, this event won't be emited again for this entry point.
639 * In case of failure, this event will be fired again if the same entry point
640 * is queued for discovery again.
642 VLC_ML_EVENT_ENTRY_POINT_ADDED,
644 * Sent when an entry point removal request has been processed.
645 * The removed entry point is stored in
646 * vlc_ml_event_t::entry_point_removed::psz_entry_point and the success or failure
647 * state is stored in vlc_ml_event_t::entry_point_removed::b_success
649 VLC_ML_EVENT_ENTRY_POINT_REMOVED,
651 * Sent when an entry point ban request has been processed.
652 * The banned entry point is stored in
653 * vlc_ml_event_t::entry_point_banned::psz_entry_point and the operation success
654 * state is stored in vlc_ml_event_t::entry_point_banned::b_success
656 VLC_ML_EVENT_ENTRY_POINT_BANNED,
658 * Sent when an entry point unban request has been processed.
659 * The unbanned entry point is stored in
660 * vlc_ml_event_t::entry_point_unbanned::psz_entry_point and the operation success
661 * state is stored in vlc_ml_event_t::entry_point_unbanned::b_success
663 VLC_ML_EVENT_ENTRY_POINT_UNBANNED,
665 * Sent when a discoverer or parser threads changes its idle state.
666 * The idle state is stored in vlc_ml_event_t::background_idle_changed.b_idle.
667 * False means at least one background thread is in running, true means
668 * both discoverer & parser threads are paused.
670 VLC_ML_EVENT_BACKGROUND_IDLE_CHANGED,
672 * Sent when the parsing progress percentage gets updated.
673 * The percentage is stored as a [0;100] integer, in
674 * vlc_ml_event_t::parsing_progress::i_percent
675 * This value might decrease as more media get discovered, but it will only
676 * increase once all discovery operations are completed.
678 VLC_ML_EVENT_PARSING_PROGRESS_UPDATED,
680 * Sent after a media thumbnail was generated, or if it's generation failed.
681 * The media is stored in vlc_ml_event_t::media_thumbnail_generated::p_media
682 * and the success state is stored in
683 * vlc_ml_event_t::media_thumbnail_generated::b_success
685 VLC_ML_EVENT_MEDIA_THUMBNAIL_GENERATED,
687 * Sent after the history gets changed. It can be either cleaned, or simply
688 * modified because a media was recently played/removed from the history.
689 * The history type (media/network) is stored in
690 * vlc_ml_event_t::history_changed::history_type
692 VLC_ML_EVENT_HISTORY_CHANGED,
694 * Sent when an application requested rescan starts being processed.
696 VLC_ML_EVENT_RESCAN_STARTED,
699 typedef struct vlc_ml_event_t
701 int i_type;
702 union
704 struct
706 const char* psz_entry_point;
707 } discovery_started;
708 struct
710 const char* psz_entry_point;
711 } discovery_progress;
712 struct
714 const char* psz_entry_point;
715 bool b_success;
716 } discovery_completed;
717 struct
719 const char* psz_entry_point;
720 } reload_started;
721 struct
723 const char* psz_entry_point;
724 bool b_success;
725 } reload_completed;
726 struct
728 const char* psz_entry_point;
729 bool b_success;
730 } entry_point_added;
731 struct
733 const char* psz_entry_point;
734 bool b_success;
735 } entry_point_removed;
736 struct
738 const char* psz_entry_point;
739 bool b_success;
740 } entry_point_banned;
741 struct
743 const char* psz_entry_point;
744 bool b_success;
745 } entry_point_unbanned;
746 struct
748 uint8_t i_percent;
749 } parsing_progress;
750 union
752 const vlc_ml_media_t* p_media;
753 const vlc_ml_artist_t* p_artist;
754 const vlc_ml_album_t* p_album;
755 const vlc_ml_playlist_t* p_playlist;
756 const vlc_ml_genre_t* p_genre;
757 const vlc_ml_bookmark_t* p_bookmark;
758 } creation;
759 struct
761 int64_t i_entity_id;
762 } modification;
763 struct
765 int64_t i_entity_id;
766 } deletion;
767 struct
769 bool b_idle;
770 } background_idle_changed;
771 struct
773 const vlc_ml_media_t* p_media;
774 vlc_ml_thumbnail_size_t i_size;
775 bool b_success;
776 } media_thumbnail_generated;
777 struct
779 vlc_ml_history_type_t history_type;
780 } history_changed;
782 } vlc_ml_event_t;
784 typedef void (*vlc_ml_callback_t)( void* p_data, const vlc_ml_event_t* p_event );
786 typedef struct vlc_medialibrary_callbacks_t
788 void (*pf_send_event)( vlc_medialibrary_module_t* p_ml, const vlc_ml_event_t* p_event );
789 } vlc_medialibrary_callbacks_t;
791 struct vlc_medialibrary_module_t
793 struct vlc_object_t obj;
795 module_t *p_module;
797 void* p_sys;
799 int (*pf_control)( struct vlc_medialibrary_module_t* p_ml, int i_query, va_list args );
801 * List some entities from the medialibrary.
803 * \param p_ml The medialibrary module instance.
804 * \param i_query The type search to be performed. \see vlc_ml_list enumeration
805 * \param p_params A pointer to a vlc_ml_query_params_t structure, or NULL for
806 * the default parameters (alphabetical ascending sort, no pagination)
808 * \return VLC_SUCCESS or an error code
810 * Refer to the individual list of vlc_ml_list requests for the additional
811 * per-query input/ouput parameters values & types
813 int (*pf_list)( struct vlc_medialibrary_module_t* p_ml, int i_query,
814 const vlc_ml_query_params_t* p_params, va_list args );
817 * Get a specific entity by its id or another unique value
819 * \return The required entity, or a NULL pointer if couldn't be found.
821 * Refer to the list of queries for the specific return type
823 void* (*pf_get)( struct vlc_medialibrary_module_t* p_ml, int i_query, va_list args );
825 const vlc_medialibrary_callbacks_t* cbs;
828 vlc_medialibrary_t* libvlc_MlCreate( libvlc_int_t* p_libvlc );
829 void libvlc_MlRelease( vlc_medialibrary_t* p_ml );
831 VLC_API vlc_medialibrary_t* vlc_ml_instance_get( vlc_object_t* p_obj ) VLC_USED;
832 #define vlc_ml_instance_get(x) vlc_ml_instance_get( VLC_OBJECT(x) )
834 VLC_API void* vlc_ml_get( vlc_medialibrary_t* p_ml, int i_query, ... ) VLC_USED;
835 VLC_API int vlc_ml_control( vlc_medialibrary_t* p_ml, int i_query, ... ) VLC_USED;
836 VLC_API int vlc_ml_list( vlc_medialibrary_t* p_ml, int i_query,
837 const vlc_ml_query_params_t* p_params, ... );
840 * \brief Registers a medialibrary callback.
841 * \returns A handle to the callback, to be passed to vlc_ml_event_unregister_callback
843 VLC_API vlc_ml_event_callback_t*
844 vlc_ml_event_register_callback( vlc_medialibrary_t* p_ml, vlc_ml_callback_t cb, void* p_data );
847 * \brief Unregisters a medialibrary callback
848 * \param p_handle The handled returned by vlc_ml_register_callback
850 VLC_API void vlc_ml_event_unregister_callback( vlc_medialibrary_t* p_ml,
851 vlc_ml_event_callback_t* p_callback );
853 * \brief Unregisters a medialibrary callback from the said callback.
854 * \param p_callback The handle returned by vlc_ml_register_callback
856 * This must only be called synchronously from the callback function provided to
857 * vlc_ml_event_register_callback
858 * The p_callback handle must be considered invalid when this function returns
860 VLC_API void vlc_ml_event_unregister_from_callback( vlc_medialibrary_t* p_ml,
861 vlc_ml_event_callback_t* p_callback );
864 VLC_API void vlc_ml_show_release( vlc_ml_show_t* p_show );
865 VLC_API void vlc_ml_artist_release( vlc_ml_artist_t* p_artist );
866 VLC_API void vlc_ml_genre_release( vlc_ml_genre_t* p_genre );
867 VLC_API void vlc_ml_media_release( vlc_ml_media_t* p_media );
868 VLC_API void vlc_ml_album_release( vlc_ml_album_t* p_album );
869 VLC_API void vlc_ml_playlist_release( vlc_ml_playlist_t* p_playlist );
871 VLC_API void vlc_ml_label_list_release( vlc_ml_label_list_t* p_list );
872 VLC_API void vlc_ml_file_list_release( vlc_ml_file_list_t* p_list );
873 VLC_API void vlc_ml_artist_list_release( vlc_ml_artist_list_t* p_list );
874 VLC_API void vlc_ml_media_list_release( vlc_ml_media_list_t* p_list );
875 VLC_API void vlc_ml_album_list_release( vlc_ml_album_list_t* p_list );
876 VLC_API void vlc_ml_show_list_release( vlc_ml_show_list_t* p_list );
877 VLC_API void vlc_ml_genre_list_release( vlc_ml_genre_list_t* p_list );
878 VLC_API void vlc_ml_playlist_list_release( vlc_ml_playlist_list_t* p_list );
879 VLC_API void vlc_ml_entry_point_list_release( vlc_ml_entry_point_list_t* p_list );
880 VLC_API void vlc_ml_playback_states_all_release( vlc_ml_playback_states_all* prefs );
881 VLC_API void vlc_ml_bookmark_release( vlc_ml_bookmark_t* p_bookmark );
882 VLC_API void vlc_ml_bookmark_list_release( vlc_ml_bookmark_list_t* p_list );
884 static inline vlc_ml_query_params_t vlc_ml_query_params_create()
886 return (vlc_ml_query_params_t) {
887 .psz_pattern = NULL,
888 .i_nbResults = 0,
889 .i_offset = 0,
890 .i_sort = VLC_ML_SORTING_DEFAULT,
891 .b_desc = false
895 static inline int vlc_ml_add_folder( vlc_medialibrary_t* p_ml, const char* psz_folder )
897 return vlc_ml_control( p_ml, VLC_ML_ADD_FOLDER, psz_folder );
900 static inline int vlc_ml_remove_folder( vlc_medialibrary_t* p_ml, const char* psz_folder )
902 return vlc_ml_control( p_ml, VLC_ML_REMOVE_FOLDER, psz_folder );
905 static inline int vlc_ml_ban_folder( vlc_medialibrary_t* p_ml, const char* psz_folder )
907 return vlc_ml_control( p_ml, VLC_ML_BAN_FOLDER, psz_folder );
910 static inline int vlc_ml_unban_folder( vlc_medialibrary_t* p_ml, const char* psz_folder )
912 return vlc_ml_control( p_ml, VLC_ML_UNBAN_FOLDER, psz_folder );
915 static inline int vlc_ml_list_folder( vlc_medialibrary_t* p_ml,
916 vlc_ml_entry_point_list_t** pp_entrypoints )
918 return vlc_ml_control( p_ml, VLC_ML_LIST_FOLDERS, pp_entrypoints );
921 static inline int vlc_ml_list_banned_folder( vlc_medialibrary_t* p_ml,
922 vlc_ml_entry_point_list_t** pp_entrypoints )
924 return vlc_ml_control( p_ml, VLC_ML_LIST_BANNED_FOLDERS, pp_entrypoints );
927 static inline int vlc_ml_is_indexed( vlc_medialibrary_t* p_ml,
928 const char* psz_mrl, bool* p_res )
930 return vlc_ml_control( p_ml, VLC_ML_IS_INDEXED, psz_mrl, p_res );
933 static inline int vlc_ml_reload_folder( vlc_medialibrary_t* p_ml, const char* psz_mrl )
935 return vlc_ml_control( p_ml, VLC_ML_RELOAD_FOLDER, psz_mrl );
938 static inline int vlc_ml_pause_background( vlc_medialibrary_t* p_ml )
940 return vlc_ml_control( p_ml, VLC_ML_PAUSE_BACKGROUND );
943 static inline int vlc_ml_resume_background( vlc_medialibrary_t* p_ml )
945 return vlc_ml_control( p_ml, VLC_ML_RESUME_BACKGROUND );
948 static inline int vlc_ml_clear_history( vlc_medialibrary_t* p_ml )
950 return vlc_ml_control( p_ml, VLC_ML_CLEAR_HISTORY );
953 static inline vlc_ml_media_t* vlc_ml_new_external_media( vlc_medialibrary_t* p_ml, const char* psz_mrl )
955 vlc_ml_media_t* res;
956 if ( vlc_ml_control( p_ml, VLC_ML_NEW_EXTERNAL_MEDIA, psz_mrl, &res ) != VLC_SUCCESS )
957 return NULL;
958 return res;
961 static inline vlc_ml_media_t* vlc_ml_new_stream( vlc_medialibrary_t* p_ml, const char* psz_mrl )
963 vlc_ml_media_t* res;
964 if ( vlc_ml_control( p_ml, VLC_ML_NEW_STREAM, psz_mrl, &res ) != VLC_SUCCESS )
965 return NULL;
966 return res;
969 static inline int vlc_ml_media_update_progress( vlc_medialibrary_t* p_ml, int64_t i_media_id,
970 double progress )
972 return vlc_ml_control( p_ml, VLC_ML_MEDIA_UPDATE_PROGRESS, i_media_id, progress );
975 static inline int vlc_ml_media_get_playback_state( vlc_medialibrary_t* p_ml, int64_t i_media_id, int i_state, char** ppsz_result )
977 return vlc_ml_control( p_ml, VLC_ML_MEDIA_GET_MEDIA_PLAYBACK_STATE, i_media_id, i_state, ppsz_result );
980 static inline int vlc_ml_media_set_playback_state( vlc_medialibrary_t* p_ml, int64_t i_media_id, int i_state, const char* psz_value )
982 return vlc_ml_control( p_ml, VLC_ML_MEDIA_SET_MEDIA_PLAYBACK_STATE, i_media_id, i_state, psz_value );
985 static inline int vlc_ml_media_get_all_playback_pref( vlc_medialibrary_t* p_ml,
986 int64_t i_media_id,
987 vlc_ml_playback_states_all* prefs )
989 return vlc_ml_control( p_ml,VLC_ML_MEDIA_GET_ALL_MEDIA_PLAYBACK_STATES, i_media_id, prefs );
992 static inline int vlc_ml_media_set_all_playback_states( vlc_medialibrary_t* p_ml,
993 int64_t i_media_id,
994 const vlc_ml_playback_states_all* prefs )
996 return vlc_ml_control( p_ml, VLC_ML_MEDIA_SET_ALL_MEDIA_PLAYBACK_STATES, i_media_id, prefs );
999 static inline int vlc_ml_media_set_thumbnail( vlc_medialibrary_t* p_ml, int64_t i_media_id,
1000 const char* psz_mrl, vlc_ml_thumbnail_size_t sizeType )
1002 return vlc_ml_control( p_ml, VLC_ML_MEDIA_SET_THUMBNAIL, i_media_id, psz_mrl, sizeType );
1005 static inline int vlc_ml_media_generate_thumbnail( vlc_medialibrary_t* p_ml, int64_t i_media_id,
1006 vlc_ml_thumbnail_size_t size_type,
1007 uint32_t i_desired_width,
1008 uint32_t i_desired_height,
1009 float position )
1011 return vlc_ml_control( p_ml, VLC_ML_MEDIA_GENERATE_THUMBNAIL, i_media_id,
1012 size_type, i_desired_width, i_desired_height, position );
1015 static inline int vlc_ml_media_add_external_mrl( vlc_medialibrary_t* p_ml, int64_t i_media_id,
1016 const char* psz_mrl, int i_type )
1018 return vlc_ml_control( p_ml, VLC_ML_MEDIA_ADD_EXTERNAL_MRL, i_media_id, psz_mrl, i_type );
1021 static inline int vlc_ml_media_set_type( vlc_medialibrary_t* p_ml, int64_t i_media_id,
1022 vlc_ml_media_type_t i_type )
1024 return vlc_ml_control( p_ml, VLC_ML_MEDIA_SET_TYPE, i_media_id, (int)i_type );
1027 static inline vlc_ml_bookmark_list_t*
1028 vlc_ml_list_media_bookmarks( vlc_medialibrary_t* p_ml, const vlc_ml_query_params_t* params,
1029 int64_t i_media_id )
1031 assert( p_ml != NULL );
1032 vlc_ml_bookmark_list_t* res;
1033 if ( vlc_ml_list( p_ml, VLC_ML_LIST_MEDIA_BOOKMARKS, params, i_media_id,
1034 &res ) != VLC_SUCCESS )
1035 return NULL;
1036 return res;
1039 static inline int
1040 vlc_ml_media_add_bookmark( vlc_medialibrary_t* p_ml, int64_t i_media_id, int64_t i_time )
1042 assert( p_ml != NULL );
1043 return vlc_ml_control( p_ml, VLC_ML_MEDIA_ADD_BOOKMARK, i_media_id, i_time );
1046 static inline int
1047 vlc_ml_media_remove_bookmark( vlc_medialibrary_t* p_ml, int64_t i_media_id, int64_t i_time )
1049 assert( p_ml != NULL );
1050 return vlc_ml_control( p_ml, VLC_ML_MEDIA_REMOVE_BOOKMARK, i_media_id, i_time );
1053 static inline int
1054 vlc_ml_media_update_bookmark( vlc_medialibrary_t* p_ml, int64_t i_media_id,
1055 int64_t i_time, const char* psz_name,
1056 const char* psz_desc )
1058 assert( p_ml != NULL );
1059 return vlc_ml_control( p_ml, VLC_ML_MEDIA_UPDATE_BOOKMARK, i_media_id,
1060 i_time, psz_name, psz_desc );
1063 static inline int
1064 vlc_ml_media_remove_all_bookmarks( vlc_medialibrary_t* p_ml, int64_t i_media_id )
1066 assert( p_ml != NULL );
1067 return vlc_ml_control( p_ml, VLC_ML_MEDIA_REMOVE_ALL_BOOKMARKS, i_media_id );
1070 static inline vlc_ml_playlist_t*
1071 vlc_ml_playlist_create( vlc_medialibrary_t * p_ml, const char * name)
1073 assert( p_ml != NULL );
1075 vlc_ml_playlist_t* result;
1077 if (vlc_ml_control( p_ml, VLC_ML_PLAYLIST_CREATE, name, &result ) != VLC_SUCCESS )
1078 return NULL;
1080 return result;
1083 static inline int
1084 vlc_ml_playlist_delete( vlc_medialibrary_t * p_ml, int64_t i_playlist_id )
1086 assert( p_ml != NULL );
1088 return vlc_ml_control( p_ml, VLC_ML_PLAYLIST_DELETE, i_playlist_id );
1091 static inline int
1092 vlc_ml_playlist_append( vlc_medialibrary_t * p_ml, int64_t i_playlist_id, int64_t i_media_id )
1094 assert( p_ml != NULL );
1096 return vlc_ml_control( p_ml, VLC_ML_PLAYLIST_APPEND, i_playlist_id, i_media_id );
1099 static inline int
1100 vlc_ml_playlist_insert( vlc_medialibrary_t * p_ml, int64_t i_playlist_id, int64_t i_media_id,
1101 uint32_t i_position )
1103 assert( p_ml != NULL );
1105 return vlc_ml_control( p_ml, VLC_ML_PLAYLIST_INSERT, i_playlist_id, i_media_id, i_position );
1108 static inline int
1109 vlc_ml_playlist_move( vlc_medialibrary_t * p_ml,
1110 int64_t i_playlist_id, uint32_t i_from, uint32_t i_to )
1112 assert( p_ml != NULL );
1114 return vlc_ml_control( p_ml, VLC_ML_PLAYLIST_MOVE, i_playlist_id, i_from, i_to );
1117 static inline int
1118 vlc_ml_playlist_remove( vlc_medialibrary_t * p_ml, int64_t i_playlist_id, uint32_t i_position )
1120 assert( p_ml != NULL );
1122 return vlc_ml_control( p_ml, VLC_ML_PLAYLIST_REMOVE, i_playlist_id, i_position );
1125 static inline vlc_ml_media_t* vlc_ml_get_media( vlc_medialibrary_t* p_ml, int64_t i_media_id )
1127 return (vlc_ml_media_t*)vlc_ml_get( p_ml, VLC_ML_GET_MEDIA, i_media_id );
1130 static inline vlc_ml_media_t* vlc_ml_get_media_by_mrl( vlc_medialibrary_t* p_ml,
1131 const char* psz_mrl )
1133 return (vlc_ml_media_t*)vlc_ml_get( p_ml, VLC_ML_GET_MEDIA_BY_MRL, psz_mrl );
1136 static inline input_item_t* vlc_ml_get_input_item( vlc_medialibrary_t* p_ml, int64_t i_media_id )
1138 return (input_item_t*)vlc_ml_get( p_ml, VLC_ML_GET_INPUT_ITEM, i_media_id );
1141 static inline input_item_t* vlc_ml_get_input_item_by_mrl( vlc_medialibrary_t* p_ml,
1142 const char* psz_mrl )
1144 return (input_item_t*)vlc_ml_get( p_ml, VLC_ML_GET_INPUT_ITEM_BY_MRL, psz_mrl );
1147 static inline vlc_ml_album_t* vlc_ml_get_album( vlc_medialibrary_t* p_ml, int64_t i_album_id )
1149 return (vlc_ml_album_t*)vlc_ml_get( p_ml, VLC_ML_GET_ALBUM, i_album_id );
1152 static inline vlc_ml_artist_t* vlc_ml_get_artist( vlc_medialibrary_t* p_ml, int64_t i_artist_id )
1154 return (vlc_ml_artist_t*)vlc_ml_get( p_ml, VLC_ML_GET_ARTIST, i_artist_id );
1157 static inline vlc_ml_genre_t* vlc_ml_get_genre( vlc_medialibrary_t* p_ml, int64_t i_genre_id )
1159 return (vlc_ml_genre_t*)vlc_ml_get( p_ml, VLC_ML_GET_GENRE, i_genre_id );
1162 static inline vlc_ml_show_t* vlc_ml_get_show( vlc_medialibrary_t* p_ml, int64_t i_show_id )
1164 return (vlc_ml_show_t*)vlc_ml_get( p_ml, VLC_ML_GET_SHOW, i_show_id );
1167 static inline vlc_ml_playlist_t* vlc_ml_get_playlist( vlc_medialibrary_t* p_ml, int64_t i_playlist_id )
1169 return (vlc_ml_playlist_t*)vlc_ml_get( p_ml, VLC_ML_GET_PLAYLIST, i_playlist_id );
1172 static inline vlc_ml_media_list_t* vlc_ml_list_media_of( vlc_medialibrary_t* p_ml, const vlc_ml_query_params_t* params, int i_parent_type, int64_t i_parent_id )
1174 vlc_assert( p_ml != NULL );
1175 vlc_ml_media_list_t* res;
1176 if ( vlc_ml_list( p_ml, VLC_ML_LIST_MEDIA_OF, params, i_parent_type, i_parent_id, &res ) != VLC_SUCCESS )
1177 return NULL;
1178 return res;
1181 static inline size_t vlc_ml_count_media_of( vlc_medialibrary_t* p_ml, const vlc_ml_query_params_t* params, int i_parent_type, int64_t i_parent_id )
1183 vlc_assert( p_ml != NULL );
1184 size_t res;
1185 if ( vlc_ml_list( p_ml, VLC_ML_COUNT_MEDIA_OF, params, i_parent_type, i_parent_id, &res ) != VLC_SUCCESS )
1186 return 0;
1187 return res;
1190 static inline vlc_ml_artist_list_t* vlc_ml_list_artist_of( vlc_medialibrary_t* p_ml, const vlc_ml_query_params_t* params, int i_parent_type, int64_t i_parent_id )
1192 vlc_assert( p_ml != NULL );
1193 vlc_ml_artist_list_t* res;
1194 if ( vlc_ml_list( p_ml, VLC_ML_LIST_ARTISTS_OF, params, i_parent_type, i_parent_id, &res ) != VLC_SUCCESS )
1195 return NULL;
1196 return res;
1199 static inline size_t vlc_ml_count_artists_of( vlc_medialibrary_t* p_ml, const vlc_ml_query_params_t* params, int i_parent_type, int64_t i_parent_id )
1201 vlc_assert( p_ml != NULL );
1202 size_t res;
1203 if ( vlc_ml_list( p_ml, VLC_ML_COUNT_ARTISTS_OF, params, i_parent_type, i_parent_id, &res ) != VLC_SUCCESS )
1204 return 0;
1205 return res;
1208 static inline vlc_ml_album_list_t* vlc_ml_list_albums_of( vlc_medialibrary_t* p_ml, const vlc_ml_query_params_t* params, int i_parent_type, int64_t i_parent_id )
1210 vlc_assert( p_ml != NULL );
1211 vlc_ml_album_list_t* res;
1212 if ( vlc_ml_list( p_ml, VLC_ML_LIST_ALBUMS_OF, params, i_parent_type, i_parent_id, &res ) != VLC_SUCCESS )
1213 return NULL;
1214 return res;
1217 static inline size_t vlc_ml_count_albums_of( vlc_medialibrary_t* p_ml, const vlc_ml_query_params_t* params, int i_parent_type, int64_t i_parent_id )
1219 vlc_assert( p_ml != NULL );
1220 size_t res;
1221 if ( vlc_ml_list( p_ml, VLC_ML_COUNT_ALBUMS_OF, params, i_parent_type, i_parent_id, &res ) != VLC_SUCCESS )
1222 return 0;
1223 return res;
1226 static inline vlc_ml_media_list_t* vlc_ml_list_album_tracks( vlc_medialibrary_t* p_ml, const vlc_ml_query_params_t* params, int64_t i_album_id )
1228 vlc_assert( p_ml != NULL );
1229 vlc_ml_media_list_t* res;
1230 if ( vlc_ml_list( p_ml, VLC_ML_LIST_ALBUM_TRACKS, params, i_album_id, &res ) != VLC_SUCCESS )
1231 return NULL;
1232 return res;
1235 static inline size_t vlc_ml_count_album_tracks( vlc_medialibrary_t* p_ml, const vlc_ml_query_params_t* params, int64_t i_album_id )
1237 vlc_assert( p_ml != NULL );
1238 size_t count;
1239 if ( vlc_ml_list( p_ml, VLC_ML_COUNT_ALBUM_TRACKS, params, i_album_id, &count ) != VLC_SUCCESS )
1240 return 0;
1241 return count;
1244 static inline vlc_ml_media_list_t* vlc_ml_list_album_artists( vlc_medialibrary_t* p_ml, const vlc_ml_query_params_t* params, int64_t i_album_id )
1246 vlc_assert( p_ml != NULL );
1247 vlc_ml_media_list_t* res;
1248 if ( vlc_ml_list( p_ml, VLC_ML_LIST_ALBUM_ARTISTS, params, i_album_id, &res ) != VLC_SUCCESS )
1249 return NULL;
1250 return res;
1253 static inline size_t vlc_ml_count_album_artists( vlc_medialibrary_t* p_ml, const vlc_ml_query_params_t* params, int64_t i_album_id )
1255 vlc_assert( p_ml != NULL );
1256 size_t count;
1257 if ( vlc_ml_list( p_ml, VLC_ML_COUNT_ALBUM_ARTISTS, params, i_album_id, &count ) != VLC_SUCCESS )
1258 return 0;
1259 return count;
1262 static inline vlc_ml_album_list_t* vlc_ml_list_artist_albums( vlc_medialibrary_t* p_ml, const vlc_ml_query_params_t* params, int64_t i_artist_id )
1264 vlc_assert( p_ml != NULL );
1265 vlc_ml_album_list_t* res;
1266 if ( vlc_ml_list( p_ml, VLC_ML_LIST_ARTIST_ALBUMS, params, i_artist_id, &res ) != VLC_SUCCESS )
1267 return NULL;
1268 return res;
1271 static inline size_t vlc_ml_count_artist_albums( vlc_medialibrary_t* p_ml, const vlc_ml_query_params_t* params, int64_t i_artist_id )
1273 vlc_assert( p_ml != NULL );
1274 size_t count;
1275 if ( vlc_ml_list( p_ml, VLC_ML_COUNT_ARTIST_ALBUMS, params, i_artist_id, &count ) != VLC_SUCCESS )
1276 return 0;
1277 return count;
1280 static inline vlc_ml_media_list_t* vlc_ml_list_artist_tracks( vlc_medialibrary_t* p_ml, const vlc_ml_query_params_t* params, int64_t i_artist_id )
1282 vlc_assert( p_ml != NULL );
1283 vlc_ml_media_list_t* res;
1284 if ( vlc_ml_list( p_ml, VLC_ML_LIST_ARTIST_TRACKS, params, i_artist_id, &res ) != VLC_SUCCESS )
1285 return NULL;
1286 return res;
1289 static inline size_t vlc_ml_count_artist_tracks( vlc_medialibrary_t* p_ml, const vlc_ml_query_params_t* params, int64_t i_artist_id )
1291 vlc_assert( p_ml != NULL );
1292 size_t count;
1293 if ( vlc_ml_list( p_ml, VLC_ML_COUNT_ARTIST_TRACKS, params, i_artist_id, &count ) != VLC_SUCCESS )
1294 return 0;
1295 return count;
1298 static inline vlc_ml_media_list_t* vlc_ml_list_video_media( vlc_medialibrary_t* p_ml, const vlc_ml_query_params_t* params )
1300 vlc_assert( p_ml != NULL );
1301 vlc_ml_media_list_t* res;
1302 if ( vlc_ml_list( p_ml, VLC_ML_LIST_VIDEOS, params, &res ) != VLC_SUCCESS )
1303 return NULL;
1304 return res;
1307 static inline size_t vlc_ml_count_video_media( vlc_medialibrary_t* p_ml, const vlc_ml_query_params_t* params )
1309 vlc_assert( p_ml != NULL );
1310 size_t count;
1311 if ( vlc_ml_list( p_ml, VLC_ML_COUNT_VIDEOS, params, &count ) != VLC_SUCCESS )
1312 return 0;
1313 return count;
1316 static inline vlc_ml_media_list_t* vlc_ml_list_audio_media( vlc_medialibrary_t* p_ml, const vlc_ml_query_params_t* params )
1318 vlc_assert( p_ml != NULL );
1319 vlc_ml_media_list_t* res;
1320 if ( vlc_ml_list( p_ml, VLC_ML_LIST_AUDIOS, params, &res ) != VLC_SUCCESS )
1321 return NULL;
1322 return res;
1325 static inline size_t vlc_ml_count_audio_media( vlc_medialibrary_t* p_ml, const vlc_ml_query_params_t* params )
1327 vlc_assert( p_ml != NULL );
1328 size_t count;
1329 if ( vlc_ml_list( p_ml, VLC_ML_COUNT_AUDIOS, params, &count ) != VLC_SUCCESS )
1330 return 0;
1331 return count;
1334 static inline vlc_ml_album_list_t* vlc_ml_list_albums( vlc_medialibrary_t* p_ml, const vlc_ml_query_params_t* params )
1336 vlc_assert( p_ml != NULL );
1337 vlc_ml_album_list_t* res;
1338 if ( vlc_ml_list( p_ml, VLC_ML_LIST_ALBUMS, params, &res ) != VLC_SUCCESS )
1339 return NULL;
1340 return res;
1343 static inline size_t vlc_ml_count_albums( vlc_medialibrary_t* p_ml, const vlc_ml_query_params_t* params )
1345 vlc_assert( p_ml != NULL );
1346 size_t count;
1347 if ( vlc_ml_list( p_ml, VLC_ML_COUNT_ALBUMS, params, &count ) != VLC_SUCCESS )
1348 return 0;
1349 return count;
1352 static inline vlc_ml_genre_list_t* vlc_ml_list_genres( vlc_medialibrary_t* p_ml, const vlc_ml_query_params_t* params )
1354 vlc_assert( p_ml != NULL );
1355 vlc_ml_genre_list_t* res;
1356 if ( vlc_ml_list( p_ml, VLC_ML_LIST_GENRES, params, &res ) != VLC_SUCCESS )
1357 return NULL;
1358 return res;
1361 static inline size_t vlc_ml_count_genres( vlc_medialibrary_t* p_ml, const vlc_ml_query_params_t* params )
1363 vlc_assert( p_ml != NULL );
1364 size_t count;
1365 if ( vlc_ml_list( p_ml, VLC_ML_COUNT_GENRES, params, &count ) != VLC_SUCCESS )
1366 return 0;
1367 return count;
1371 * @brief vlc_ml_list_artists
1372 * @param params Query parameters, or NULL for the default
1373 * @param b_include_all True if you wish to fetch artists without at least one album.
1374 * @return
1376 static inline vlc_ml_artist_list_t* vlc_ml_list_artists( vlc_medialibrary_t* p_ml, const vlc_ml_query_params_t* params, bool b_include_all )
1378 vlc_assert( p_ml != NULL );
1379 vlc_ml_artist_list_t* res;
1380 if ( vlc_ml_list( p_ml, VLC_ML_LIST_ARTISTS, params, (int)b_include_all, &res ) != VLC_SUCCESS )
1381 return NULL;
1382 return res;
1385 static inline size_t vlc_ml_count_artists( vlc_medialibrary_t* p_ml, const vlc_ml_query_params_t* params, bool includeAll )
1387 vlc_assert( p_ml != NULL );
1388 size_t count;
1389 if ( vlc_ml_list( p_ml, VLC_ML_COUNT_ARTISTS, params, includeAll, &count ) != VLC_SUCCESS )
1390 return 0;
1391 return count;
1394 static inline vlc_ml_show_list_t* vlc_ml_list_shows( vlc_medialibrary_t* p_ml, const vlc_ml_query_params_t* params )
1396 vlc_assert( p_ml != NULL );
1397 vlc_ml_show_list_t* res;
1398 if ( vlc_ml_list( p_ml, VLC_ML_LIST_SHOWS, params, &res ) != VLC_SUCCESS )
1399 return NULL;
1400 return res;
1403 static inline size_t vlc_ml_count_shows( vlc_medialibrary_t* p_ml, const vlc_ml_query_params_t* params )
1405 vlc_assert( p_ml != NULL );
1406 size_t count;
1407 if ( vlc_ml_list( p_ml, VLC_ML_COUNT_SHOWS, params, &count ) != VLC_SUCCESS )
1408 return 0;
1409 return count;
1412 static inline vlc_ml_artist_list_t* vlc_ml_list_genre_artists( vlc_medialibrary_t* p_ml, const vlc_ml_query_params_t* params, int64_t i_genre_id )
1414 vlc_assert( p_ml != NULL );
1415 vlc_ml_artist_list_t* res;
1416 if ( vlc_ml_list( p_ml, VLC_ML_LIST_GENRE_ARTISTS, params, i_genre_id, &res ) != VLC_SUCCESS )
1417 return NULL;
1418 return res;
1421 static inline size_t vlc_ml_count_genre_artists( vlc_medialibrary_t* p_ml, const vlc_ml_query_params_t* params, int64_t i_genre_id )
1423 vlc_assert( p_ml != NULL );
1424 size_t count;
1425 if ( vlc_ml_list( p_ml, VLC_ML_COUNT_GENRE_ARTISTS, params, i_genre_id, &count ) != VLC_SUCCESS )
1426 return 0;
1427 return count;
1430 static inline vlc_ml_media_list_t* vlc_ml_list_genre_tracks( vlc_medialibrary_t* p_ml, const vlc_ml_query_params_t* params, int64_t i_genre_id )
1432 vlc_assert( p_ml != NULL );
1433 vlc_ml_media_list_t* res;
1434 if ( vlc_ml_list( p_ml, VLC_ML_LIST_GENRE_TRACKS, params, i_genre_id, &res ) != VLC_SUCCESS )
1435 return NULL;
1436 return res;
1439 static inline size_t vlc_ml_count_genre_tracks( vlc_medialibrary_t* p_ml, const vlc_ml_query_params_t* params, int64_t i_genre_id )
1441 vlc_assert( p_ml != NULL );
1442 size_t count;
1443 if ( vlc_ml_list( p_ml, VLC_ML_COUNT_GENRE_TRACKS, params, i_genre_id, &count ) != VLC_SUCCESS )
1444 return 0;
1445 return count;
1448 static inline vlc_ml_album_list_t* vlc_ml_list_genre_albums( vlc_medialibrary_t* p_ml, const vlc_ml_query_params_t* params, int64_t i_genre_id )
1450 vlc_assert( p_ml != NULL );
1451 vlc_ml_album_list_t* res;
1452 if ( vlc_ml_list( p_ml, VLC_ML_LIST_GENRE_ALBUMS, params, i_genre_id, &res ) != VLC_SUCCESS )
1453 return NULL;
1454 return res;
1457 static inline size_t vlc_ml_count_genre_albums( vlc_medialibrary_t* p_ml, const vlc_ml_query_params_t* params, int64_t i_genre_id )
1459 vlc_assert( p_ml != NULL );
1460 size_t count;
1461 if ( vlc_ml_list( p_ml, VLC_ML_COUNT_GENRE_ALBUMS, params, i_genre_id, &count ) != VLC_SUCCESS )
1462 return 0;
1463 return count;
1466 static inline vlc_ml_media_list_t* vlc_ml_list_show_episodes( vlc_medialibrary_t* p_ml, const vlc_ml_query_params_t* params, int64_t i_show_id )
1468 vlc_assert( p_ml != NULL );
1469 vlc_ml_media_list_t* res;
1470 if ( vlc_ml_list( p_ml, VLC_ML_LIST_SHOW_EPISODES, params, i_show_id, &res ) != VLC_SUCCESS )
1471 return NULL;
1472 return res;
1475 static inline size_t vlc_ml_count_show_episodes( vlc_medialibrary_t* p_ml, const vlc_ml_query_params_t* params, int64_t i_show_id )
1477 vlc_assert( p_ml != NULL );
1478 size_t count;
1479 if ( vlc_ml_list( p_ml, VLC_ML_COUNT_GENRE_ALBUMS, params, i_show_id, &count ) != VLC_SUCCESS )
1480 return 0;
1481 return count;
1484 static inline vlc_ml_label_list_t* vlc_ml_list_media_labels( vlc_medialibrary_t* p_ml, const vlc_ml_query_params_t* params, int64_t i_media_id )
1486 vlc_assert( p_ml != NULL );
1487 vlc_ml_label_list_t* res;
1488 if ( vlc_ml_list( p_ml, VLC_ML_LIST_MEDIA_LABELS, params, i_media_id, &res ) != VLC_SUCCESS )
1489 return NULL;
1490 return res;
1493 static inline size_t vlc_ml_count_media_labels( vlc_medialibrary_t* p_ml, const vlc_ml_query_params_t* params, int64_t i_media_id )
1495 vlc_assert( p_ml != NULL );
1496 size_t count;
1497 if ( vlc_ml_list( p_ml, VLC_ML_LIST_MEDIA_LABELS, params, i_media_id, &count ) != VLC_SUCCESS )
1498 return 0;
1499 return count;
1502 static inline vlc_ml_media_list_t* vlc_ml_list_history( vlc_medialibrary_t* p_ml, const vlc_ml_query_params_t* params )
1504 vlc_assert( p_ml != NULL );
1505 vlc_ml_media_list_t* res;
1506 if ( vlc_ml_list( p_ml, VLC_ML_LIST_HISTORY, params, &res ) != VLC_SUCCESS )
1507 return NULL;
1508 return res;
1511 static inline size_t vlc_ml_count_history( vlc_medialibrary_t* p_ml, const vlc_ml_query_params_t* params )
1513 vlc_assert( p_ml != NULL );
1514 size_t count;
1515 if ( vlc_ml_list( p_ml, VLC_ML_COUNT_HISTORY, params, &count ) != VLC_SUCCESS )
1516 return 0;
1517 return count;
1521 static inline vlc_ml_media_list_t* vlc_ml_list_history_by_type( vlc_medialibrary_t* p_ml, const vlc_ml_query_params_t* params, vlc_ml_media_type_t type )
1523 vlc_assert( p_ml != NULL );
1524 vlc_ml_media_list_t* res;
1525 if ( vlc_ml_list( p_ml, VLC_ML_LIST_HISTORY_BY_TYPE, params, (int)type, &res ) != VLC_SUCCESS )
1526 return NULL;
1527 return res;
1530 static inline size_t vlc_ml_count_history_by_type( vlc_medialibrary_t* p_ml, const vlc_ml_query_params_t* params, vlc_ml_media_type_t type )
1532 vlc_assert( p_ml != NULL );
1533 size_t count;
1534 if ( vlc_ml_list( p_ml, VLC_ML_COUNT_HISTORY_BY_TYPE, params, (int)type, &count ) != VLC_SUCCESS )
1535 return 0;
1536 return count;
1541 static inline vlc_ml_media_list_t* vlc_ml_list_stream_history( vlc_medialibrary_t* p_ml, const vlc_ml_query_params_t* params )
1543 vlc_assert( p_ml != NULL );
1544 vlc_ml_media_list_t* res;
1545 if ( vlc_ml_list( p_ml, VLC_ML_LIST_STREAM_HISTORY, params, &res ) != VLC_SUCCESS )
1546 return NULL;
1547 return res;
1550 static inline size_t vlc_ml_count_stream_history( vlc_medialibrary_t* p_ml, const vlc_ml_query_params_t* params )
1552 vlc_assert( p_ml != NULL );
1553 size_t count;
1554 if ( vlc_ml_list( p_ml, VLC_ML_COUNT_STREAM_HISTORY, params, &count ) != VLC_SUCCESS )
1555 return 0;
1556 return count;
1559 static inline vlc_ml_playlist_list_t* vlc_ml_list_playlists( vlc_medialibrary_t* p_ml, const vlc_ml_query_params_t* params )
1561 vlc_assert( p_ml != NULL );
1562 vlc_ml_playlist_list_t* res;
1563 if ( vlc_ml_list( p_ml, VLC_ML_LIST_PLAYLISTS, params, &res ) != VLC_SUCCESS )
1564 return NULL;
1565 return res;
1568 static inline size_t vlc_ml_count_playlists( vlc_medialibrary_t* p_ml, const vlc_ml_query_params_t* params )
1570 vlc_assert( p_ml != NULL );
1571 size_t count;
1572 if ( vlc_ml_list( p_ml, VLC_ML_COUNT_PLAYLISTS, params, &count ) != VLC_SUCCESS )
1573 return 0;
1574 return count;
1577 static inline vlc_ml_media_list_t* vlc_ml_list_playlist_media( vlc_medialibrary_t* p_ml, const vlc_ml_query_params_t* params, int64_t i_playlist_id )
1579 vlc_assert( p_ml != NULL );
1580 vlc_ml_media_list_t* res;
1581 if ( vlc_ml_list( p_ml, VLC_ML_LIST_PLAYLIST_MEDIA, params, i_playlist_id, &res ) != VLC_SUCCESS )
1582 return NULL;
1583 return res;
1586 static inline size_t vlc_ml_count_playlist_media( vlc_medialibrary_t* p_ml, const vlc_ml_query_params_t* params, int64_t i_playlist_id )
1588 vlc_assert( p_ml != NULL );
1589 size_t count;
1590 if ( vlc_ml_list( p_ml, VLC_ML_COUNT_PLAYLIST_MEDIA, params, i_playlist_id, &count ) != VLC_SUCCESS )
1591 return 0;
1592 return count;
1595 #ifdef __cplusplus
1597 #endif /* C++ */
1599 #ifndef __cplusplus
1600 # define vlc_ml_release( OBJ ) _Generic( ( OBJ ), \
1601 vlc_ml_show_t*: vlc_ml_show_release, \
1602 vlc_ml_artist_t*: vlc_ml_artist_release, \
1603 vlc_ml_album_t*: vlc_ml_album_release, \
1604 vlc_ml_genre_t*: vlc_ml_genre_release, \
1605 vlc_ml_media_t*: vlc_ml_media_release, \
1606 vlc_ml_playlist_t*: vlc_ml_playlist_release, \
1607 vlc_ml_label_list_t*: vlc_ml_label_list_release, \
1608 vlc_ml_file_list_t*: vlc_ml_file_list_release, \
1609 vlc_ml_artist_list_t*: vlc_ml_artist_list_release, \
1610 vlc_ml_media_list_t*: vlc_ml_media_list_release, \
1611 vlc_ml_album_list_t*: vlc_ml_album_list_release, \
1612 vlc_ml_show_list_t*: vlc_ml_show_list_release, \
1613 vlc_ml_genre_list_t*: vlc_ml_genre_list_release, \
1614 vlc_ml_playlist_list_t*: vlc_ml_playlist_list_release, \
1615 vlc_ml_entry_point_list_t*: vlc_ml_entry_point_list_release, \
1616 vlc_ml_playback_states_all*: vlc_ml_playback_states_all_release, \
1617 vlc_ml_bookmark_t*: vlc_ml_bookmark_release, \
1618 vlc_ml_bookmark_list_t*: vlc_ml_bookmark_list_release \
1619 )( OBJ )
1620 #else
1621 static inline void vlc_ml_release( vlc_ml_show_t* show ) { vlc_ml_show_release( show ); }
1622 static inline void vlc_ml_release( vlc_ml_artist_t* artist ) { vlc_ml_artist_release( artist ); }
1623 static inline void vlc_ml_release( vlc_ml_album_t* album ) { vlc_ml_album_release( album ); }
1624 static inline void vlc_ml_release( vlc_ml_genre_t* genre ) { vlc_ml_genre_release( genre ); }
1625 static inline void vlc_ml_release( vlc_ml_media_t* media ) { vlc_ml_media_release( media ); }
1626 static inline void vlc_ml_release( vlc_ml_playlist_t* playlist ) { vlc_ml_playlist_release( playlist ); }
1627 static inline void vlc_ml_release( vlc_ml_label_list_t* list ) { vlc_ml_label_list_release( list ); }
1628 static inline void vlc_ml_release( vlc_ml_file_list_t* list ) { vlc_ml_file_list_release( list ); }
1629 static inline void vlc_ml_release( vlc_ml_artist_list_t* list ) { vlc_ml_artist_list_release( list ); }
1630 static inline void vlc_ml_release( vlc_ml_media_list_t* list ) { vlc_ml_media_list_release( list ); }
1631 static inline void vlc_ml_release( vlc_ml_album_list_t* list ) { vlc_ml_album_list_release( list ); }
1632 static inline void vlc_ml_release( vlc_ml_show_list_t* list ) { vlc_ml_show_list_release( list ); }
1633 static inline void vlc_ml_release( vlc_ml_genre_list_t* list ) { vlc_ml_genre_list_release( list ); }
1634 static inline void vlc_ml_release( vlc_ml_playlist_list_t* list ) { vlc_ml_playlist_list_release( list ); }
1635 static inline void vlc_ml_release( vlc_ml_entry_point_list_t* list ) { vlc_ml_entry_point_list_release( list ); }
1636 static inline void vlc_ml_release( vlc_ml_playback_states_all* prefs ) { vlc_ml_playback_states_all_release( prefs ); }
1637 static inline void vlc_ml_release( vlc_ml_bookmark_t* bookmark ) { vlc_ml_bookmark_release( bookmark ); }
1638 static inline void vlc_ml_release( vlc_ml_bookmark_list_t* list ) { vlc_ml_bookmark_list_release( list ); }
1639 #endif
1641 #endif /* VLC_MEDIA_LIBRARY_H */