TARGET = libmlt++.so
OBJS = MltConsumer.o \
+ MltDeque.o \
MltEvent.o \
MltFactory.o \
MltField.o \
#define _MLTPP_H_
#include "MltConsumer.h"
+#include "MltDeque.h"
#include "MltEvent.h"
#include "MltFactory.h"
#include "MltField.h"
--- /dev/null
+/**
+ * MltDeque.cpp - MLT Wrapper
+ * Copyright (C) 2004-2005 Charles Yates
+ * Author: Charles Yates <charles.yates@pandora.be>
+ *
+ * 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 "MltDeque.h"
+using namespace Mlt;
+
+Deque::Deque( )
+{
+ deque = mlt_deque_init( );
+}
+
+Deque::~Deque( )
+{
+ mlt_deque_close( deque );
+}
+
+int Deque::count( )
+{
+ return mlt_deque_count( deque );
+}
+
+int Deque::push_back( void *item )
+{
+ return mlt_deque_push_back( deque, item );
+}
+
+void *Deque::pop_back( )
+{
+ return mlt_deque_pop_back( deque );
+}
+
+int Deque::push_front( void *item )
+{
+ return mlt_deque_push_front( deque, item );
+}
+
+void *Deque::pop_front( )
+{
+ return mlt_deque_pop_front( deque );
+}
+
+void *Deque::peek_back( )
+{
+ return mlt_deque_peek_back( deque );
+}
+
+void *Deque::peek_front( )
+{
+ return mlt_deque_peek_front( deque );
+}
+
--- /dev/null
+/**
+ * MltDeque.h - MLT Wrapper
+ * Copyright (C) 2004-2005 Charles Yates
+ * Author: Charles Yates <charles.yates@pandora.be>
+ *
+ * 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_DEQUE_H
+#define _MLTPP_DEQUE_H
+
+#include <framework/mlt.h>
+
+namespace Mlt
+{
+ class Deque
+ {
+ private:
+ mlt_deque deque;
+ public:
+ Deque( );
+ ~Deque( );
+ int count( );
+ int push_back( void *item );
+ void *pop_back( );
+ int push_front( void *item );
+ void *pop_front( );
+ void *peek_back( );
+ void *peek_front( );
+ };
+}
+
+#endif
return mlt_factory_init( arg );
}
+Properties *Factory::event_object( )
+{
+ return new Properties( mlt_factory_event_object( ) );
+}
+
Producer *Factory::producer( char *id, char *arg )
{
return new Producer( id, arg );
namespace Mlt
{
+ class Properties;
class Producer;
class Filter;
class Transition;
{
public:
static int init( char *arg = NULL );
+ static Properties *event_object( );
static Producer *producer( char *id, char *arg = NULL );
static Filter *filter( char *id, char *arg = NULL );
static Transition *transition( char *id, char *arg = NULL );
using namespace Mlt;
Producer::Producer( ) :
- instance( NULL )
+ instance( NULL ),
+ parent_( NULL )
{
}
Producer::Producer( char *id, char *service ) :
- instance( NULL )
+ instance( NULL ),
+ parent_( NULL )
{
if ( id != NULL && service != NULL )
instance = mlt_factory_producer( id, service );
}
Producer::Producer( Service &producer ) :
- instance( NULL )
+ instance( NULL ),
+ parent_( NULL )
{
mlt_service_type type = producer.type( );
if ( type == producer_type || type == playlist_type ||
}
Producer::Producer( mlt_producer producer ) :
- instance( producer )
+ instance( producer ),
+ parent_( NULL )
{
inc_ref( );
}
Producer::Producer( Producer &producer ) :
- instance( producer.get_producer( ) )
+ instance( producer.get_producer( ) ),
+ parent_( NULL )
{
inc_ref( );
}
Producer::Producer( Producer *producer ) :
- instance( producer != NULL ? producer->get_producer( ) : NULL )
+ instance( producer != NULL ? producer->get_producer( ) : NULL ),
+ parent_( NULL )
{
if ( is_valid( ) )
inc_ref( );
Producer::~Producer( )
{
+ delete parent_;
mlt_producer_close( instance );
instance = NULL;
}
return get_producer( ) != NULL && mlt_producer_cut_parent( get_producer( ) ) != NULL ? mlt_producer_cut_parent( get_producer( ) ) : get_producer( );
}
+Producer &Producer::parent( )
+{
+ if ( is_cut( ) && parent_ == NULL )
+ parent_ = new Producer( get_parent( ) );
+ return parent_ == NULL ? *this : *parent_;
+}
+
mlt_service Producer::get_service( )
{
return mlt_producer_service( get_producer( ) );
{
private:
mlt_producer instance;
+ Producer *parent_;
public:
Producer( );
Producer( char *id, char *service = NULL );
Producer( Producer *producer );
virtual ~Producer( );
virtual mlt_producer get_producer( );
+ Producer &parent( );
mlt_producer get_parent( );
mlt_service get_service( );
int seek( int position );
return mlt_transition_service( get_transition( ) );
}
+void Transition::set_in_and_out( int in, int out )
+{
+ mlt_transition_set_in_and_out( get_transition( ), in, out );
+}
virtual ~Transition( );
virtual mlt_transition get_transition( );
mlt_service get_service( );
+ void set_in_and_out( int in, int out );
};
}