summaryrefslogtreecommitdiffstats
path: root/src/progs/python
diff options
context:
space:
mode:
authorDavid Robillard <d@drobilla.net>2006-06-21 05:53:27 +0000
committerDavid Robillard <d@drobilla.net>2006-06-21 05:53:27 +0000
commitadac9032064d973ff6cfe1f94d8619c71fe199a3 (patch)
treeb2427a03222042cb79ff530ab1ad7c612475e7b7 /src/progs/python
parent9e6189fadd0fa1ff3636b50e84549da01fdbe7ba (diff)
downloadingen-adac9032064d973ff6cfe1f94d8619c71fe199a3.tar.gz
ingen-adac9032064d973ff6cfe1f94d8619c71fe199a3.tar.bz2
ingen-adac9032064d973ff6cfe1f94d8619c71fe199a3.zip
Reorganized directory tree/names
git-svn-id: http://svn.drobilla.net/lad/ingen@73 a436a847-0d15-0410-975c-d299462d15a1
Diffstat (limited to 'src/progs/python')
-rwxr-xr-xsrc/progs/python/OSC.py27
-rw-r--r--src/progs/python/ingen.py (renamed from src/progs/python/omsynth.py)47
-rw-r--r--src/progs/python/ingenecho.py (renamed from src/progs/python/omecho.py)2
-rwxr-xr-xsrc/progs/python/scripts/flatten.py10
-rw-r--r--src/progs/python/scripts/sillysinepatch.py8
5 files changed, 47 insertions, 47 deletions
diff --git a/src/progs/python/OSC.py b/src/progs/python/OSC.py
index 74eb5880..ea93dc52 100755
--- a/src/progs/python/OSC.py
+++ b/src/progs/python/OSC.py
@@ -4,23 +4,22 @@
# Copyright (C) 2002 Daniel Holth, Clinton McChesney
# Modified by Leonard Ritter
#
-# This library 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.1 of the License, or (at your option) any later version.
+# This library 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.1 of the License, or
+# (at your option) any later version.
#
-# This library 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
-# Lesser General Public License for more details.
+# This library 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 Lesser General Public
+# License for more details.
#
-# You should have received a copy of the GNU Lesser General Public
-# License along with this library; if not, write to the Free Software
-# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+# You should have received a copy of the GNU Lesser General Public License
+# along with this library; if not, write to the Free Software Foundation,
+# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
#
-# For questions regarding this module contact
-# Daniel Holth <dholth@stetson.edu> or visit
-# http://www.stetson.edu/~ProctoLogic/
+# For questions regarding this module contact Daniel Holth <dholth@stetson.edu>
+# or visit http://www.stetson.edu/~ProctoLogic/
import socket
import struct
diff --git a/src/progs/python/omsynth.py b/src/progs/python/ingen.py
index d7cfa5ab..25c05fea 100644
--- a/src/progs/python/omsynth.py
+++ b/src/progs/python/ingen.py
@@ -1,8 +1,9 @@
#!/usr/bin/python
#
-# Python bindings for Om
+# Python bindings for Ingen
# Copyright (C) 2005 Leonard Ritter
-#
+# Copyright (C) 2006 Dave Robillard
+
# This library 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
@@ -15,7 +16,7 @@
#
# You should have received a copy of the GNU Lesser General Public
# License along with this library; if not, write to the Free Software
-# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
import os,sys,thread,time
@@ -24,8 +25,8 @@ from OSC import OSCMessage, decodeOSC
from twisted.internet.protocol import DatagramProtocol
from twisted.internet import reactor
-OM_CALL_TIMEOUT = 5
-OM_CALL_POLLTIME = 0.1
+INGEN_CALL_TIMEOUT = 5
+INGEN_CALL_POLLTIME = 0.1
class TreeElement:
def __init__(self,environment,parent,name):
@@ -367,11 +368,11 @@ class Environment:
print ">>> %s -> %s" % (connection.getSrcPort().getPath(), connection.getDstPort().getPath())
#~ /om/engine_enabled - Notification engine's DSP has been enabled.
- def __om__engine_enabled(self):
+ def __ingen__engine_enabled(self):
self.enabled = True
#~ /om/engine_disabled - Notification engine's DSP has been disabled.
- def __om__engine_disabled(self):
+ def __ingen__engine_disabled(self):
self.enabled = False
#~ /om/new_node - Notification of a new node's creation.
@@ -382,19 +383,19 @@ class Environment:
#~ * plug-label (string) - Label of plugin in library (ie adsr_env)
#~ * New nodes are sent as a blob. The first message in the blob will be this one (/om/new_node), followed by a series of /om/new_port commands, followed by /om/new_node_end.
- def __om__new_node(self,path,polyphonic,plugintype,libname,pluginlabel):
+ def __ingen__new_node(self,path,polyphonic,plugintype,libname,pluginlabel):
node = self.getNode(path)
node.setPolyphonic(polyphonic)
node.setPluginType(plugintype)
node.setLibName(libname)
node.setPluginLabel(pluginlabel)
- def __om__new_node_end(self):
+ def __ingen__new_node_end(self):
pass
#~ /om/node_removal - Notification of a node's destruction.
#~ * path (string) - Path of node (which no longer exists)
- def __om__node_removal(self,path):
+ def __ingen__node_removal(self,path):
node = self.getNode(path)
node.remove()
@@ -410,7 +411,7 @@ class Environment:
#~ * Note that in the event of loading a patch, this message could be followed immediately by a control change, meaning the default-value is not actually the current value of the port (ahem, Lachlan).
#~ * The minimum and maximum values are suggestions only, they are not enforced in any way, and going outside them is perfectly fine. Also note that the port ranges in om_gtk are not these ones! Those ranges are set as metadata.
- def __om__new_port(self,path,porttype,direction,hint,defaultvalue,minvalue,maxvalue):
+ def __ingen__new_port(self,path,porttype,direction,hint,defaultvalue,minvalue,maxvalue):
port = self.getPort(path)
port.setPortType(porttype)
port.setDirection(direction)
@@ -421,38 +422,38 @@ class Environment:
#~ /om/port_removal - Notification of a port's destruction.
#~ * path (string) - Path of port (which no longer exists)
- def __om__port_removal(self,path):
+ def __ingen__port_removal(self,path):
port = self.getPort(path)
port.remove()
#~ /om/patch_destruction - Notification of a patch's destruction.
#~ * path (string) - Path of patch (which no longer exists)
- def __om__patch_destruction(self,path):
+ def __ingen__patch_destruction(self,path):
patch = self.getPatch(path)
patch.remove()
#~ /om/patch_enabled - Notification a patch's DSP processing has been enabled.
#~ * path (string) - Path of enabled patch
- def __om__patch_enabled(self,path):
+ def __ingen__patch_enabled(self,path):
patch = self.getPatch(path)
patch.setEnabled(True)
#~ /om/patch_disabled - Notification a patch's DSP processing has been disabled.
#~ * path (string) - Path of disabled patch
- def __om__patch_disabled(self,path):
+ def __ingen__patch_disabled(self,path):
patch = self.getPatch(path)
patch.setEnabled(False)
#~ /om/new_connection - Notification a new connection has been made.
#~ * src-path (string) - Path of the source port
#~ * dst-path (string) - Path of the destination port
- def __om__new_connection(self,srcpath,dstpath):
+ def __ingen__new_connection(self,srcpath,dstpath):
self.getConnection(srcpath,dstpath)
#~ /om/disconnection - Notification a connection has been unmade.
#~ * src-path (string) - Path of the source port
#~ * dst-path (string) - Path of the destination port
- def __om__disconnection(self,srcpath,dstpath):
+ def __ingen__disconnection(self,srcpath,dstpath):
connection = self.getConnection(srcpath,dstpath)
portpair = connection.getPortPair()
connection.remove()
@@ -462,7 +463,7 @@ class Environment:
#~ * path (string) - Path of the object associated with metadata (can be a node, patch, or port)
#~ * key (string)
#~ * value (string)
- def __om__metadata__update(self,path,key,value):
+ def __ingen__metadata__update(self,path,key,value):
object = self.getObject(path)
object.setMetaData(key,value)
@@ -470,14 +471,14 @@ class Environment:
#~ * path (string) - Path of port
#~ * value (float) - New value of port
#~ * This will only send updates for values set by clients of course - not values changing because of connections to other ports!
- def __om__control_change(self,path,value):
+ def __ingen__control_change(self,path,value):
port = self.getPort(path)
port.setValue(value)
#~ /om/new_patch - Notification of a new patch
#~ * path (string) - Path of new patch
#~ * poly (int) - Polyphony of new patch (not a boolean like new_node)
- def __om__new_patch(self,path,poly):
+ def __ingen__new_patch(self,path,poly):
patch = self.getPatch(path)
patch.setPoly(poly)
@@ -536,7 +537,7 @@ class Client(DatagramProtocol, ClientProxy):
self.environment = environment
for name in dir(self.environment):
element = getattr(self.environment,name)
- if (type(element).__name__ == 'instancemethod') and (element.__name__[:6] == "__om__"):
+ if (type(element).__name__ == 'instancemethod') and (element.__name__[:6] == "__ingen__"):
handlername = element.__name__.replace("__","/")
print "registering handler for '%s'" % handlername
self.handlers[handlername] = element
@@ -615,9 +616,9 @@ class Client(DatagramProtocol, ClientProxy):
self.transport.write(message.getBinary())
now = time.time()
while not omcall.done:
- time.sleep(OM_CALL_POLLTIME)
+ time.sleep(INGEN_CALL_POLLTIME)
distance = time.time() - now
- if distance > OM_CALL_TIMEOUT:
+ if distance > INGEN_CALL_TIMEOUT:
print "timeout"
break
del self.calls[packetNumber]
diff --git a/src/progs/python/omecho.py b/src/progs/python/ingenecho.py
index c0d2d3b1..7ed2cef5 100644
--- a/src/progs/python/omecho.py
+++ b/src/progs/python/ingenecho.py
@@ -15,7 +15,7 @@
#
# You should have received a copy of the GNU Lesser General Public
# License along with this library; if not, write to the Free Software
-# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
import omsynth
import os,time,sys
diff --git a/src/progs/python/scripts/flatten.py b/src/progs/python/scripts/flatten.py
index eaf8084d..530e4291 100755
--- a/src/progs/python/scripts/flatten.py
+++ b/src/progs/python/scripts/flatten.py
@@ -2,7 +2,7 @@
###############################################################################
#
-# flatten.py - a python script that merges all subpatches in an Om patch
+# flatten.py - a python script that merges all subpatches in an Ingen patch
# into the parent patch
#
# Copyright (C) 2005 Lars Luthman
@@ -19,11 +19,11 @@
#
# 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
+# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
#
###############################################################################
-import omsynth
+import ingen
import os,time,sys
@@ -200,7 +200,7 @@ def flatten(om, patch):
def main(om):
- om.setEnvironment(omsynth.Environment())
+ om.setEnvironment(ingen.Environment())
om.engine.activate.async()
om.engine.load_plugins.async()
om.request.all_objects(om.getAddressAsString())
@@ -225,7 +225,7 @@ if len(sys.argv) > 1:
print "%p";
os._exit(0)
else:
- omsynth.startClient(main)
+ ingen.startClient(main)
else:
print "Which patch do you want to flatten?"
diff --git a/src/progs/python/scripts/sillysinepatch.py b/src/progs/python/scripts/sillysinepatch.py
index ac51a080..dcb37a97 100644
--- a/src/progs/python/scripts/sillysinepatch.py
+++ b/src/progs/python/scripts/sillysinepatch.py
@@ -15,13 +15,13 @@
#
# You should have received a copy of the GNU Lesser General Public
# License along with this library; if not, write to the Free Software
-# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
-import omsynth
+import ingen
import os,time,sys
def main(om):
- om.setEnvironment(omsynth.Environment())
+ om.setEnvironment(ingen.Environment())
om.engine.activate()
om.engine.load_plugins()
om.engine.register_client(om.getAddressAsString())
@@ -38,4 +38,4 @@ def main(om):
os._exit(0)
if __name__ == "__main__":
- omsynth.startClient(main)
+ ingen.startClient(main)