Multitrack classes added
authorlilo_booter <lilo_booter@d19143bc-622f-0410-bfdd-b5b2a6649095>
Sat, 28 Aug 2004 14:30:45 +0000 (14:30 +0000)
committerlilo_booter <lilo_booter@d19143bc-622f-0410-bfdd-b5b2a6649095>
Sat, 28 Aug 2004 14:30:45 +0000 (14:30 +0000)
git-svn-id: https://mlt.svn.sourceforge.net/svnroot/mlt/trunk/mlt++@394 d19143bc-622f-0410-bfdd-b5b2a6649095

mlt++/src/Makefile
mlt++/src/Mlt.h
mlt++/src/MltField.cpp [new file with mode: 0644]
mlt++/src/MltField.h [new file with mode: 0644]
mlt++/src/MltMultitrack.cpp [new file with mode: 0644]
mlt++/src/MltMultitrack.h [new file with mode: 0644]
mlt++/src/MltTractor.cpp [new file with mode: 0644]
mlt++/src/MltTractor.h [new file with mode: 0644]
mlt++/swig/mltpp.i

index 0facd13..bd8ae66 100644 (file)
@@ -7,14 +7,17 @@ TARGET = libmlt++.so
 
 OBJS = MltConsumer.o \
           MltFactory.o \
+          MltField.o \
           MltFilter.o \
           MltFilteredConsumer.o \
           MltFrame.o \
+          MltMultitrack.o \
           MltPlaylist.o \
           MltProducer.o \
           MltProperties.o \
           MltService.o \
-          MltTransition.o
+          MltTractor.o \
+          MltTransition.o 
 
 SRCS = $(OBJS:.o=.cpp)
 
index cdd7368..ad73aa5 100644 (file)
 
 #include "MltConsumer.h"
 #include "MltFactory.h"
+#include "MltField.h"
 #include "MltFilter.h"
 #include "MltFilteredConsumer.h"
 #include "MltFrame.h"
+#include "MltMultitrack.h"
 #include "MltPlaylist.h"
 #include "MltProducer.h"
 #include "MltProperties.h"
 #include "MltService.h"
+#include "MltTractor.h"
 #include "MltTransition.h"
 
 #endif
diff --git a/mlt++/src/MltField.cpp b/mlt++/src/MltField.cpp
new file mode 100644 (file)
index 0000000..01fe5ce
--- /dev/null
@@ -0,0 +1,63 @@
+/**
+ * MltField.cpp - Field 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 "MltField.h"
+#include "MltFilter.h"
+#include "MltTransition.h"
+using namespace Mlt;
+
+Field::Field( mlt_field field ) :
+       instance( field )
+{
+       inc_ref( );
+}
+
+Field::Field( Field &field ) :
+       instance( field.get_field( ) )
+{
+       inc_ref( );
+}
+
+Field::~Field( )
+{
+       mlt_field_close( instance );
+}
+
+mlt_field Field::get_field( )
+{
+       return instance;
+}
+
+mlt_service Field::get_service( )
+{
+       return mlt_field_service( get_field( ) );
+}
+
+int Field::plant_filter( Filter &filter, int track )
+{
+       return mlt_field_plant_filter( get_field( ), filter.get_filter( ), track );
+}
+
+int Field::plant_transition( Transition &transition, int a_track, int b_track )
+{
+       return mlt_field_plant_transition( get_field( ), transition.get_transition( ), a_track, b_track );
+}
+
+
diff --git a/mlt++/src/MltField.h b/mlt++/src/MltField.h
new file mode 100644 (file)
index 0000000..67a631b
--- /dev/null
@@ -0,0 +1,50 @@
+/**
+ * MltField.h - Field 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_FIELD_H_
+#define _MLTPP_FIELD_H_
+
+#include <framework/mlt.h>
+
+#include "MltService.h"
+
+namespace Mlt
+{
+       class Service;
+       class Filter;
+       class Transition;
+
+       class Field : public Service
+       {
+               private:
+                       mlt_field instance;
+               public:
+                       Field( mlt_field field );
+                       Field( Field &field );
+                       virtual ~Field( );
+                       mlt_field get_field( );
+                       mlt_service get_service( );
+                       int plant_filter( Filter &filter, int track = 0 );
+                       int plant_transition( Transition &transition, int a_track = 0, int b_track = 1 );
+       };
+}
+
+#endif
+
diff --git a/mlt++/src/MltMultitrack.cpp b/mlt++/src/MltMultitrack.cpp
new file mode 100644 (file)
index 0000000..1f5ec72
--- /dev/null
@@ -0,0 +1,71 @@
+/**
+ * MltMultitrack.h - Multitrack 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 "MltMultitrack.h"
+#include "MltProducer.h"
+using namespace Mlt;
+
+Multitrack::Multitrack( mlt_multitrack multitrack ) :
+       instance( multitrack )
+{
+       inc_ref( );
+}
+
+Multitrack::Multitrack( Multitrack &multitrack ) :
+       instance( multitrack.get_multitrack( ) )
+{
+       inc_ref( );
+}
+
+Multitrack::~Multitrack( )
+{
+       mlt_multitrack_close( instance );
+}
+
+mlt_multitrack Multitrack::get_multitrack( )
+{
+       return instance;
+}
+
+mlt_producer Multitrack::get_producer( )
+{
+       return mlt_multitrack_producer( get_multitrack( ) );
+}
+
+int Multitrack::connect( Producer &producer, int index )
+{
+       return mlt_multitrack_connect( get_multitrack( ), producer.get_producer( ), index );
+}
+
+int Multitrack::clip( mlt_whence whence, int index )
+{
+       return mlt_multitrack_clip( get_multitrack( ), whence, index );
+}
+
+int Multitrack::count( )
+{
+       return mlt_multitrack_count( get_multitrack( ) );
+}
+
+Producer *Multitrack::track( int index )
+{
+       return new Producer( mlt_multitrack_track( get_multitrack( ), index ) );
+}
+
diff --git a/mlt++/src/MltMultitrack.h b/mlt++/src/MltMultitrack.h
new file mode 100644 (file)
index 0000000..c8b24e2
--- /dev/null
@@ -0,0 +1,50 @@
+/**
+ * MltMultitrack.h - Multitrack 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_MULTITRACK_H_
+#define _MLTPP_MULTITRACK_H_
+
+#include <framework/mlt.h>
+
+#include "MltProducer.h"
+
+namespace Mlt
+{
+       class Producer;
+
+       class Multitrack : public Producer
+       {
+               private:
+                       mlt_multitrack instance;
+               public:
+                       Multitrack( mlt_multitrack multitrack );
+                       Multitrack( Multitrack &multitrack );
+                       virtual ~Multitrack( );
+                       mlt_multitrack get_multitrack( );
+                       mlt_producer get_producer( );
+                       int connect( Producer &producer, int index );
+                       int clip( mlt_whence whence, int index );
+                       int count( );
+                       Producer *track( int index );
+       };
+}
+
+#endif
+
diff --git a/mlt++/src/MltTractor.cpp b/mlt++/src/MltTractor.cpp
new file mode 100644 (file)
index 0000000..2659275
--- /dev/null
@@ -0,0 +1,67 @@
+/**
+ * MltTractor.cpp - Tractor 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 "MltTractor.h"
+#include "MltMultitrack.h"
+#include "MltField.h"
+using namespace Mlt;
+
+Tractor::Tractor( ) :
+       instance( mlt_tractor_new( ) )
+{
+}
+
+Tractor::Tractor( mlt_tractor tractor ) :
+       instance( tractor )
+{
+       inc_ref( );
+}
+
+Tractor::Tractor( Tractor &tractor ) :
+       instance( tractor.get_tractor( ) )
+{
+       inc_ref( );
+}
+
+Tractor::~Tractor( )
+{
+       mlt_tractor_close( instance );
+}
+
+mlt_tractor Tractor::get_tractor( )
+{
+       return instance;
+}
+
+mlt_producer Tractor::get_producer( )
+{
+       return mlt_tractor_producer( get_tractor( ) );
+}
+
+Multitrack *Tractor::multitrack( )
+{
+       return new Multitrack( mlt_tractor_multitrack( get_tractor( ) ) );
+}
+
+Field *Tractor::field( )
+{
+       return new Field( mlt_tractor_field( get_tractor( ) ) );
+}
+
diff --git a/mlt++/src/MltTractor.h b/mlt++/src/MltTractor.h
new file mode 100644 (file)
index 0000000..ac3281e
--- /dev/null
@@ -0,0 +1,51 @@
+/**
+ * MltTractor.h - Tractor 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_TRACTOR_H_
+#define _MLTPP_TRACTOR_H_
+
+#include <framework/mlt.h>
+
+#include "MltProducer.h"
+
+namespace Mlt
+{
+       class Producer;
+       class Field;
+       class Multitrack;
+
+       class Tractor : public Producer
+       {
+               private:
+                       mlt_tractor instance;
+               public:
+                       Tractor( );
+                       Tractor( mlt_tractor tractor );
+                       Tractor( Tractor &Tractor );
+                       virtual ~Tractor( );
+                       mlt_tractor get_tractor( );
+                       mlt_producer get_producer( );
+                       Multitrack *multitrack( );
+                       Field *field( );
+       };
+}
+
+#endif
+
index b06d829..e84a9a1 100644 (file)
@@ -40,6 +40,9 @@ namespace Mlt {
 %newobject Producer::filter( int );
 %newobject Playlist::current( );
 %newobject Playlist::clip_info( int );
+%newobject Multitrack::track( int index );
+%newobject Tractor::multitrack( );
+%newobject Tractor::field( );
 }
 
 /** Classes to wrap.
@@ -55,5 +58,9 @@ namespace Mlt {
 %include <MltPlaylist.h>
 %include <MltConsumer.h>
 %include <MltFilter.h>
+%include <MltTransition.h>
+%include <MltMultitrack.h>
+%include <MltField.h>
+%include <MltTractor.h>
 %include <MltFilteredConsumer.h>