From 1a77934531b0ddfc4392ccffbdde0058c2dbab68 Mon Sep 17 00:00:00 2001 From: David Robillard Date: Wed, 1 Aug 2007 04:42:09 +0000 Subject: Remove PostProcessor thread, post-process in main thread instead (solves scripting threading issues, and saves memory anyway). Revert saw_lp.ingen.ttl (version written by broken raptor committed by mistake). Working engine->script responses, nicer Python example. git-svn-id: http://svn.drobilla.net/lad/ingen@665 a436a847-0d15-0410-975c-d299462d15a1 --- src/bindings/Makefile.am | 5 +++++ src/bindings/ingen.i | 5 +++++ src/bindings/test_ingen.py | 35 +++++++++++++++-------------------- 3 files changed, 25 insertions(+), 20 deletions(-) (limited to 'src/bindings') diff --git a/src/bindings/Makefile.am b/src/bindings/Makefile.am index 48a5ad4f..cb86a915 100644 --- a/src/bindings/Makefile.am +++ b/src/bindings/Makefile.am @@ -10,6 +10,11 @@ bindings_LTLIBRARIES = libingen_bindings.la libingen_bindings_la_LDFLAGS = -no-undefined -module -avoid-version libingen_bindings_la_LIBADD = @RAUL_LIBS@ @GLIBMM_LIBS@ #../libs/module/libingen_module.la libingen_bindings_la_SOURCES = ingen_wrap.cxx ingen_bindings.cpp ingen_bindings.hpp +libingen_bindings_la_CXXFLAGS = \ + @SLV2_CFLAGS@ @RAUL_CFLAGS@ @GLIBMM_CFLAGS@ \ + -I$(top_srcdir)/ingen/src/common \ + -I$(top_srcdir)/ingen/src/libs \ + -I/usr/include/python2.4 swig: ingen.i swig -c++ -Wall $(FLAGS) -python ingen.i diff --git a/src/bindings/ingen.i b/src/bindings/ingen.i index 719ece20..5eb942d9 100644 --- a/src/bindings/ingen.i +++ b/src/bindings/ingen.i @@ -42,6 +42,11 @@ namespace Ingen { namespace Shared { return Ingen::Shared::ingen_world; } } + + void iteration() { + Ingen::Shared::script_iteration($self); + } + /*SLV2World slv2() { return $self->me->slv2_world; }*/ }; diff --git a/src/bindings/test_ingen.py b/src/bindings/test_ingen.py index 4109dd21..9b925155 100755 --- a/src/bindings/test_ingen.py +++ b/src/bindings/test_ingen.py @@ -1,40 +1,34 @@ #!/usr/bin/env python + import ingen import time world = ingen.World() class PythonClient(ingen.Client): - #def __init__(self): - # ingen.Client(self) - # print "Client" - - def bundle_begin(): - print "Bundle {" + def error(self, msg): + print "*** Received error:", msg + def bundle_begin(self): + print "*** Receiving Bundle {" + + def bundle_end(self): + print "*** }" def new_port(self, path, data_type, is_output): - print "Port:", path, data_type, is_output + print "*** Received Port:", path, data_type, is_output + + def new_node(self, plugin_uri, path, polyphonic, nports): + print "*** Received Node:", plugin_uri, path, polyphonic, nports c = PythonClient() -c.thisown = 0 -print "C OWN", c.thisown -#print c.__base__ +c.enable() e = world.engine -print "E OWN", e.thisown -e.thisown = 0 -#print e - e.activate() -#e.register_client("foo", c) c.subscribe(e) -c.enable() -#c.new_patch("/foo/bar", 1) - - e.create_port("/I", "ingen:midi", False) e.create_port("/made", "ingen:audio", False) e.create_port("/these", "ingen:audio", False) @@ -43,5 +37,6 @@ e.create_port("/a", "ingen:audio", True) e.create_port("/script", "ingen:audio", True) while True: - time.sleep(1) + world.iteration() + time.sleep(0.1) -- cgit v1.2.1