view flax/Ports.py @ 964:ced2c5e5fb31

curvecalc can finally change songs without restarting, and it can optionally track the song from ascoltami (beware of losing curve edits in this mode!) Ignore-this: 3a5349b015605c3a8d640d30ea255000
author drewp@bigasterisk.com
date Sat, 15 Jun 2013 08:21:33 +0000
parents 45b12307c695
children
line wrap: on
line source

# super rough code

class AbstractPort:
    def __init__(self):
        pass
    def put_data(self, value):
        pass
    def get_data(self):
        pass

class Port(AbstractPort):
    "Connects from a node to exactly one node."
    def __init__(self, value=None):
        AbstractPort.__init__(self)
        self.value = value
    def put_data(self, value):
        self.value = value
    def get_data(self):
        return self.value

class MultiPort(AbstractPort):
    "Connects from a node to any number of nodes."
    def __init__(self, values=None):
        AbstractPort.__init__(self)
        self.values = values
    def put_data(self, values):
        self.values = values
    def get_data(self):
        return self.values