From ab75da2557cefa3beb853b46ea7f230798f61310 Mon Sep 17 00:00:00 2001 From: lilo_booter Date: Sat, 28 Aug 2004 14:30:45 +0000 Subject: [PATCH] Multitrack classes added git-svn-id: https://mlt.svn.sourceforge.net/svnroot/mlt/trunk/mlt++@394 d19143bc-622f-0410-bfdd-b5b2a6649095 --- mlt++/src/Makefile | 5 ++- mlt++/src/Mlt.h | 3 ++ mlt++/src/MltField.cpp | 63 ++++++++++++++++++++++++++++++++++++++ mlt++/src/MltField.h | 50 ++++++++++++++++++++++++++++++ mlt++/src/MltMultitrack.cpp | 71 +++++++++++++++++++++++++++++++++++++++++++ mlt++/src/MltMultitrack.h | 50 ++++++++++++++++++++++++++++++ mlt++/src/MltTractor.cpp | 67 ++++++++++++++++++++++++++++++++++++++++ mlt++/src/MltTractor.h | 51 +++++++++++++++++++++++++++++++ mlt++/swig/mltpp.i | 7 ++++ 9 files changed, 366 insertions(+), 1 deletions(-) create mode 100644 mlt++/src/MltField.cpp create mode 100644 mlt++/src/MltField.h create mode 100644 mlt++/src/MltMultitrack.cpp create mode 100644 mlt++/src/MltMultitrack.h create mode 100644 mlt++/src/MltTractor.cpp create mode 100644 mlt++/src/MltTractor.h diff --git a/mlt++/src/Makefile b/mlt++/src/Makefile index 0facd13..bd8ae66 100644 --- a/mlt++/src/Makefile +++ b/mlt++/src/Makefile @@ -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) diff --git a/mlt++/src/Mlt.h b/mlt++/src/Mlt.h index cdd7368..ad73aa5 100644 --- a/mlt++/src/Mlt.h +++ b/mlt++/src/Mlt.h @@ -23,13 +23,16 @@ #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 index 0000000..01fe5ce --- /dev/null +++ b/mlt++/src/MltField.cpp @@ -0,0 +1,63 @@ +/** + * MltField.cpp - Field wrapper + * Copyright (C) 2004-2005 Charles Yates + * Author: Charles Yates + * + * 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 index 0000000..67a631b --- /dev/null +++ b/mlt++/src/MltField.h @@ -0,0 +1,50 @@ +/** + * MltField.h - Field wrapper + * Copyright (C) 2004-2005 Charles Yates + * Author: Charles Yates + * + * 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 + +#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 index 0000000..1f5ec72 --- /dev/null +++ b/mlt++/src/MltMultitrack.cpp @@ -0,0 +1,71 @@ +/** + * MltMultitrack.h - Multitrack wrapper + * Copyright (C) 2004-2005 Charles Yates + * Author: Charles Yates + * + * 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 index 0000000..c8b24e2 --- /dev/null +++ b/mlt++/src/MltMultitrack.h @@ -0,0 +1,50 @@ +/** + * MltMultitrack.h - Multitrack wrapper + * Copyright (C) 2004-2005 Charles Yates + * Author: Charles Yates + * + * 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 + +#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 index 0000000..2659275 --- /dev/null +++ b/mlt++/src/MltTractor.cpp @@ -0,0 +1,67 @@ +/** + * MltTractor.cpp - Tractor wrapper + * Copyright (C) 2004-2005 Charles Yates + * Author: Charles Yates + * + * 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 index 0000000..ac3281e --- /dev/null +++ b/mlt++/src/MltTractor.h @@ -0,0 +1,51 @@ +/** + * MltTractor.h - Tractor wrapper + * Copyright (C) 2004-2005 Charles Yates + * Author: Charles Yates + * + * 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 + +#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 + diff --git a/mlt++/swig/mltpp.i b/mlt++/swig/mltpp.i index b06d829..e84a9a1 100644 --- a/mlt++/swig/mltpp.i +++ b/mlt++/swig/mltpp.i @@ -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 %include %include +%include +%include +%include +%include %include -- 1.7.4.4