コード例 #1
0
   def __init__(self, port = 57110):

      self.port = port                       # holds port to listen to (for incoming events/messages)
      self.oscPortIn = OSCPortIn(self.port)  # create port
      self.oscPortIn.startListening()        # and start it

      # also, get our host IP address (to output below, for the user's convenience)
      self.IPaddress = socket.gethostbyname(socket.gethostname())
      print "\nOSC Server started:"    
      print "Accepting OSC input on IP address", self.IPaddress, "at port", self.port
      print "(use this info to configure OSC clients)"
      print
      
      # create dictionary to hold registered callback functions, so that we can replace them
      # when a new call to onInput() is made for a given address - the dictionary key is the
      # address, and the dictionary value is the GenericListener created for this address,
      # so that may update the callback function it is associated with.
      self.oscAddressHandlers = {}
      
      self.showIncomingMessages = True   # print all incoming OSC messages by default

      # provide a default OSC message handler 
      # prints out all incoming OSC messages (if desired - see showMessages() and hideMessages())
      self.onInput(ALL_MESSAGES, self. _printIncomingMessage_)

      # remember that this OscIn has been created and is active (so that it can be stopped/terminated by JEM, if desired)
      _ActiveOscInObjects_.append(self)
コード例 #2
0
ファイル: osc.py プロジェクト: JoeLeclercq/jesWork
    def __init__(self, port=57110):

        self.port = port  # holds port to listen to (for incoming events/messages)
        self.oscPortIn = OSCPortIn(self.port)  # create port
        self.oscPortIn.startListening()  # and start it

        # also, get our host IP address (to output below, for the user's convenience)
        self.IPaddress = socket.gethostbyname(socket.getfqdn())
        print "\nOSC Server started:"
        print "Accepting OSC input on IP address", self.IPaddress, "at port", self.port
        print "(use this info to configure OSC clients)"
        print