2 * melted.i - Swig Bindings for melted++
3 * Copyright (C) 2004-2009 Charles Yates
4 * Author: Charles Yates <charles.yates@pandora.be>
6 * This program is free software; you can redistribute it and/or modify
7 * it under the terms of the GNU Lesser General Public License as published
8 * by the Free Software Foundation; either version 2 of the License, or
9 * (at your option) any later version.
11 * This program is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 * GNU General Public License for more details.
16 * You should have received a copy of the GNU General Public License
17 * along with this program; if not, write to the Free Software Foundation,
18 * Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
23 %array_class(unsigned char, unsignedCharArray);
27 #include <MltMelted.h>
28 #include <MltResponse.h>
31 /** These methods return objects which should be gc'd.
35 %newobject Melted::execute( char * );
36 %newobject Melted::received( char *, char * );
37 %newobject Melted::push( char *, Service & );
38 %newobject Melted::unit( int );
44 %include <MltMelted.h>
45 %include <MltResponse.h>
51 static void ruby_listener( mlt_properties owner, void *object );
60 RubyListener( Mlt::Properties &properties, char *id, VALUE callback ) :
63 event = properties.listen( id, this, ( mlt_listener )ruby_listener );
73 ((void (*)(VALUE))(rb_gc_mark))( callback );
78 ID method = rb_intern( "call" );
79 rb_funcall( callback, method, 0 );
83 static void ruby_listener( mlt_properties owner, void *object )
85 RubyListener *o = static_cast< RubyListener * >( object );
89 void markRubyListener( void* p )
91 RubyListener *o = static_cast<RubyListener*>( p );
98 %rename( Listener ) RubyListener;
99 %markfunc RubyListener "markRubyListener";
104 RubyListener( Mlt::Properties &properties, char *id, VALUE callback );