--- /dev/null
+#!/bin/env sh
+
+which swig > /dev/null 2>&1
+[ $? != 0 ] && echo Please install swig
+
+which mlt-config > /dev/null 2>&1
+[ $? != 0 ] && echo Please install mlt
+
+if [ "$1" = "all" ]
+then languages="java perl python ruby tcl"
+elif [ "$1" != "" ]
+then languages=$*
+else echo "Usage: ./configure [ all | language * ]"
+ exit 0
+fi
+
+for i in $languages
+do
+ echo -n "Configuring $i ... "
+ cd $i
+ output=`./build 2>/dev/null`
+ if [ $? == 0 ]
+ then echo "OK"
+ elif [ "$output" == "" ]
+ then
+ echo "Failed"
+ else
+ echo $output
+ fi
+ cd ..
+done
--- /dev/null
+import net.sourceforge.mltpp.*;
+
+public class Play {
+
+ static {
+ System.loadLibrary("mltpp_java");
+ }
+
+ public static void main (String[] args) {
+
+ // Start the mlt system
+ Factory.init( null );
+
+ // Create the producer
+ Producer p = new Producer( args[0], null );
+
+ if ( p.is_valid() ) {
+
+ p.set ("eof", "loop");
+
+ // Create the consumer
+ Consumer c = new Consumer("sdl", null);
+
+ // Turn off the default rescaling
+ c.set("rescale", "none");
+
+ // Connect the producer to the consumer
+ c.connect(p);
+
+ // Start the consumer
+ c.start();
+
+ // Wait until the user stops the consumer
+ Object o = new Object();
+ while (c.is_stopped() == 0) {
+ synchronized (o) {
+ try {
+ o.wait(1000);
+ } catch (InterruptedException e) {
+ // ignored
+ }
+ }
+ }
+
+ // Stop it anyway
+ c.stop();
+ } else {
+ System.out.println ("Unable to open " + args[0]);
+ }
+ }
+}
--- /dev/null
+#!/bin/env sh
+java -Djava.library.path=. -cp .:src_swig Play "$@"
--- /dev/null
+#!/bin/env sh
+
+path=`which java 2> /dev/null`
+
+if [ $? = 0 ]
+then
+ # Locate the path for the include
+ path=`dirname $path`
+ path=`dirname $path`
+
+ # Change this as needed
+ export JAVA_INCLUDE="-I$path/include -I$path/include/linux"
+
+ ln -sf ../mltpp.i .
+
+ # Invoke swig
+ mkdir -p src_swig/net/sourceforge/mltpp
+ swig -c++ -I/usr/local/include/mlt++ `mlt-config --cflags` -java -outdir src_swig/net/sourceforge/mltpp -package net.sourceforge.mltpp mltpp.i || exit $?
+
+ # Compile the wrapper
+ g++ -D_GNU_SOURCE -c -rdynamic -pthread -I/usr/local/include/mlt++ `mlt-config --cflags` mltpp_wrap.cxx $JAVA_INCLUDE || exit $?
+
+ # Create the module
+ ld -shared mltpp_wrap.o -lmlt++ -o libmltpp_java.so || exit $?
+
+ # Compile the test
+ javac `find src_swig -name '*.java'` || exit $?
+
+ export CLASSPATH=`pwd`/src_swig
+ javac Play.java
+else
+ echo "Java command not found"
+ exit 1
+fi
--- /dev/null
+/**
+ * mltpp.i - Swig Bindings for mlt++
+ * 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.
+ */
+
+%module mltpp
+
+%{
+#include <mlt++/Mlt.h>
+%}
+
+%typedef int mlt_position;
+
+/** These methods return objects which should be gc'd.
+ */
+
+namespace Mlt {
+%newobject Factory::producer( char *, char * );
+%newobject Factory::filter( char *, char * );
+%newobject Factory::transition( char *, char * );
+%newobject Factory::consumer( char *, char * );
+%newobject Service::producer( );
+%newobject Service::consumer( );
+%newobject Service::get_frame( int );
+%newobject Playlist::current( );
+%newobject Playlist::clip_info( int );
+}
+
+/** Classes to wrap.
+ */
+
+%include <MltProperties.h>
+%include <MltFrame.h>
+%include <MltService.h>
+%include <MltProducer.h>
+%include <MltPlaylist.h>
+%include <MltConsumer.h>
+%include <MltFilter.h>
+%include <MltFactory.h>
+
--- /dev/null
+#!/bin/env perl
+use ExtUtils::MakeMaker;
+system( "ln -sf ../mltpp.i ." );
+system( "swig -c++ -I/usr/local/include/mlt++ `mlt-config --cflags` -perl5 mltpp.i" );
+WriteMakefile(
+ 'NAME' => 'mltpp',
+ 'CC' => 'g++ `mlt-config --cflags` -I/usr/local/include/mlt++',
+ 'LIBS' => ['-lmlt++'],
+ 'OBJECT' => 'mltpp_wrap.o'
+);
+
--- /dev/null
+#!/bin/sh
+perl Makefile.PL || exit 1
+make
--- /dev/null
+#!/bin/sh
+
+path=`which python 2> /dev/null`
+
+if [ $? == 0 ]
+then
+ # Change this as needed
+ export PYTHON_INCLUDE=`python -c "import sys;print \"%s/include/python%d.%d\"%(sys.prefix,sys.version_info[0],sys.version_info[1])"`
+
+ [ ! -d "$PYTHON_INCLUDE" ] && echo python development missing && exit 1
+
+ ln -sf ../mltpp.i .
+
+ # Invoke swig
+ swig -c++ -I/usr/local/include/mlt++ `mlt-config --cflags` -python mltpp.i || exit $?
+
+ # Compile the wrapper
+ g++ -D_GNU_SOURCE -c -rdynamic -pthread `mlt-config --cflags` -I$PYTHON_INCLUDE mltpp_wrap.cxx || exit $?
+
+ # Create the module
+ ld -shared mltpp_wrap.o -lmlt++ -o _mltpp.so || exit $?
+else
+ echo Python not installed.
+ exit 1
+fi
--- /dev/null
+#!/usr/bin/env python
+
+# Import required modules
+import mltpp
+import time
+import sys
+
+# Start the mlt system
+mltpp.Factory.init( )
+
+# Create the producer
+p = mltpp.Producer( sys.argv[1] )
+
+if p:
+ # Create the consumer
+ c = mltpp.Consumer( "sdl" )
+
+ # Turn off the default rescaling
+ c.set( "rescale", "none" )
+
+ # Connect the producer to the consumer
+ c.connect( p )
+
+ # Start the consumer
+ c.start( )
+
+ # Wait until the user stops the consumer
+ while c.is_stopped( ) == 0:
+ time.sleep( 1 )
+else:
+ # Diagnostics
+ print "Unable to open ", sys.argv[ 1 ]
+
--- /dev/null
+#!/bin/env ruby
+require 'mkmf'
+system( "ln -sf ../mltpp.i mltpp.i" )
+system( "swig -c++ -ruby -I/usr/local/include/mlt++ `mlt-config --cflags` mltpp.i" )
+$CFLAGS += " -I/usr/local/include/mlt++ `mlt-config --cflags`"
+$LDFLAGS += " -lmlt++"
+create_makefile('mltpp')
+system( 'make' )
--- /dev/null
+#!/usr/bin/ruby
+
+# Import required modules
+require 'mltpp'
+
+# Create the mlt system
+Mltpp::Factory::init
+
+# Get and check the argument
+file = ARGV.shift
+raise "Usage: test.rb file" if file.nil?
+
+# Create the producer
+producer = Mltpp::Factory::producer( file )
+raise "Unable to load #{file}" if producer.is_valid == 0
+
+# Create the consumer
+consumer = Mltpp::Factory::consumer( "sdl" )
+raise "Unable to open sdl consumer" if consumer.is_valid == 0
+
+# Turn off the default rescaling
+consumer.set( "rescale", "none" )
+
+# Start the consumer
+consumer.start
+
+# Connect the producer to the consumer
+consumer.connect( producer )
+
+# Wait until the user stops the consumer
+while consumer.is_stopped == 0
+ sleep( 1 )
+end
+
+# Clean up consumer
+consumer.stop
+
--- /dev/null
+#!/usr/bin/ruby
+
+# Required modules
+require 'mltpp'
+
+# Create the mlt system
+Mltpp::Factory::init
+
+# Get and check the argument
+file = ARGV.shift
+name = ARGV.shift
+size = ARGV.shift
+size = "192x144" if size.nil?
+raise "Usage: thumbs.rb file name [ size ]" if file.nil? || name.nil?
+
+# Create the producer
+producer = Mltpp::Factory::producer( file )
+raise "Unable to load #{file}" if producer.is_valid == 0
+
+# Construct the playlist
+playlist = Mltpp::PlaylistInstance.new( )
+
+# Get the out point
+out = producer.get_int( "out" );
+
+# Calculate position of frames
+[ 0, 0.25, 0.5, 0.75, 1 ].each { |x| playlist.append( producer, x*out, x*out ) }
+
+# Create the thumb nail generator
+generator = Mltpp::Factory::consumer( "avformat", "#{name}%d.jpg" )
+generator.set( "real_time", "0" )
+generator.set( "progressive", "1" )
+generator.set( "size", size )
+
+# Connect the consumer
+generator.connect( playlist );
+generator.start
+
+# Wait until we're done
+while generator.is_stopped == 0
+ sleep 1
+end
+
--- /dev/null
+#!/bin/sh
+
+path=`which tclsh 2>/dev/null`
+
+if [ "$path" != "" ]
+then
+ ln -sf ../mltpp.i .
+
+ # Invoke swig
+ swig -c++ -I/usr/local/include/mlt++ `mlt-config --cflags` -tcl mltpp.i || exit 1
+
+ # Compile the wrapper
+ g++ -D_GNU_SOURCE -c -rdynamic -pthread -I/usr/local/include/mlt++ `mlt-config --cflags` mltpp_wrap.cxx || exit 1
+
+ # Create the module
+ ld -shared mltpp_wrap.o -lmlt++ -o mltpp.so || exit 1
+else
+ echo "Unable to locate tclsh."
+ exit 1
+fi
+
--- /dev/null
+#!/bin/env tclsh
+
+load mltpp.so
+mltpp.Factory.init
+set arg1 [lindex $argv 0]
+set p [factory_producer fezzik $arg1]
+set c [factory_consumer sdl ""]
+set r [mlt_consumer_properties $c]
+mlt_properties_set $r "rescale" "none"
+consumer_connect $c $p
+mlt_consumer_start $c
+while { ![mlt_consumer_is_stopped $c] } {
+ after 1000
+}
+mlt_consumer_close $c
+mlt_producer_close $p
+factory_close