|
|
@@ -57,6 +57,72 @@ class InputPanel(wx.Panel): |
|
|
|
except OSCClientError: |
|
|
|
pass |
|
|
|
|
|
|
|
class DelayPanel(wx.Panel): |
|
|
|
''' Handle the ADC input settings ''' |
|
|
|
def __init__(self, parent): |
|
|
|
''' Constructor ''' |
|
|
|
wx.Panel.__init__(self, parent) |
|
|
|
sizer = wx.BoxSizer(wx.VERTICAL) |
|
|
|
|
|
|
|
label = wx.StaticText(self, label="Delay line:") |
|
|
|
font = label.GetFont(); font.SetWeight(wx.BOLD); label.SetFont(font) |
|
|
|
sizer.Add(label, 0, wx.TOP|wx.BOTTOM|wx.RIGHT, 5) |
|
|
|
|
|
|
|
self.delayTime=OSCSlider(self, "Delay time (s)", default_value=5, max_value=10) |
|
|
|
sizer.Add(self.delayTime, 0, wx.EXPAND|wx.ALL, 5) |
|
|
|
|
|
|
|
self.feedback=OSCSlider(self, "Feedback", default_value=.95) |
|
|
|
sizer.Add(self.feedback, 0, wx.EXPAND|wx.ALL, 5) |
|
|
|
|
|
|
|
self.SetSizerAndFit(sizer) |
|
|
|
self.delayTime.slider.Bind(wx.EVT_SCROLL, self.update) |
|
|
|
self.feedback.slider.Bind(wx.EVT_SCROLL, self.update) |
|
|
|
self.update(None) |
|
|
|
|
|
|
|
def update(self, evt): |
|
|
|
""" Send OSC messages """ |
|
|
|
a=self.delayTime.slider.GetValue()/100. |
|
|
|
b=self.feedback.slider.GetValue()/100. |
|
|
|
try: |
|
|
|
sendOSCMsg("/delay", [a, b]) |
|
|
|
except OSCClientError: |
|
|
|
pass |
|
|
|
|
|
|
|
class Channel(wx.Panel): |
|
|
|
""" A single channel """ |
|
|
|
def __init__(self, parent, index): |
|
|
|
self.index=index |
|
|
|
wx.Panel.__init__(self, parent) |
|
|
|
sizer = wx.BoxSizer(wx.VERTICAL) |
|
|
|
self.SetBackgroundColour((255,0,0)) |
|
|
|
|
|
|
|
label = wx.StaticText(self, label="CH%d" % self.index) |
|
|
|
font = label.GetFont(); font.SetWeight(wx.BOLD); label.SetFont(font) |
|
|
|
sizer.Add(label, 0, wx.TOP|wx.BOTTOM|wx.RIGHT, 5) |
|
|
|
self.SetSizerAndFit(sizer) |
|
|
|
|
|
|
|
|
|
|
|
class ChannelPanel(wx.Panel): |
|
|
|
''' All the channels ''' |
|
|
|
def __init__(self, parent): |
|
|
|
''' Constructor ''' |
|
|
|
wx.Panel.__init__(self, parent) |
|
|
|
sizer = wx.BoxSizer(wx.HORIZONTAL) |
|
|
|
|
|
|
|
self.channels=[] |
|
|
|
for i in range(4): |
|
|
|
c=Channel(self, index=i) |
|
|
|
#self.feedback.slider.Bind(wx.EVT_SCROLL, self.update) |
|
|
|
self.channels.append(c) |
|
|
|
sizer.Add(c, 1, wx.EXPAND) |
|
|
|
|
|
|
|
self.SetSizerAndFit(sizer) |
|
|
|
self.update(None) |
|
|
|
|
|
|
|
def update(self, evt): |
|
|
|
""" Send OSC messages """ |
|
|
|
pass |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
class MainGUI(wx.Frame): |
|
|
@@ -79,14 +145,16 @@ class MainGUI(wx.Frame): |
|
|
|
self.inputPanel = InputPanel(self) |
|
|
|
self.mainsizer.Add(self.inputPanel, 0, wx.EXPAND|wx.ALL, 5) |
|
|
|
|
|
|
|
line=wx.StaticLine(self) |
|
|
|
self.mainsizer.Add(line, 0, wx.EXPAND|wx.ALL, 5) |
|
|
|
line=wx.StaticLine(self); self.mainsizer.Add(line, 0, wx.EXPAND|wx.ALL, 5) |
|
|
|
|
|
|
|
self.delayTime=OSCSlider(self, "Delay time (s)", default_value=5, max_value=10) |
|
|
|
self.mainsizer.Add(self.delayTime, 0, wx.EXPAND|wx.ALL, 5) |
|
|
|
self.delayPanel = DelayPanel(self) |
|
|
|
self.mainsizer.Add(self.delayPanel, 0, wx.EXPAND|wx.ALL, 5) |
|
|
|
|
|
|
|
line=wx.StaticLine(self); self.mainsizer.Add(line, 0, wx.EXPAND|wx.ALL, 5) |
|
|
|
|
|
|
|
self.channelPanel = ChannelPanel(self) |
|
|
|
self.mainsizer.Add(self.channelPanel, 1, wx.EXPAND|wx.ALL, 5) |
|
|
|
|
|
|
|
self.feedback=OSCSlider(self, "Feedback", default_value=.95) |
|
|
|
self.mainsizer.Add(self.feedback, 0, wx.EXPAND|wx.ALL, 5) |
|
|
|
|
|
|
|
# Put things together |
|
|
|
self.SetSizerAndFit(self.mainsizer) |
|
|
|