MltProfile.o \
MltProperties.o \
MltPushConsumer.o \
+ MltRepository.o \
MltResponse.o \
MltService.o \
MltTokeniser.o \
#include "MltProfile.h"
#include "MltProperties.h"
#include "MltPushConsumer.h"
+#include "MltRepository.h"
#ifndef WIN32
#include "MltResponse.h"
#endif
#include "MltFilter.h"
#include "MltTransition.h"
#include "MltConsumer.h"
+#include "MltRepository.h"
using namespace Mlt;
-int Factory::init( char *arg )
+Repository *Factory::init( const char *directory )
{
- return mlt_factory_init( arg );
+ return new Repository( mlt_factory_init( directory ) );
}
Properties *Factory::event_object( )
/**
* MltFactory.h - MLT Wrapper
* Copyright (C) 2004-2005 Charles Yates
+ * Copyright (C) 2008 Dan Dennedy <dan@dennedy.org>
* Author: Charles Yates <charles.yates@pandora.be>
*
* This program is free software; you can redistribute it and/or modify
class Transition;
class Consumer;
class Profile;
+ class Repository;
class MLTPP_DECLSPEC Factory
{
public:
- static int init( char *arg = NULL );
+ static Repository *init( const char *directory = NULL );
static Properties *event_object( );
static Producer *producer( Profile& profile, char *id, char *arg = NULL );
static Filter *filter( Profile& profile, char *id, char *arg = NULL );
--- /dev/null
+/**
+ * MltRepository.cpp - MLT Wrapper
+ * Copyright (C) 2008 Dan Dennedy <dan@dennedy.org>
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License as published
+ * by the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software Foundation,
+ * Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+ */
+
+#include "MltRepository.h"
+#include "MltProfile.h"
+using namespace Mlt;
+
+Repository::Repository( const char* directory ) :
+ instance( NULL )
+{
+ instance = mlt_repository_init( directory );
+}
+
+Repository::Repository( mlt_repository repository ) :
+ instance( repository )
+{
+}
+
+Repository::~Repository( )
+{
+ if ( instance )
+ mlt_repository_close( instance );
+ instance = NULL;
+}
+
+void Repository::register_service( mlt_service_type service_type, const char *service, void *symbol )
+{
+ mlt_repository_register( instance, service_type, service, symbol );
+}
+
+void *Repository::create( Profile& profile, mlt_service_type type, const char *service, void *arg )
+{
+ return mlt_repository_create( instance, profile.get_profile(), type, service, arg );
+}
--- /dev/null
+/**
+ * MltRepository.h - MLT Wrapper
+ * Copyright (C) 2008 Dan Dennedy <dan@dennedy.org>
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License as published
+ * by the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software Foundation,
+ * Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+ */
+
+#ifndef _MLTPP_REPOSITORY_H_
+#define _MLTPP_REPOSITORY_H_
+
+#include "config.h"
+
+#ifdef SWIG
+#define MLTPP_DECLSPEC
+#endif
+
+#include <framework/mlt.h>
+
+namespace Mlt
+{
+ class Profile;
+
+ class MLTPP_DECLSPEC Repository
+ {
+ private:
+ mlt_repository instance;
+ Repository( ) { }
+ public:
+ Repository( const char* directory );
+ Repository( mlt_repository repository );
+ ~Repository();
+
+ void register_service( mlt_service_type service_type, const char *service, void *symbol );
+ void *create( Profile& profile, mlt_service_type type, const char *service, void *arg );
+ };
+}
+
+#endif
*/
namespace Mlt {
+%newobject Factory::init( const char * );
%newobject Factory::producer( Profile &, char *, char * );
%newobject Factory::filter( Profile &, char *, char * );
%newobject Factory::transition( Profile &, char *, char * );
%include <framework/mlt_types.h>
%include <framework/mlt_factory.h>
%include <MltFactory.h>
+%include <MltRepository.h>
%include <MltEvent.h>
%include <MltProperties.h>
%include <MltFrame.h>