path=`dirname $path`
# Change this as needed
- export JAVA_INCLUDE="-I$path/include -I$path/include/linux"
+ # export JAVA_INCLUDE="-I$path/include -I$path/include/linux"
- ln -sf ../mltpp.i .
+ ln -sf ../melted.i
# Invoke swig
- mkdir -p src_swig/net/sourceforge/mltpp
- swig -c++ -I../../src `pkg-config mlt-framework --cflags` -java -outdir src_swig/net/sourceforge/mltpp -package net.sourceforge.mltpp mltpp.i || exit $?
+ mkdir -p src_swig/org/mltframework
+ swig -c++ -I../../melted++ `pkg-config mlt++ --cflags` -java -outdir src_swig/org/mltframework -package org.mltframework melted.i || exit $?
# Compile the wrapper
- g++ -D_GNU_SOURCE -c -rdynamic -pthread -I../../src `pkg-config mlt-framework --cflags` mltpp_wrap.cxx $JAVA_INCLUDE || exit $?
+ g++ -D_GNU_SOURCE -c -rdynamic -pthread -I../../melted++ `pkg-config mlt++ --cflags` melted_wrap.cxx $JAVA_INCLUDE || exit $?
# Create the module
- gcc -shared mltpp_wrap.o -L../../src -lmlt++ -o libmltpp_java.so || exit $?
+ gcc -shared melted_wrap.o -L../../melted++ -lmelted++ -o libmelted_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
/**
* melted.i - Swig Bindings for melted++
- * Copyright (C) 2004-2005 Charles Yates
+ * Copyright (C) 2004-2009 Charles Yates
* Author: Charles Yates <charles.yates@pandora.be>
*
* This program is free software; you can redistribute it and/or modify
%array_class(unsigned char, unsignedCharArray);
%{
-#include <melted++/MltMelted.h>
+#include <Mlt.h>
+#include <MltMelted.h>
+#include <MltResponse.h>
%}
/** These methods return objects which should be gc'd.
namespace Mlt {
%newobject Melted::execute( char * );
+%newobject Melted::received( char *, char * );
%newobject Melted::push( char *, Service & );
%newobject Melted::unit( int );
}
/** Classes to wrap.
*/
-%include <MltMiracle.h>
+%include <MltMelted.h>
%include <MltResponse.h>
+
+#if defined(SWIGRUBY)
+
+%{
+
+static void ruby_listener( mlt_properties owner, void *object );
+
+class RubyListener
+{
+ private:
+ VALUE callback;
+ Mlt::Event *event;
+
+ public:
+ RubyListener( Mlt::Properties &properties, char *id, VALUE callback ) :
+ callback( callback )
+ {
+ event = properties.listen( id, this, ( mlt_listener )ruby_listener );
+ }
+
+ ~RubyListener( )
+ {
+ delete event;
+ }
+
+ void mark( )
+ {
+ ((void (*)(VALUE))(rb_gc_mark))( callback );
+ }
+
+ void doit( )
+ {
+ ID method = rb_intern( "call" );
+ rb_funcall( callback, method, 0 );
+ }
+};
+
+static void ruby_listener( mlt_properties owner, void *object )
+{
+ RubyListener *o = static_cast< RubyListener * >( object );
+ o->doit( );
+}
+
+void markRubyListener( void* p )
+{
+ RubyListener *o = static_cast<RubyListener*>( p );
+ o->mark( );
+}
+
+%}
+
+// Ruby wrapper
+%rename( Listener ) RubyListener;
+%markfunc RubyListener "markRubyListener";
+
+class RubyListener
+{
+ public:
+ RubyListener( Mlt::Properties &properties, char *id, VALUE callback );
+};
+
+#endif
my $CXX = $ENV{'CXX'} || 'g++';
-system( "ln -sf ../mltpp.i ." );
-system( "swig -c++ -I../../src `pkg-config mlt-framework --cflags` -perl5 mltpp.i" );
+system( "ln -sf ../melted.i" );
+system( "swig -c++ -I../../melted++ `pkg-config mlt++ --cflags` -perl5 melted.i" );
WriteMakefile(
- 'NAME' => 'mltpp',
- 'CC' => '${CXX} `pkg-config mlt-framework --cflags` -I../../src',
+ 'NAME' => 'melted',
+ 'CC' => '${CXX} `pkg-config mlt++ --cflags` -I../../melted++',
'OPTIMIZE' => '-O2 -g -pipe -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -m32 -march=i386',
- 'LIBS' => ['-L../../src -lmlt++'],
- 'OBJECT' => 'mltpp_wrap.o',
+ 'LIBS' => ['-L../../melted++ -lmelted++'],
+ 'OBJECT' => 'melted_wrap.o',
'DESTDIR' => $ENV{'DESTDIR'},
);
#!/bin/sh
-ln -s ../mltpp.i
-swig -c++ -I../../src `pkg-config --cflags mlt-framework` -php5 -noproxy mltpp.i
-g++ -fPIC -DPIC -D_GNU_SOURCE -c -rdynamic -pthread `pkg-config --cflags mlt-framework` `php-config --includes` mltpp_wrap.cpp
-
+ln -s ../melted.i
+swig -c++ -I../../melted++ `pkg-config --cflags mlt++` -php5 -noproxy melted.i
+g++ -fPIC -DPIC -D_GNU_SOURCE -c -rdynamic -pthread -I../../melted++ `pkg-config --cflags mlt++` `php-config --includes` melted_wrap.cpp
+gcc -shared melted_wrap.o -L../../melted++ -lmelted++ -o melted.so || exit $?
[ ! -d "$PYTHON_INCLUDE" ] && echo python development missing && exit 1
- ln -sf ../mltpp.i .
+ ln -sf ../melted.i
# Invoke swig
- swig -c++ -I../../src `pkg-config mlt-framework --cflags` -python mltpp.i || exit $?
+ swig -c++ -I../../melted++ `pkg-config mlt++ --cflags` -python melted.i || exit $?
# Compile the wrapper
- g++ -fPIC -D_GNU_SOURCE -c -rdynamic -pthread `pkg-config mlt-framework --cflags` -I$PYTHON_INCLUDE mltpp_wrap.cxx || exit $?
+ g++ -fPIC -D_GNU_SOURCE -c -rdynamic -pthread -I../../melted++ `pkg-config mlt++ --cflags` -I$PYTHON_INCLUDE melted_wrap.cxx || exit $?
# Create the module
- gcc -shared mltpp_wrap.o -L../../src -lmlt++ -o _mltpp.so || exit $?
+ gcc -shared melted_wrap.o -L../../melted++ -lmelted++ -o _melted.so || exit $?
else
echo Python not installed.
exit 1
#!/usr/bin/env ruby
require 'mkmf'
-system( "ln -sf ../mltpp.i mltpp.i" )
-system( "swig -c++ -ruby -I../../src `pkg-config mlt-framework --cflags` mltpp.i" )
-$CFLAGS += " -I../../src `pkg-config mlt-framework --cflags`"
-$LDFLAGS += " -L../../src -lmlt++"
-create_makefile('mltpp')
+system( "ln -sf ../melted.i" )
+system( "swig -c++ -ruby -I../../melted++ `pkg-config mlt++ --cflags` melted.i" )
+$CFLAGS += " -I../../melted++ `pkg-config mlt++ --cflags`"
+$LDFLAGS += " -L../../melted++ -lmelted++"
+create_makefile('melted')
system( 'make' )
+++ /dev/null
-#!/usr/bin/env ruby
-
-require 'mltpp'
-
-def command
- puts "command"
-end
-
-def push
- puts "push"
-end
-
-miracle = Mltpp::Miracle.new( "miracle-ruby", 5260 )
-miracle.start
-miracle.execute( "uadd sdl" )
-listener = Mltpp::Listener.new( miracle, "command-received", method( :command ) )
-listener = Mltpp::Listener.new( miracle, "push-received", method( :push ) )
-miracle.wait_for_shutdown
-
--- /dev/null
+#!/usr/bin/env ruby
+
+require 'mlt'
+require 'melted'
+
+def command
+ puts "command"
+end
+
+def push
+ puts "push"
+end
+
+melted = Melted::Melted.new( "melted-ruby", 5260 )
+melted.start
+melted.execute( "uadd sdl" )
+listener = Melted::Listener.new( melted, "command-received", method( :command ) )
+listener = Melted::Listener.new( melted, "push-received", method( :push ) )
+melted.wait_for_shutdown
if [ "$path" != "" ]
then
- ln -sf ../mltpp.i .
+ ln -sf ../melted.i
# Invoke swig
- swig -c++ -I../../src `pkg-config mlt-framework --cflags` -tcl mltpp.i || exit 1
+ swig -c++ -I../../melted++ `pkg-config mlt++ --cflags` -tcl melted.i || exit 1
# Compile the wrapper
- g++ -D_GNU_SOURCE -c -rdynamic -pthread -I../../src `pkg-config mlt-framework --cflags` mltpp_wrap.cxx || exit 1
+ g++ -D_GNU_SOURCE -c -rdynamic -pthread -I../../melted++ `pkg-config mlt++ --cflags` melted_wrap.cxx || exit 1
# Create the module
- gcc -shared mltpp_wrap.o -L../../src -lmlt++ -o mltpp.so || exit 1
+ gcc -shared melted_wrap.o -L../../melted++ -lmelted++ -o melted.so || exit 1
else
echo "Unable to locate tclsh."
exit 1