]> git.sesse.net Git - vlc/blob - src/control/tag_query.c
Libvlc: Start the implementation of the libvlc playlist. Still in progress.
[vlc] / src / control / tag_query.c
1 /*****************************************************************************
2  * tag_query.c: libvlc new API media tag query functions
3  *****************************************************************************
4  * Copyright (C) 2007 the VideoLAN team
5  * $Id$
6  *
7  * Authors: Pierre d'Herbemont <pdherbemont # videolan.org>
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 #include "libvlc_internal.h"
24 #include <vlc/libvlc.h>
25 #include "vlc_arrays.h"
26
27 /* XXX This API is in construction
28  * 
29  * It's goal is to represent a meta tag query
30  * It should be also able to say if a query can be matched in a media
31  * descriptor through libvlc_query_match.
32  */
33  
34 /*
35  * Public libvlc functions
36  */
37
38 /**************************************************************************
39  *       libvlc_tag_query_new (Public)
40  *
41  * Init an object.
42  **************************************************************************/
43 libvlc_tag_query_t *
44 libvlc_tag_query_new( libvlc_instance_t * p_inst,
45                       libvlc_exception_t * p_e )
46 {
47         (void)p_e;
48     libvlc_tag_query_t * p_q;
49
50         p_q = malloc(sizeof(libvlc_tag_query_t));
51
52         if( !p_q )
53                 return NULL;
54         
55         p_q->p_libvlc_instance = p_inst;
56     p_q->i_refcount = 1;
57
58         return p_q;
59 }
60
61 /**************************************************************************
62  *       libvlc_media_list_release (Public)
63  *
64  * Release an object.
65  **************************************************************************/
66 void libvlc_tag_query_release( libvlc_tag_query_t * p_q )
67 {
68     p_q->i_refcount--;
69
70     if( p_q->i_refcount > 0 )
71         return;
72
73         free( p_q );
74 }
75
76 /**************************************************************************
77  *       libvlc_media_list_retain (Public)
78  *
79  * Release an object.
80  **************************************************************************/
81 void libvlc_tag_query_retain( libvlc_tag_query_t * p_q )
82 {
83         p_q->i_refcount++;
84 }
85
86
87 /**************************************************************************
88  *       libvlc_query_match (Public)
89  *
90  * Return true if the query p_q is matched in p_md
91  **************************************************************************/
92 vlc_bool_t
93 libvlc_tag_query_match( libvlc_tag_query_t * p_q,
94                         libvlc_media_descriptor_t * p_md,
95                         libvlc_exception_t * p_e )
96 {
97         (void)p_q;
98         (void)p_md;
99         (void)p_e;
100     
101     /* In construction... */
102     return 1;
103 }