本文整理汇总了Python中CeciliaLib类的典型用法代码示例。如果您正苦于以下问题:Python CeciliaLib类的具体用法?Python CeciliaLib怎么用?Python CeciliaLib使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了CeciliaLib类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: createCeciliaPanel
def createCeciliaPanel(self, panel):
ceciliaPanel = wx.Panel(panel)
ceciliaPanel.SetBackgroundColour(BACKGROUND_COLOUR)
gridSizer = wx.FlexGridSizer(3,3,10,3)
textTotalTime = wx.StaticText(ceciliaPanel, 0, 'Total time default (sec) :')
textTotalTime.SetFont(self.font)
self.choiceTotalTime = CustomMenu(ceciliaPanel,
choice= ["10.0", "30.0", "60.0", "120.0", "300.0", "600.0", "1200.0", "2400.0", "3600.0"],
init=str(CeciliaLib.getDefaultTotalTime()), outFunction=self.changeDefaultTotalTime)
textUseTooltips = wx.StaticText(ceciliaPanel, 0, 'Use tooltips :')
textUseTooltips.SetFont(self.font)
self.tooltipsToggle = Toggle(ceciliaPanel, CeciliaLib.getUseTooltips(), outFunction=self.enableTooltips)
textgraphTexture = wx.StaticText(ceciliaPanel, 0, 'Use grapher texture :')
textgraphTexture.SetFont(self.font)
self.textureToggle = Toggle(ceciliaPanel, CeciliaLib.getUseGraphTexture(), outFunction=self.enableGraphTexture)
gridSizer.AddMany([
(textTotalTime, 0, wx.LEFT | wx.ALIGN_CENTER_VERTICAL, PADDING),
(wx.StaticText(ceciliaPanel, -1, '', size=(86,-1)), 1, wx.EXPAND),
(self.choiceTotalTime, 0, wx.ALIGN_CENTER_VERTICAL),
(textUseTooltips, 0, wx.LEFT | wx.ALIGN_CENTER_VERTICAL, PADDING),
(wx.StaticText(ceciliaPanel, -1, ''), 1, wx.EXPAND),
(self.tooltipsToggle, 0, wx.ALIGN_CENTER_VERTICAL),
(textgraphTexture, 0, wx.LEFT | wx.ALIGN_CENTER_VERTICAL, PADDING),
(wx.StaticText(ceciliaPanel, -1, ''), 1, wx.EXPAND),
(self.textureToggle, 0, wx.ALIGN_CENTER_VERTICAL),
])
gridSizer.AddGrowableCol(1, 1)
ceciliaPanel.SetSizerAndFit(gridSizer)
return ceciliaPanel
示例2: changeKsmps
def changeKsmps(self, index, label):
ksmps = int(self.choiceKsmps.getLabel().strip())
CeciliaLib.setKsmps(ksmps)
sr = CeciliaLib.getSr()
kr = sr/ksmps
CeciliaLib.setKr(kr)
示例3: createCsoundPanel
def createCsoundPanel(self, panel):
csoundPanel = wx.Panel(panel)
csoundPanel.SetBackgroundColour(BACKGROUND_COLOUR)
gridSizer = wx.FlexGridSizer(3,3,10,3)
textKsmps = wx.StaticText(csoundPanel, 0, 'ksmps :')
textKsmps.SetFont(self.font)
self.choiceKsmps = CustomMenu(csoundPanel, choice= ["1", "2", "5", "10", "25", "50", "100"],
init=str(CeciliaLib.getKsmps()), outFunction=self.changeKsmps)
textHardbuff = wx.StaticText(csoundPanel, 0, 'Hardware buffer :')
textHardbuff.SetFont(self.font)
self.choiceHardBuff = CustomMenu(csoundPanel, choice=HARD_BUFF_SIZES,
init=str(CeciliaLib.getHardBuf()), outFunction=self.changeHardBuff)
textSoftbuff = wx.StaticText(csoundPanel, 0, 'Software buffer :')
textSoftbuff.SetFont(self.font)
self.choiceSoftBuff = CustomMenu(csoundPanel, choice=SOFT_BUFF_SIZES,
init=str(CeciliaLib.getSoftBuf()), outFunction=self.changeSoftBuff)
gridSizer.AddMany([
(textKsmps, 0, wx.LEFT | wx.ALIGN_CENTER_VERTICAL, PADDING),
(wx.StaticText(csoundPanel, -1, '', size=(125,-1)), 1, wx.EXPAND),
(self.choiceKsmps, 0, wx.ALIGN_CENTER_VERTICAL),
(textHardbuff, 0, wx.LEFT | wx.ALIGN_CENTER_VERTICAL, PADDING),
(wx.StaticText(csoundPanel, -1, ''), 1, wx.EXPAND),
(self.choiceHardBuff, 0, wx.ALIGN_CENTER_VERTICAL),
(textSoftbuff, 0, wx.LEFT | wx.ALIGN_CENTER_VERTICAL, PADDING),
(wx.StaticText(csoundPanel, -1, ''), 1, wx.EXPAND),
(self.choiceSoftBuff, 0, wx.ALIGN_CENTER_VERTICAL),
])
gridSizer.AddGrowableCol(1, 1)
csoundPanel.SetSizerAndFit(gridSizer)
return csoundPanel
示例4: onEntry
def onEntry(self, value):
if type(value) != ListType:
value = self.convertToList(value)
if CeciliaLib.getVar("currentModule") != None and self.rate == "k":
getattr(CeciliaLib.getVar("currentModule"), self.name)(value)
if self.popup != None:
self.popup[0].setValue(self.popup[1], True)
示例5: createPortmidiPane
def createPortmidiPane(self, panel):
portmidiPanel = wx.Panel(panel)
portmidiPanel.SetBackgroundColour(BACKGROUND_COLOUR)
gridSizer = wx.FlexGridSizer(5, 3, 5, 5)
# Input
textIn = wx.StaticText(portmidiPanel, 0, 'Input Device :')
textIn.SetFont(self.font)
availableMidiIns = []
for d in CeciliaLib.getAvailableMidiInputs():
availableMidiIns.append(CeciliaLib.ensureNFD(d))
if availableMidiIns != [] and 'All' not in availableMidiIns:
availableMidiIns.append('All')
if CeciliaLib.getMidiDeviceIn() != '':
try:
initInput = availableMidiIns[int(CeciliaLib.getMidiDeviceIn())]
except:
initInput = 'dump'
else:
initInput = 'dump'
self.midiChoiceInput = CustomMenu(portmidiPanel, choice=availableMidiIns,
init=initInput, size=(168,20), outFunction=self.changeMidiInput)
gridSizer.AddMany([
(textIn, 0, wx.LEFT | wx.ALIGN_CENTER_VERTICAL, PADDING),
(wx.StaticText(portmidiPanel, -1, '', size=(74,-1)), 1, wx.EXPAND),
(self.midiChoiceInput, 0, wx.ALIGN_CENTER_VERTICAL),
])
gridSizer.AddGrowableCol(1, 1)
portmidiPanel.SetSizerAndFit(gridSizer)
return portmidiPanel
示例6: changeSr
def changeSr(self, index, label):
sr = int(label.strip())
CeciliaLib.setSr(sr)
ksmps = CeciliaLib.getKsmps()
kr = sr/ksmps
CeciliaLib.setKr(kr)
示例7: changeSoftBuff
def changeSoftBuff(self, index, label):
softBuff = int(self.choiceSoftBuff.getLabel())
if softBuff > CeciliaLib.getHardBuf():
self.choiceSoftBuff.setLabel(str(CeciliaLib.getSoftBuf()))
else:
CeciliaLib.setSoftBuf(softBuff)
示例8: onDriverPageChange
def onDriverPageChange(self, index, label):
CeciliaLib.setAudioPort(label)
self.driverPanels[self.driverCurrentPane].Hide()
self.driverPanels[label].Show()
self.driverPanels[label].SetPosition(self.driverBox.GetPosition())
self.driverBox.Replace(self.driverPanels[self.driverCurrentPane], self.driverPanels[label])
self.driverCurrentPane = label
self.Refresh()
示例9: createTogglePopupPanel
def createTogglePopupPanel(self):
panel = wx.Panel(self, -1, style=wx.SIMPLE_BORDER)
panel.SetBackgroundColour(BACKGROUND_COLOUR)
box, objs = buildTogglePopupBox(panel, CeciliaLib.getInterfaceWidgets())
panel.SetSizerAndFit(box)
CeciliaLib.setUserTogglePopups(objs)
size = panel.GetSize()
return panel, objs, size
示例10: createHorizontalSlidersPanel
def createHorizontalSlidersPanel(self):
panel = wx.Panel(self, -1, style=wx.SIMPLE_BORDER)
panel.SetBackgroundColour(BACKGROUND_COLOUR)
box, sl = buildHorizontalSlidersBox(panel, CeciliaLib.getInterfaceWidgets())
CeciliaLib.setUserSliders(sl)
panel.SetSizerAndFit(box)
size = panel.GetSize()
return panel, size
示例11: getText
def getText(self):
globalOuts =['gaGlobalOut%d' % i for i in range(CeciliaLib.getNchnls())]
text = ''
text += 'k%s init %d\n' % (self.presetName, self.preset.getIndex())
text += 'k%s chnget "%s_value"\n' % (self.presetName, self.presetName)
for i in range(CeciliaLib.getNchnls()):
text += '%s plugin_gate %s, gk%s, gk%s, gk%s, k%s\n' % (globalOuts[i], globalOuts[i], self.knob1.getName(), self.knob2.getName(), self.knob3.getName(), self.presetName)
return text
示例12: createPathsPanel
def createPathsPanel(self, panel):
pathsPanel = wx.Panel(panel)
pathsPanel.SetBackgroundColour(BACKGROUND_COLOUR)
gridSizer = wx.FlexGridSizer(0,2,2,5)
#Soundfile Player
textSfPlayerLabel = wx.StaticText(pathsPanel, -1, 'Soundfile Player :')
textSfPlayerLabel.SetFont(self.font)
self.textSfPlayerPath = wx.TextCtrl(pathsPanel, -1, CeciliaLib.getSoundfilePlayerPath(),
size=(270,16), style=wx.TE_PROCESS_ENTER|wx.NO_BORDER)
self.textSfPlayerPath.SetFont(self.font)
self.textSfPlayerPath.Bind(wx.EVT_TEXT_ENTER, self.handleSfPlayerPath)
self.textSfPlayerPath.SetForegroundColour((50,50,50))
self.textSfPlayerPath.SetBackgroundColour("#AAAAAA")
buttonSfPlayerPath = CloseBox(pathsPanel, outFunction=self.changeSfPlayer, label='Set...')
#Soundfile Editor
textSfEditorLabel = wx.StaticText(pathsPanel, -1, 'Soundfile Editor :')
textSfEditorLabel.SetFont(self.font)
self.textSfEditorPath = wx.TextCtrl(pathsPanel, -1, CeciliaLib.getSoundfileEditorPath(),
size=(270,16), style=wx.TE_PROCESS_ENTER|wx.NO_BORDER)
self.textSfEditorPath.SetFont(self.font)
self.textSfEditorPath.Bind(wx.EVT_TEXT_ENTER, self.handleSfEditorPath)
self.textSfEditorPath.SetForegroundColour((50,50,50))
self.textSfEditorPath.SetBackgroundColour("#AAAAAA")
buttonSfEditorPath = CloseBox(pathsPanel, outFunction=self.changeSfEditor, label='Set...')
textPrefPathLabel = wx.StaticText(pathsPanel, -1, 'Preferred paths :')
textPrefPathLabel.SetFont(self.font)
self.textPrefPath = wx.TextCtrl(pathsPanel, -1, CeciliaLib.getPrefPath(),
size=(270,16), style=wx.TE_PROCESS_ENTER|wx.NO_BORDER)
self.textPrefPath.SetFont(self.font)
self.textPrefPath.Bind(wx.EVT_TEXT_ENTER, self.handleEditPrefPath)
self.textPrefPath.SetForegroundColour((50,50,50))
self.textPrefPath.SetBackgroundColour("#AAAAAA")
buttonPrefPath = CloseBox(pathsPanel, outFunction=self.addPrefPath, label='Add...')
gridSizer.AddMany([
(textSfPlayerLabel, 0, wx.EXPAND | wx.LEFT, PADDING),
(wx.StaticText(pathsPanel), 0, wx.EXPAND | wx.RIGHT, 15),
(self.textSfPlayerPath, 0, wx.EXPAND | wx.LEFT | wx.ALIGN_CENTER_VERTICAL, PADDING),
(buttonSfPlayerPath, 0, wx.RIGHT, 15),
(textSfEditorLabel, 0, wx.EXPAND | wx.LEFT | wx.TOP, PADDING),
(wx.StaticText(pathsPanel, -1, ''), 0, wx.EXPAND | wx.RIGHT, 15),
(self.textSfEditorPath, 0, wx.EXPAND | wx.LEFT | wx.ALIGN_CENTER_VERTICAL, PADDING),
(buttonSfEditorPath, 0, wx.RIGHT, 15),
(textPrefPathLabel, 0, wx.EXPAND | wx.LEFT | wx.TOP, PADDING),
(wx.StaticText(pathsPanel, -1, ''), 0, wx.EXPAND | wx.RIGHT, 15),
(self.textPrefPath, 0, wx.EXPAND | wx.LEFT | wx.ALIGN_CENTER_VERTICAL, PADDING),
(buttonPrefPath, 0, wx.RIGHT, 15),
])
gridSizer.AddGrowableCol(0, 1)
self.textPrefPath.Navigate()
panel.SetSizerAndFit(gridSizer)
return pathsPanel
示例13: onClose
def onClose(self, event):
CeciliaLib.setVar("interfaceSize", self.GetSize())
CeciliaLib.setVar("interfacePosition", self.GetPosition())
CeciliaLib.resetWidgetVariables()
try:
self.Destroy()
except:
pass
CeciliaLib.getVar("mainFrame").SetFocus()
CeciliaLib.getVar("mainFrame").Hide()
示例14: openRecent
def openRecent(self, event):
menu = self.GetMenuBar()
id = event.GetId()
file = menu.FindItemById(id).GetLabel()
if os.path.isfile(file[:-1]):
CeciliaLib.openCeciliaFile(self, file[:-1])
self.updateTitle()
else:
CeciliaLib.showErrorDialog("Error while trying to open a file!", "No such file : %s" % file[:-1])
self.newRecent(file[:-1], remove=True)
示例15: marioSwitch
def marioSwitch(self, evt):
if evt.GetInt() == 1:
self.FindItemById(ID_MARIO).Check(1)
for slider in CeciliaLib.getVar("userSliders"):
slider.slider.useMario = True
slider.slider.Refresh()
else:
self.FindItemById(ID_MARIO).Check(0)
for slider in CeciliaLib.getVar("userSliders"):
slider.slider.useMario = False
slider.slider.Refresh()