Constness changes
[melted] / src / framework / mlt_repository.h
1 /**
2 * \file mlt_repository.h
3 * \brief provides a map between service and shared objects
4 * \see mlt_repository_s
5 *
6 * Copyright (C) 2003-2009 Ushodaya Enterprises Limited
7 * \author Charles Yates <charles.yates@pandora.be>
8 * \author Dan Dennedy <dan@dennedy.org>
9 *
10 * This library is free software; you can redistribute it and/or
11 * modify it under the terms of the GNU Lesser General Public
12 * License as published by the Free Software Foundation; either
13 * version 2.1 of the License, or (at your option) any later version.
14 *
15 * This library is distributed in the hope that it will be useful,
16 * but WITHOUT ANY WARRANTY; without even the implied warranty of
17 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
18 * Lesser General Public License for more details.
19 *
20 * You should have received a copy of the GNU Lesser General Public
21 * License along with this library; if not, write to the Free Software
22 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
23 */
24
25 #ifndef _MLT_REPOSITORY_H_
26 #define _MLT_REPOSITORY_H_
27
28 #include "mlt_types.h"
29 #include "mlt_profile.h"
30
31 /** This callback is the main entry point into a module, which must be exported
32 * with the symbol "mlt_register".
33 *
34 * Inside the callback, the module registers the additional callbacks below.
35 */
36
37 typedef void ( *mlt_repository_callback )( mlt_repository );
38
39 /** The callback function that modules implement to construct a service.
40 */
41
42 typedef void *( *mlt_register_callback )( mlt_profile, mlt_service_type, const char * /* service name */, const void * /* arg */ );
43
44 /** The callback function that modules implement to supply metadata as a properties list.
45 */
46
47 typedef mlt_properties ( *mlt_metadata_callback )( mlt_service_type, const char * /* service name */, void * /* callback_data */ );
48
49 /** A convenience macro to create an entry point for service registration. */
50 #define MLT_REPOSITORY void mlt_register( mlt_repository repository )
51
52 /** A convenience macro to a register service in a more declarative manner. */
53 #define MLT_REGISTER( type, service, symbol ) ( mlt_repository_register( repository, (type), (service), ( mlt_register_callback )(symbol) ) )
54
55 /** A convenience macro to a register metadata in a more declarative manner. */
56 #define MLT_REGISTER_METADATA( type, service, callback, data ) ( mlt_repository_register_metadata( repository, (type), (service), ( mlt_metadata_callback )(callback), (data) ) )
57
58 extern mlt_repository mlt_repository_init( const char *directory );
59 extern void mlt_repository_register( mlt_repository self, mlt_service_type service_type, const char *service, mlt_register_callback );
60 extern void *mlt_repository_create( mlt_repository self, mlt_profile profile, mlt_service_type type, const char *service, const void *arg );
61 extern void mlt_repository_close( mlt_repository self );
62 extern mlt_properties mlt_repository_consumers( mlt_repository self );
63 extern mlt_properties mlt_repository_filters( mlt_repository self );
64 extern mlt_properties mlt_repository_producers( mlt_repository self );
65 extern mlt_properties mlt_repository_transitions( mlt_repository self );
66 extern void mlt_repository_register_metadata( mlt_repository self, mlt_service_type type, const char *service, mlt_metadata_callback, void *callback_data );
67 extern mlt_properties mlt_repository_metadata( mlt_repository self, mlt_service_type type, const char *service );
68 extern mlt_properties mlt_repository_languages( mlt_repository self );
69
70 #endif
71