1 /**
2  * MltRepository.cpp - MLT Wrapper
3  * Copyright (C) 2008-2017 Meltytech, LLC
4  *
5  * This library is free software; you can redistribute it and/or
6  * modify it under the terms of the GNU Lesser General Public
7  * License as published by the Free Software Foundation; either
8  * version 2.1 of the License, or (at your option) any later version.
9  *
10  * This library is distributed in the hope that it will be useful,
11  * but WITHOUT ANY WARRANTY; without even the implied warranty of
12  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
13  * Lesser General Public License for more details.
14  *
15  * You should have received a copy of the GNU Lesser General Public
16  * License along with this library; if not, write to the Free Software
17  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA
18  */
19 
20 #include "MltRepository.h"
21 #include "MltProfile.h"
22 #include "MltProperties.h"
23 using namespace Mlt;
24 
Repository(const char * directory)25 Repository::Repository( const char* directory ) :
26 	instance( NULL )
27 {
28 	instance = mlt_repository_init( directory );
29 }
30 
Repository(mlt_repository repository)31 Repository::Repository( mlt_repository repository ) :
32 	instance( repository )
33 {
34 }
35 
~Repository()36 Repository::~Repository( )
37 {
38 	instance = NULL;
39 }
40 
register_service(mlt_service_type service_type,const char * service,mlt_register_callback symbol)41 void Repository::register_service( mlt_service_type service_type, const char *service, mlt_register_callback symbol )
42 {
43 	mlt_repository_register( instance, service_type, service, symbol );
44 }
45 
create(Profile & profile,mlt_service_type type,const char * service,void * arg)46 void *Repository::create( Profile& profile, mlt_service_type type, const char *service, void *arg )
47 {
48 	return mlt_repository_create( instance, profile.get_profile(), type, service, arg );
49 }
50 
consumers() const51 Properties *Repository::consumers( ) const
52 {
53 	return new Properties( mlt_repository_consumers( instance ) );
54 }
55 
filters() const56 Properties *Repository::filters( ) const
57 {
58 	return new Properties( mlt_repository_filters( instance ) );
59 }
60 
links() const61 Properties *Repository::links( ) const
62 {
63 	return new Properties( mlt_repository_links( instance ) );
64 }
65 
producers() const66 Properties *Repository::producers( ) const
67 {
68 	return new Properties( mlt_repository_producers( instance ) );
69 }
70 
transitions() const71 Properties *Repository::transitions( ) const
72 {
73 	return new Properties( mlt_repository_transitions( instance ) );
74 }
75 
register_metadata(mlt_service_type type,const char * service,mlt_metadata_callback callback,void * callback_data)76 void Repository::register_metadata( mlt_service_type type, const char *service, mlt_metadata_callback callback, void *callback_data )
77 {
78 	mlt_repository_register_metadata( instance, type, service, callback, callback_data );
79 }
80 
metadata(mlt_service_type type,const char * service) const81 Properties *Repository::metadata( mlt_service_type type, const char *service ) const
82 {
83 	return new Properties( mlt_repository_metadata( instance, type, service ) );
84 }
85 
languages() const86 Properties *Repository::languages( ) const
87 {
88 	return new Properties( mlt_repository_languages( instance ) );
89 }
90 
presets()91 Properties *Repository::presets( )
92 {
93 	return new Properties( mlt_repository_presets( ) );
94 }
95