]> git.sesse.net Git - vlc/blob - include/vlc/libvlc_media_list_view.h
libvlc: Split public headers by object and layers.
[vlc] / include / vlc / libvlc_media_list_view.h
1 /*****************************************************************************
2  * libvlc_media_list.h:  libvlc_media_list API
3  *****************************************************************************
4  * Copyright (C) 1998-2008 the VideoLAN team
5  * $Id$
6  *
7  * Authors: Pierre d'Herbemont
8  *
9  * This program is free software; you can redistribute it and/or modify
10  * it under the terms of the GNU General Public License as published by
11  * the Free Software Foundation; either version 2 of the License, or
12  * (at your option) any later version.
13  *
14  * This program is distributed in the hope that it will be useful,
15  * but WITHOUT ANY WARRANTY; without even the implied warranty of
16  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
17  * GNU General Public License for more details.
18  *
19  * You should have received a copy of the GNU General Public License
20  * along with this program; if not, write to the Free Software
21  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301, USA.
22  *****************************************************************************/
23
24 #ifndef LIBVLC_MEDIA_LIST_VIEW_H
25 #define LIBVLC_MEDIA_LIST_VIEW_H 1
26
27 /**
28  * \file
29  * This file defines libvlc_media_list API
30  */
31
32 # ifdef __cplusplus
33 extern "C" {
34 # endif
35
36 /*****************************************************************************
37  * Media List View
38  *****************************************************************************/
39 /** \defgroup libvlc_media_list_view libvlc_media_list_view
40  * \ingroup libvlc
41  * LibVLC Media List View, represent a media_list using a different layout
42  * @{ */
43
44 /**
45  * Retain reference to a media list view
46  *
47  * \param p_mlv a media list view created with libvlc_media_list_view_new()
48  */
49 VLC_PUBLIC_API void
50     libvlc_media_list_view_retain( libvlc_media_list_view_t * p_mlv );
51
52 /**
53  * Release reference to a media list view. If the refcount reaches 0, then
54  * the object will be released.
55  *
56  * \param p_mlv a media list view created with libvlc_media_list_view_new()
57  */
58 VLC_PUBLIC_API void
59     libvlc_media_list_view_release( libvlc_media_list_view_t * p_mlv );
60
61 /**
62  * Get libvlc_event_manager from this media list view instance.
63  * The p_event_manager is immutable, so you don't have to hold the lock
64  *
65  * \param p_mlv a media list view instance
66  * \return libvlc_event_manager
67  */
68 VLC_PUBLIC_API libvlc_event_manager_t *
69     libvlc_media_list_view_event_manager( libvlc_media_list_view_t * p_mlv );
70
71 /**
72  * Get count on media list view items
73  *
74  * \param p_mlv a media list view instance
75  * \param p_e initialized exception object
76  * \return number of items in media list view
77  */
78 VLC_PUBLIC_API int
79     libvlc_media_list_view_count(  libvlc_media_list_view_t * p_mlv,
80                                    libvlc_exception_t * p_e );
81
82 /**
83  * List media instance in media list view at an index position
84  *
85  * \param p_mlv a media list view instance
86  * \param i_index index position in array where to insert
87  * \param p_e initialized exception object
88  * \return media instance at position i_pos and libvlc_media_retain() has been called to increase the refcount on this object.
89  */
90 VLC_PUBLIC_API libvlc_media_t *
91     libvlc_media_list_view_item_at_index(  libvlc_media_list_view_t * p_mlv,
92                                            int i_index,
93                                            libvlc_exception_t * p_e );
94
95 VLC_PUBLIC_API libvlc_media_list_view_t *
96     libvlc_media_list_view_children_at_index(  libvlc_media_list_view_t * p_mlv,
97                                            int index,
98                                            libvlc_exception_t * p_e );
99
100 VLC_PUBLIC_API libvlc_media_list_view_t *
101     libvlc_media_list_view_children_for_item(  libvlc_media_list_view_t * p_mlv,
102                                            libvlc_media_t * p_md,
103                                            libvlc_exception_t * p_e );
104
105 /**
106  * Get index position of media instance in media list view.
107  * The function will return the first occurence.
108  *
109  * \param p_mlv a media list view instance
110  * \param p_md media instance
111  * \param p_e initialized exception object
112  * \return index position in array of p_md
113  */
114 VLC_PUBLIC_API int
115     libvlc_media_list_view_index_of_item(  libvlc_media_list_view_t * p_mlv,
116                                            libvlc_media_t * p_md,
117                                            libvlc_exception_t * p_e );
118
119 /**
120  * Insert media instance in media list view at index position
121  *
122  * \param p_mlv a media list view instance
123  * \param p_md media instance
124  * \param index position in array where to insert
125  * \param p_e initialized exception object
126  */
127 VLC_PUBLIC_API void
128     libvlc_media_list_view_insert_at_index(  libvlc_media_list_view_t * p_mlv,
129                                              libvlc_media_t * p_md,
130                                              int index,
131                                              libvlc_exception_t * p_e );
132
133 /**
134  * Remove media instance in media list view from index position
135  *
136  * \param p_mlv a media list view instance
137  * \param index position in array of media instance to remove
138  * \param p_e initialized exception object
139  */
140 VLC_PUBLIC_API void
141     libvlc_media_list_view_remove_at_index(  libvlc_media_list_view_t * p_mlv,
142                                              int index,
143                                              libvlc_exception_t * p_e );
144
145 VLC_PUBLIC_API void
146     libvlc_media_list_view_add_item(  libvlc_media_list_view_t * p_mlv,
147                                       libvlc_media_t * p_md,
148                                       libvlc_exception_t * p_e );
149
150 VLC_PUBLIC_API libvlc_media_list_t *
151     libvlc_media_list_view_parent_media_list(  libvlc_media_list_view_t * p_mlv,
152                                                libvlc_exception_t * p_e );
153
154 /** @} media_list_view */
155
156 # ifdef __cplusplus
157 }
158 # endif
159
160 #endif /* LIBVLC_MEDIA_LIST_VIEW_H */