Sampler in ChucK
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

53 lines
1.3KB

  1. from libs.simpleosc import *
  2. import wx
  3. def testosc():
  4. server = OSCServer (("127.0.0.1", 9000))
  5. server.addDefaultHandlers()
  6. initOSCClient(port=9000)
  7. sendOSCMsg("/test", [.1])
  8. closeOSC()
  9. class gui_head(wx.Frame):
  10. """ A simple GUI to talk to Chuck """
  11. def __init__(self):
  12. """ Constructor """
  13. # Build the interface
  14. self.app = wx.App(False)
  15. self.build()
  16. self.app.MainLoop()
  17. def build(self):
  18. """ Builds the various pieces of the GUI """
  19. wx.Frame.__init__(self, None, title="Controls", size=(500,100))
  20. self.Bind(wx.EVT_CLOSE, self.quit)
  21. # The main sizer
  22. self.mainsizer = wx.BoxSizer(wx.HORIZONTAL)
  23. # Bits and pieces
  24. self.status=wx.StaticText(self, label="Parameter", style=wx.ST_NO_AUTORESIZE)
  25. self.mainsizer.Add(self.status, 0)
  26. self.slider=wx.Slider(self, value=0, minValue=0, maxValue=100)
  27. self.mainsizer.Add(self.slider, 1)
  28. # Put things together
  29. self.SetSizerAndFit(self.mainsizer)
  30. self.Show()
  31. self.SetSize((700,500))
  32. def populate_left_panel(self):
  33. """ Populate the left panel """
  34. # Status boxes
  35. def quit(self, *args):
  36. """ Close down gracefully, and then destroy the window """
  37. self.Destroy()
  38. if __name__ == "__main__":
  39. gui_head()