本文整理汇总了Python中CeciliaLib.getVar方法的典型用法代码示例。如果您正苦于以下问题:Python CeciliaLib.getVar方法的具体用法?Python CeciliaLib.getVar怎么用?Python CeciliaLib.getVar使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类CeciliaLib
的用法示例。
在下文中一共展示了CeciliaLib.getVar方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: onEntry
# 需要导入模块: import CeciliaLib [as 别名]
# 或者: from CeciliaLib import getVar [as 别名]
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)
示例2: applyBatchProcessingPreset
# 需要导入模块: import CeciliaLib [as 别名]
# 或者: from CeciliaLib import getVar [as 别名]
def applyBatchProcessingPreset(self, value):
folderName = value
if folderName == "":
return
cfileins = CeciliaLib.getControlPanel().getCfileinList()
presets = CeciliaLib.getVar("presetPanel").getPresets()
if "init" in presets:
presets.remove("init")
if "last save" in presets:
presets.remove("last save")
num_presets = len(presets)
dlg = wx.ProgressDialog("Batch processing on preset sequence", "", maximum = num_presets, parent=self,
style = wx.PD_APP_MODAL | wx.PD_AUTO_HIDE | wx.PD_SMOOTH)
dlg.SetMinSize((600,-1))
dlg.SetClientSize((600,100))
count = 0
for preset in presets:
CeciliaLib.loadPresetFromDict(preset)
if len(cfileins) == 0:
path = os.path.join(os.path.expanduser("~"), "Desktop")
name = "batch"
ext = "."+CeciliaLib.getVar("audioFileType")
else:
path, fname = os.path.split(cfileins[0].filePath)
name, ext = os.path.splitext(fname)
if not os.path.isdir(os.path.join(path, folderName)):
os.mkdir(os.path.join(path, folderName))
filename = os.path.join(path, folderName, "%s-%s%s" % (name, preset, ext))
count += 1
(keepGoing, skip) = dlg.Update(count, "Exporting %s" % filename)
CeciliaLib.getControlPanel().onBatchProcessing(filename)
while (CeciliaLib.getVar("audioServer").isAudioServerRunning()):
time.sleep(.1)
dlg.Destroy()
示例3: onRememberInputSound
# 需要导入模块: import CeciliaLib [as 别名]
# 或者: from CeciliaLib import getVar [as 别名]
def onRememberInputSound(self, event):
if event.GetInt() == 1:
CeciliaLib.getVar("interface").menubar.editMenu.FindItemById(ID_REMEMBER).Check(True)
CeciliaLib.setVar("rememberedSound", True)
else:
CeciliaLib.getVar("interface").menubar.editMenu.FindItemById(ID_REMEMBER).Check(False)
CeciliaLib.setVar("rememberedSound", False)
示例4: onPlayStop
# 需要导入模块: import CeciliaLib [as 别名]
# 或者: from CeciliaLib import getVar [as 别名]
def onPlayStop(self, value):
if value:
CeciliaLib.getControlPanel().nonZeroTime = 0
CeciliaLib.setVar("toDac", True)
CeciliaLib.getVar("grapher").toolbar.loadingMsg.SetForegroundColour("#FFFFFF")
CeciliaLib.getVar("grapher").toolbar.loadingMsg.Refresh()
CeciliaLib.getControlPanel().transportButtons.setPlay(True)
wx.CallLater(50, CeciliaLib.startCeciliaSound, True)
else:
CeciliaLib.stopCeciliaSound()
示例5: onClose
# 需要导入模块: import CeciliaLib [as 别名]
# 或者: from CeciliaLib import getVar [as 别名]
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()
示例6: marioSwitch
# 需要导入模块: import CeciliaLib [as 别名]
# 或者: from CeciliaLib import getVar [as 别名]
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()
示例7: updateTitle
# 需要导入模块: import CeciliaLib [as 别名]
# 或者: from CeciliaLib import getVar [as 别名]
def updateTitle(self, isModified=False):
if CeciliaLib.getVar("builtinModule"):
file = os.path.split(CeciliaLib.getVar("currentCeciliaFile", unicode=True))[1]
else:
file = CeciliaLib.getVar("currentCeciliaFile", unicode=True)
title = os.path.split(CeciliaLib.getVar("currentCeciliaFile", unicode=True))[1]
if not isModified:
if CeciliaLib.getVar("interface"):
CeciliaLib.getVar("interface").updateTitle('Interface - ' + title)
else:
if CeciliaLib.getVar("interface"):
CeciliaLib.getVar("interface").updateTitle('*** Interface - ' + title + ' ***')
示例8: createTogglePopupPanel
# 需要导入模块: import CeciliaLib [as 别名]
# 或者: from CeciliaLib import getVar [as 别名]
def createTogglePopupPanel(self):
if CeciliaLib.getVar("systemPlatform") == "win32":
BORDER = wx.DOUBLE_BORDER
else:
BORDER = wx.SIMPLE_BORDER
panel = wx.Panel(self, -1, style=BORDER)
panel.SetBackgroundColour(BACKGROUND_COLOUR)
widgets = CeciliaLib.getVar("interfaceWidgets")
box, objs = buildTogglePopupBox(panel, widgets)
panel.SetSizerAndFit(box)
CeciliaLib.setVar("userTogglePopups", objs)
size = panel.GetSize()
return panel, objs, size
示例9: createSlidersPanel
# 需要导入模块: import CeciliaLib [as 别名]
# 或者: from CeciliaLib import getVar [as 别名]
def createSlidersPanel(self):
if CeciliaLib.getVar("systemPlatform") == "win32":
BORDER = wx.DOUBLE_BORDER
else:
BORDER = wx.SIMPLE_BORDER
panel = wx.Panel(self, -1, style=BORDER)
panel.SetBackgroundColour(BACKGROUND_COLOUR)
widgets = CeciliaLib.getVar("interfaceWidgets")
box, sl = buildHorizontalSlidersBox(panel, widgets)
CeciliaLib.setVar("userSliders", sl)
panel.SetSizerAndFit(box)
size = panel.GetSize()
return panel, size
示例10: __init__
# 需要导入模块: import CeciliaLib [as 别名]
# 或者: from CeciliaLib import getVar [as 别名]
def __init__(
self, parent, id=-1, title="", mainFrame=None, pos=wx.DefaultPosition, size=wx.DefaultSize, style=style
):
wx.Frame.__init__(self, parent, id, title, pos, size, style)
self.SetBackgroundColour(BACKGROUND_COLOUR)
self.ceciliaMainFrame = mainFrame
self.menubar = InterfaceMenuBar(self, self.ceciliaMainFrame)
self.SetMenuBar(self.menubar)
self.box = wx.GridBagSizer(0, 0)
self.controlBox = wx.BoxSizer(wx.VERTICAL)
self.controlPanel = Control.CECControl(self, -1)
togglePopupPanel, objs, tpsize = self.createTogglePopupPanel()
slidersPanel, slPanelSize = self.createSlidersPanel()
self.grapher = getGrapher(self)
CeciliaLib.setVar("grapher", self.grapher)
presetPanel = Preset.CECPreset(self)
CeciliaLib.setVar("presetPanel", presetPanel)
self.controlBox.Add(self.controlPanel, 1, wx.EXPAND | wx.RIGHT, -1)
self.controlBox.Add(presetPanel, 0, wx.EXPAND | wx.TOP | wx.RIGHT, -1)
self.controlBox.Add(togglePopupPanel, 0, wx.EXPAND | wx.TOP | wx.RIGHT, -1)
self.box.Add(self.controlBox, (0, 0), span=(2, 1), flag=wx.EXPAND)
self.box.Add(self.grapher, (0, 1), flag=wx.EXPAND)
self.box.Add(slidersPanel, (1, 1), flag=wx.EXPAND | wx.TOP, border=-1)
self.box.AddGrowableCol(1, 1)
self.box.AddGrowableRow(0, 1)
pos = CeciliaLib.getVar("interfacePosition")
size = CeciliaLib.getVar("interfaceSize")
pos, size = self.positionToClientArea(pos, size)
self.SetSizer(self.box)
self.SetSize(size)
self.Bind(wx.EVT_CLOSE, self.onClose)
if pos == None:
self.Center()
else:
self.SetPosition(pos)
self.Show(True)
wx.CallAfter(self.createGrapher)
示例11: applyBatchProcessingFolder
# 需要导入模块: import CeciliaLib [as 别名]
# 或者: from CeciliaLib import getVar [as 别名]
def applyBatchProcessingFolder(self, value):
folderName = value
if folderName == "":
return
old_file_type = CeciliaLib.getVar("audioFileType")
cfileins = CeciliaLib.getControlPanel().getCfileinList()
num_snds = len(cfileins[0].fileMenu.choice)
dlg = wx.ProgressDialog("Batch processing on sound folder", "", maximum = num_snds, parent=self,
style = wx.PD_APP_MODAL | wx.PD_AUTO_HIDE | wx.PD_SMOOTH)
dlg.SetMinSize((600,-1))
dlg.SetClientSize((600,100))
count = 0
totaltime = CeciliaLib.getVar("totalTime")
for snd in cfileins[0].fileMenu.choice:
cfileins[0].onSelectSound(-1, snd)
if CeciliaLib.getVar("useSoundDur"):
cfileins[0].setTotalTime()
path, dump = os.path.split(cfileins[0].filePath)
name, ext = os.path.splitext(snd)
lext = ext.lower()
if lext in [".wav", ".wave"]:
CeciliaLib.setVar('audioFileType', "wav")
elif lext in [".aif", ".aiff", ".aifc"]:
CeciliaLib.setVar('audioFileType', "aif")
elif lext in [".ogg"]:
CeciliaLib.setVar('audioFileType', "ogg")
elif lext in [".flac"]:
CeciliaLib.setVar('audioFileType', "flac")
elif lext in [".au"]:
CeciliaLib.setVar('audioFileType', "au")
elif lext in [".sd2"]:
CeciliaLib.setVar('audioFileType', "sd2")
elif lext in [".caf"]:
CeciliaLib.setVar('audioFileType', "caf")
if not os.path.isdir(os.path.join(path, folderName)):
os.mkdir(os.path.join(path, folderName))
filename = os.path.join(path, folderName, "%s-%s%s" % (name, folderName, ext))
count += 1
(keepGoing, skip) = dlg.Update(count, "Exporting %s" % filename)
CeciliaLib.getControlPanel().onBatchProcessing(filename)
while (CeciliaLib.getVar("audioServer").isAudioServerRunning()):
time.sleep(.1)
if CeciliaLib.getVar("useSoundDur"):
CeciliaLib.getControlPanel().setTotalTime(totaltime)
CeciliaLib.getControlPanel().updateDurationSlider()
dlg.Destroy()
CeciliaLib.setVar('audioFileType', old_file_type)
示例12: onSavePreset
# 需要导入模块: import CeciliaLib [as 别名]
# 或者: from CeciliaLib import getVar [as 别名]
def onSavePreset(self):
dlg = wx.TextEntryDialog(self, 'Enter preset name:','Saving Preset', self.currentPreset)
if dlg.ShowModal() == wx.ID_OK:
newPreset = CeciliaLib.ensureNFD(dlg.GetValue())
else:
return
dlg.Destroy()
if newPreset == '':
CeciliaLib.showErrorDialog('Failed saving preset', 'You must give a name to your preset!')
return
if newPreset == 'init':
CeciliaLib.showErrorDialog('Failed saving preset', '"init" is reserved. You must give another name to your preset!')
return
if newPreset in CeciliaLib.getVar("presets").keys():
dlg2 = wx.MessageDialog(self, 'The preset you entered already exists. Are you sure you want to overwrite it?',
'Existing preset!', wx.YES_NO | wx.NO_DEFAULT | wx.ICON_INFORMATION)
if dlg2.ShowModal() == wx.ID_NO:
return
dlg2.Destroy()
self.currentPreset = newPreset
CeciliaLib.savePresetToDict(self.currentPreset)
self.presetChoice.setChoice(self.orderingPresetNames(), False)
self.presetChoice.setStringSelection(self.currentPreset)
示例13: positionToClientArea
# 需要导入模块: import CeciliaLib [as 别名]
# 或者: from CeciliaLib import getVar [as 别名]
def positionToClientArea(self, pos, size):
position = None
screen = 0
if pos != None:
for i in range(CeciliaLib.getVar("numDisplays")):
off = CeciliaLib.getVar("displayOffset")[i]
dispsize = CeciliaLib.getVar("displaySize")[i]
Xbounds = [off[0], dispsize[0] + off[0]]
Ybounds = [off[1], dispsize[1] + off[1]]
if pos[0] >= Xbounds[0] and pos[0] <= Xbounds[1] and pos[1] >= Ybounds[0] and pos[1] <= Ybounds[1]:
position = pos
screen = i
break
dispsize = CeciliaLib.getVar("displaySize")[screen]
if size[0] <= dispsize[0] and size[1] <= dispsize[1]:
newsize = size
else:
newsize = (dispsize[0] - 50, dispsize[1] - 50)
return position, newsize
示例14: onDeletePreset
# 需要导入模块: import CeciliaLib [as 别名]
# 或者: from CeciliaLib import getVar [as 别名]
def onDeletePreset(self):
if CeciliaLib.getVar("presets").has_key(self.currentPreset):
dlg2 = wx.MessageDialog(self, 'Preset %s will be deleted. Are you sure?' % self.currentPreset,
'Warning!', wx.YES_NO | wx.NO_DEFAULT | wx.ICON_INFORMATION)
if dlg2.ShowModal() == wx.ID_NO: ok = False
else: ok = True
dlg2.Destroy()
if ok:
CeciliaLib.deletePreset(self.currentPreset)
self.presetChoice.setChoice(self.orderingPresetNames(), False)
self.presetChoice.setStringSelection("")
示例15: onOpenPrefModule
# 需要导入模块: import CeciliaLib [as 别名]
# 或者: from CeciliaLib import getVar [as 别名]
def onOpenPrefModule(self, event):
menu = self.GetMenuBar()
id = event.GetId()
file = menu.FindItemById(id)
filename = file.GetLabel()
filedir = file.GetMenu().GetTitle()
prefPath = CeciliaLib.getVar("prefferedPath")
prefPaths = prefPath.split(';')
prefBaseNames = [os.path.basename(path) for path in prefPaths]
dirname = prefPaths[prefBaseNames.index(filedir)]
if dirname:
name = os.path.join(dirname, filename)
CeciliaLib.openCeciliaFile(self, name)
self.updateTitle()