本文整理汇总了Python中QLiveLib.getVar方法的典型用法代码示例。如果您正苦于以下问题:Python QLiveLib.getVar方法的具体用法?Python QLiveLib.getVar怎么用?Python QLiveLib.getVar使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类QLiveLib
的用法示例。
在下文中一共展示了QLiveLib.getVar方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: assignMidiCtl
# 需要导入模块: import QLiveLib [as 别名]
# 或者: from QLiveLib import getVar [as 别名]
def assignMidiCtl(self, num, which):
self.midiBindings[num] = which
if which == "up":
self.upButton.SetToolTip(QLiveTooltip("Midi key: %d" % num))
elif which == "down":
self.downButton.SetToolTip(QLiveTooltip("Midi key: %d" % num))
QLiveLib.getVar("MidiServer").bind("noteon", num, self.midi)
示例2: revertMidiAssignation
# 需要导入模块: import QLiveLib [as 别名]
# 或者: from QLiveLib import getVar [as 别名]
def revertMidiAssignation(self):
self.midiscanning = False
QLiveLib.getVar("MidiServer").ctlscan(None)
self.slider.setMidiLearn(False)
QLiveLib.getVar("MidiServer").unbind("ctls", self.slider.midictl,
self.midi)
self.slider.setMidiCtl(None)
示例3: connectAudioMixer
# 需要导入模块: import QLiveLib [as 别名]
# 或者: from QLiveLib import getVar [as 别名]
def connectAudioMixer(self):
audioMixer = QLiveLib.getVar("AudioMixer")
audioServer = QLiveLib.getVar("AudioServer")
for obj in self.buttonsInputs:
if obj.name == "AudioIn":
inchnls = obj.getInChannels()
ismulti = obj.getIsMultiChannels()
channels = [audioMixer.getInputChannel(i).getOutput()
for i in range(NUM_INPUTS) if inchnls[i]]
if not ismulti:
channels = sum(channels)
obj.setInput(channels)
elif obj.name == "Soundfile":
id = obj.getSoundfileId()
if id is not None:
source = audioServer.getSoundfiles()[id]
if source:
obj.setInput(source.looper)
for i, obj in enumerate(self.buttonsFxs):
if obj.name == "AudioOut":
chnls = len(obj.getOutput())
outchnls = obj.getOutChannels()
channels = [j for j in range(NUM_OUTPUTS) if outchnls[j]]
for j in range(chnls):
audioMixer.addToMixer(channels[j % len(channels)],
obj.getOutput()[j])
示例4: setSaveState
# 需要导入模块: import QLiveLib [as 别名]
# 或者: from QLiveLib import getVar [as 别名]
def setSaveState(self, state):
if state:
self.cueMidiNotes = state["cueMidiNotes"]
for val, state in self.cueMidiNotes.items():
if state in ["up", "down"]:
QLiveLib.getVar("ControlPanel").setButtonTooltip(state,
"Midi key: %d" % val)
示例5: doLabelAction
# 需要导入模块: import QLiveLib [as 别名]
# 或者: from QLiveLib import getVar [as 别名]
def doLabelAction(self, evt):
if evt.GetId() == 1: # Duplicate
obj = self.objects[self.selRow]
id = obj.getId()
filename = obj.getFilename()
new = SoundFileObject(id, filename)
new.copy(obj)
self.selRow += 1
self.objects.insert(self.selRow, new)
self.addRow(index=self.selRow)
self.putObjectAttrOnCells(new, self.selRow)
for id in [ID_COL_TRANSPO, ID_COL_GAIN, ID_COL_STARTPOINT,
ID_COL_ENDPOINT, ID_COL_CROSSFADE, ID_COL_CHANNEL]:
attr = self.GetOrCreateCellAttr(self.selRow, id)
attr.SetReadOnly(False)
elif evt.GetId() == 2: # Delete
QLiveLib.getVar("FxTracks").checkForDeletedSoundfile(self.selRow)
del self.objects[self.selRow]
self.DeleteRows(self.selRow, 1, True)
if evt.GetId() in [3, 4]: # Show parameter values/interpolation times
self.objects[self.selRow].setShowInterp(evt.GetId() - 3)
self.putObjectAttrOnCells(self.objects[self.selRow], self.selRow)
if evt.GetId() == 5:
self.objects[self.selRow].openTranspoAutomationWindow()
elif evt.GetId() == 6:
self.objects[self.selRow].openGainAutomationWindow()
for i, obj in enumerate(self.objects):
obj.setId(i)
示例6: onClose
# 需要导入模块: import QLiveLib [as 别名]
# 或者: from QLiveLib import getVar [as 别名]
def onClose(self, evt):
if self.tabAudio.reinit_server:
try:
QLiveLib.getVar("AudioServer").reinitServer()
except:
pass
self.Destroy()
示例7: onMidiLearn
# 需要导入模块: import QLiveLib [as 别名]
# 或者: from QLiveLib import getVar [as 别名]
def onMidiLearn(self, evt):
QLiveLib.setVar("MidiLearnMode", evt.GetInt())
if evt.GetInt():
QLiveLib.getVar("MixerPanel").SetBackgroundColour(MIDILEARN_COLOUR)
QLiveLib.setVar("CanProcessCueKeys", False)
else:
QLiveLib.getVar("MixerPanel").SetBackgroundColour(BACKGROUND_COLOUR)
QLiveLib.setVar("CanProcessCueKeys", True)
示例8: onMoveCue
# 需要导入模块: import QLiveLib [as 别名]
# 或者: from QLiveLib import getVar [as 别名]
def onMoveCue(self, evt):
if QLiveLib.getVar("CanProcessCueKeys"):
cues = QLiveLib.getVar("CuesPanel")
current = cues.getCurrentCue()
if evt.GetId() == self.prevId:
cues.onCueSelection(current - 1)
elif evt.GetId() == self.nextId:
cues.onCueSelection(current + 1)
示例9: __init__
# 需要导入模块: import QLiveLib [as 别名]
# 或者: from QLiveLib import getVar [as 别名]
def __init__(self, parent):
wx.Panel.__init__(self, parent, size=(95, -1), style=wx.SUNKEN_BORDER)
self.mainSizer = wx.BoxSizer(wx.VERTICAL)
self.newAddSizer = wx.BoxSizer(wx.HORIZONTAL)
self.upDownSizer = wx.BoxSizer(wx.HORIZONTAL)
self.learnButton = None
self.buttons = TransportButtons(self,
playCallback=QLiveLib.getVar("AudioServer").start,
recordCallback=QLiveLib.getVar("AudioServer").record)
self.mainSizer.Add(self.buttons, 0, wx.ALIGN_CENTER_HORIZONTAL)
self.mainSizer.Add(wx.StaticLine(self, size=(1, 1)), 0,
wx.EXPAND|wx.LEFT|wx.RIGHT|wx.BOTTOM, 5)
title = wx.StaticText(self, label="-- CUES --")
self.mainSizer.Add(title, 0, wx.ALIGN_CENTER, 5)
#button = wx.Button(self,wx.ID_OK, label="Interp Time" )
#self.mainSizer.Add(button, 0, wx.ALIGN_CENTER, 5)
#button.Bind(wx.EVT_BUTTON, self.onSetInterpTime)
bmp = wx.Bitmap(ICON_ADD, wx.BITMAP_TYPE_PNG)
self.newButton = wx.BitmapButton(self, wx.ID_ANY, bmp)
self.newButton.Bind(wx.EVT_BUTTON, self.onNewCue)
self.newAddSizer.Add(self.newButton, 1)
bmp = wx.Bitmap(ICON_DELETE, wx.BITMAP_TYPE_PNG)
self.delButton = wx.BitmapButton(self, wx.ID_ANY, bmp)
self.delButton.Bind(wx.EVT_BUTTON, self.onDelCue)
self.newAddSizer.Add(self.delButton, 1)
self.mainSizer.Add(self.newAddSizer, 0, wx.EXPAND|wx.ALL, 5)
self.upbmp = wx.Bitmap(ICON_ARROW_UP, wx.BITMAP_TYPE_PNG)
self.upmidbmp = wx.Bitmap(ICON_ARROW_UP_MIDI, wx.BITMAP_TYPE_PNG)
self.upButton = wx.BitmapButton(self, wx.ID_ANY, self.upbmp)
self.upButton.Bind(wx.EVT_BUTTON, self.onMoveCueUp)
self.upButton.Bind(wx.EVT_RIGHT_DOWN, self.midiLearn)
self.upTooltip = wx.ToolTip("")
self.upButton.SetToolTip(self.upTooltip)
self.upDownSizer.Add(self.upButton, 1)
self.downbmp = wx.Bitmap(ICON_ARROW_DOWN, wx.BITMAP_TYPE_PNG)
self.downmidbmp = wx.Bitmap(ICON_ARROW_DOWN_MIDI, wx.BITMAP_TYPE_PNG)
self.downButton = wx.BitmapButton(self, wx.ID_ANY, self.downbmp)
self.downButton.Bind(wx.EVT_BUTTON, self.onMoveCueDown)
self.downButton.Bind(wx.EVT_RIGHT_DOWN, self.midiLearn)
self.downTooltip = wx.ToolTip("")
self.downButton.SetToolTip(self.downTooltip)
self.upDownSizer.Add(self.downButton, 1)
self.mainSizer.Add(self.upDownSizer, 0,
wx.EXPAND|wx.LEFT|wx.RIGHT|wx.BOTTOM, 5)
self.SetSizerAndFit(self.mainSizer)
示例10: handleMidiScan
# 需要导入模块: import QLiveLib [as 别名]
# 或者: from QLiveLib import getVar [as 别名]
def handleMidiScan(self):
if not self.midiscanning:
self.midiscanning = True
QLiveLib.getVar("MidiServer").ctlscan(self.getMidiScan)
self.setMidiBackgroundColour(MIDILEARN_COLOUR)
else:
self.midiscanning = False
QLiveLib.getVar("MidiServer").ctlscan(None)
self.revertMidiBackgroundColour()
示例11: handleMidiScan
# 需要导入模块: import QLiveLib [as 别名]
# 或者: from QLiveLib import getVar [as 别名]
def handleMidiScan(self):
if not self.midiscanning:
self.midiscanning = True
QLiveLib.getVar("MidiServer").ctlscan(self.getMidiScan)
self.slider.setMidiLearn(True)
else:
self.midiscanning = False
QLiveLib.getVar("MidiServer").ctlscan(None)
self.slider.setMidiLearn(False)
示例12: cueMidiLearnCallback
# 需要导入模块: import QLiveLib [as 别名]
# 或者: from QLiveLib import getVar [as 别名]
def cueMidiLearnCallback(self, val, ctl=False):
if ctl:
self.cueMidiCtls[val] = self.cueMidiLearnState
else:
self.cueMidiNotes[val] = self.cueMidiLearnState
QLiveLib.getVar("ControlPanel").setButtonTooltip(self.cueMidiLearnState,
"Midi key: %d" % val)
self.cueMidiLearnState = None
QLiveLib.getVar("ControlPanel").resetCueButtonBackgroundColour()
示例13: deleteButton
# 需要导入模块: import QLiveLib [as 别名]
# 或者: from QLiveLib import getVar [as 别名]
def deleteButton(self, but):
# work only for fxs, not for inputs
but.delete()
self.buttonsFxs.remove(but)
for i, but in enumerate(self.buttonsFxs):
id = but.getId()
id[0] = i
but.setId(id)
QLiveLib.getVar("FxTracks").drawAndRefresh()
示例14: saveFile
# 需要导入模块: import QLiveLib [as 别名]
# 或者: from QLiveLib import getVar [as 别名]
def saveFile(self, path):
QLiveLib.getVar("CuesPanel").onSaveCue()
dictSave = self.getCurrentState()
self.saveState = copy.deepcopy(dictSave)
QLiveLib.setVar("currentProject", path)
QLiveLib.setVar("projectFolder", os.path.dirname(path))
with open(path, "w") as f:
f.write(QLIVE_MAGIC_LINE)
f.write("### %s ###\n" % APP_VERSION)
f.write("dictSave = %s" % pprint.pformat(dictSave, indent=4))
示例15: recStart
# 需要导入模块: import QLiveLib [as 别名]
# 或者: from QLiveLib import getVar [as 别名]
def recStart(self, filename="", fileformat=0, sampletype=0):
self.server.recordOptions(fileformat=fileformat, sampletype=sampletype)
if not filename:
filename = os.path.basename(QLiveLib.getVar("currentProject"))
filename, ext = os.path.splitext(filename)
filename = os.path.join(QLiveLib.getVar("projectFolder"), "bounce", filename)
if fileformat >= 0 and fileformat < 8:
ext = RECORD_EXTENSIONS[fileformat]
else:
ext = ".wav"
date = time.strftime('_%d_%b_%Y_%Hh%M')
complete_filename = QLiveLib.toSysEncoding(filename+date+ext)
self.server.recstart(complete_filename)