]> git.sesse.net Git - vlc/blob - include/vlc/libvlc_media_list_view.h
de48d35c913083f7f5dbb3bd04f2b52a7a7a542c
[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: represents a media_list using a different layout.
42  * The layout can be a flat one without hierarchy, a hierarchical one.
43  *
44  * Other type of layout, such as orderer media_list layout could be implemented
45  * with this class.
46  * @{ */
47
48 /**
49  * Retain reference to a media list view
50  *
51  * \param p_mlv a media list view created with libvlc_media_list_view_new()
52  */
53 VLC_PUBLIC_API void
54     libvlc_media_list_view_retain( libvlc_media_list_view_t * p_mlv );
55
56 /**
57  * Release reference to a media list view. If the refcount reaches 0, then
58  * the object will be released.
59  *
60  * \param p_mlv a media list view created with libvlc_media_list_view_new()
61  */
62 VLC_PUBLIC_API void
63     libvlc_media_list_view_release( libvlc_media_list_view_t * p_mlv );
64
65 /**
66  * Get libvlc_event_manager from this media list view instance.
67  * The p_event_manager is immutable, so you don't have to hold the lock
68  *
69  * \param p_mlv a media list view instance
70  * \return libvlc_event_manager
71  */
72 VLC_PUBLIC_API libvlc_event_manager_t *
73     libvlc_media_list_view_event_manager( libvlc_media_list_view_t * p_mlv );
74
75 /**
76  * Get count on media list view items
77  *
78  * \param p_mlv a media list view instance
79  * \param p_e initialized exception object
80  * \return number of items in media list view
81  */
82 VLC_PUBLIC_API int
83     libvlc_media_list_view_count(  libvlc_media_list_view_t * p_mlv,
84                                    libvlc_exception_t * p_e );
85
86 /**
87  * List media instance in media list view at an index position
88  *
89  * \param p_mlv a media list view instance
90  * \param i_index index position in array where to insert
91  * \param p_e initialized exception object
92  * \return media instance at position i_pos and libvlc_media_retain() has been called to increase the refcount on this object.
93  */
94 VLC_PUBLIC_API libvlc_media_t *
95     libvlc_media_list_view_item_at_index(  libvlc_media_list_view_t * p_mlv,
96                                            int i_index,
97                                            libvlc_exception_t * p_e );
98
99 VLC_PUBLIC_API libvlc_media_list_view_t *
100     libvlc_media_list_view_children_at_index(  libvlc_media_list_view_t * p_mlv,
101                                            int index,
102                                            libvlc_exception_t * p_e );
103
104 VLC_PUBLIC_API libvlc_media_list_view_t *
105     libvlc_media_list_view_children_for_item(  libvlc_media_list_view_t * p_mlv,
106                                            libvlc_media_t * p_md,
107                                            libvlc_exception_t * p_e );
108
109 VLC_PUBLIC_API libvlc_media_list_t *
110     libvlc_media_list_view_parent_media_list(  libvlc_media_list_view_t * p_mlv,
111                                                libvlc_exception_t * p_e );
112
113 /** @} media_list_view */
114
115 # ifdef __cplusplus
116 }
117 # endif
118
119 #endif /* LIBVLC_MEDIA_LIST_VIEW_H */