Mlt.h, MltFactory.{h,cpp}, MltRepository.{h,cpp}, swig/mltpp.i: update to deal with...
[melted] / mlt++ / src / MltRepository.cpp
1 /**
2 * MltRepository.cpp - MLT Wrapper
3 * Copyright (C) 2008 Dan Dennedy <dan@dennedy.org>
4 *
5 * This program is free software; you can redistribute it and/or modify
6 * it under the terms of the GNU Lesser General Public License as published
7 * by the Free Software Foundation; either version 2 of the License, or
8 * (at your option) any later version.
9 *
10 * This program 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
13 * GNU General Public License for more details.
14 *
15 * You should have received a copy of the GNU General Public License
16 * along with this program; if not, write to the Free Software Foundation,
17 * Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
18 */
19
20 #include "MltRepository.h"
21 #include "MltProfile.h"
22 using namespace Mlt;
23
24 Repository::Repository( const char* directory ) :
25 instance( NULL )
26 {
27 instance = mlt_repository_init( directory );
28 }
29
30 Repository::Repository( mlt_repository repository ) :
31 instance( repository )
32 {
33 }
34
35 Repository::~Repository( )
36 {
37 if ( instance )
38 mlt_repository_close( instance );
39 instance = NULL;
40 }
41
42 void Repository::register_service( mlt_service_type service_type, const char *service, void *symbol )
43 {
44 mlt_repository_register( instance, service_type, service, symbol );
45 }
46
47 void *Repository::create( Profile& profile, mlt_service_type type, const char *service, void *arg )
48 {
49 return mlt_repository_create( instance, profile.get_profile(), type, service, arg );
50 }