本文整理汇总了Python中CeciliaLib.getControlPanel方法的典型用法代码示例。如果您正苦于以下问题:Python CeciliaLib.getControlPanel方法的具体用法?Python CeciliaLib.getControlPanel怎么用?Python CeciliaLib.getControlPanel使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类CeciliaLib
的用法示例。
在下文中一共展示了CeciliaLib.getControlPanel方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: applyBatchProcessingPreset
# 需要导入模块: import CeciliaLib [as 别名]
# 或者: from CeciliaLib import getControlPanel [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()
示例2: onPlayStop
# 需要导入模块: import CeciliaLib [as 别名]
# 或者: from CeciliaLib import getControlPanel [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()
示例3: applyBatchProcessingFolder
# 需要导入模块: import CeciliaLib [as 别名]
# 或者: from CeciliaLib import getControlPanel [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)
示例4: onUpdateInterface
# 需要导入模块: import CeciliaLib [as 别名]
# 或者: from CeciliaLib import getControlPanel [as 别名]
def onUpdateInterface(self, event):
if event != None:
snds = []
if CeciliaLib.getVar("rememberedSound"):
for key in CeciliaLib.getVar("userInputs").keys():
if CeciliaLib.getVar("userInputs")[key]['path'] != '':
snds.append(CeciliaLib.getVar("userInputs")[key]['path'])
if CeciliaLib.getVar("audioServer").isAudioServerRunning():
CeciliaLib.stopCeciliaSound()
self.closeInterface()
CeciliaLib.parseInterfaceText()
title = os.path.split(CeciliaLib.getVar("currentCeciliaFile", unicode=True))[1]
ceciliaInterface = CeciliaInterface.CeciliaInterface(None, title='Interface - %s' % title, mainFrame=self)
ceciliaInterface.SetSize(CeciliaLib.getVar("interfaceSize"))
ceciliaInterface.SetPosition(CeciliaLib.getVar("interfacePosition"))
CeciliaLib.setVar("interface", ceciliaInterface)
if CeciliaLib.getVar("presets") != {}:
CeciliaLib.getVar("presetPanel").loadPresets()
if event != None:
for i, cfilein in enumerate(CeciliaLib.getControlPanel().getCfileinList()):
if i >= len(snds):
break
cfilein.onLoadFile(snds[i])
示例5: onBounceToDisk
# 需要导入模块: import CeciliaLib [as 别名]
# 或者: from CeciliaLib import getControlPanel [as 别名]
def onBounceToDisk(self, event):
CeciliaLib.getControlPanel().onBounceToDisk()