Advertisement
Guest User

Untitled

a guest
Jan 19th, 2019
63
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.33 KB | None | 0 0
  1. ```#! /usr/bin/python3
  2.  
  3. import liblo
  4. from liblo import *
  5. import queue, sys, time
  6.  
  7. responses = queue.Queue()
  8.  
  9. class OscServer(ServerThread):
  10. def __init__(self):
  11. ServerThread.__init__(self, 97217)
  12.  
  13. @make_method('/cyperus/address', 'ss')
  14. def osc_address_handler(self, path, args):
  15. s = args
  16. responses.put(s)
  17. print("received '/cyperus/address'")
  18.  
  19. @make_method(None, None)
  20. def fallback(self, path, args):
  21. print("fallback, received '{}'".format(path))
  22.  
  23. def test_single_channel_single_bus_sine_follower_delay(dest):
  24. liblo.send(dest, "/cyperus/address", "10.0.0.126", "97217")
  25. response = responses.get()
  26. print('/cyperus/address: ', response)
  27.  
  28. if __name__ == '__main__':
  29. #outgoing connection
  30. dest = liblo.Address('10.0.0.181', 97211)
  31.  
  32. #incoming server
  33. server = OscServer()
  34.  
  35. server.start()
  36.  
  37. test_single_channel_single_bus_sine_follower_delay(dest)
  38.  
  39. input("press enter to quit...\n")
  40. ```
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement