本文整理汇总了Python中QLiveLib.setVar方法的典型用法代码示例。如果您正苦于以下问题:Python QLiveLib.setVar方法的具体用法?Python QLiveLib.setVar怎么用?Python QLiveLib.setVar使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类QLiveLib
的用法示例。
在下文中一共展示了QLiveLib.setVar方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: keyDown
# 需要导入模块: import QLiveLib [as 别名]
# 或者: from QLiveLib import setVar [as 别名]
def keyDown(self, event):
if QLiveLib.getVar("MidiLearnMode"):
if event.GetKeyCode() in [wx.WXK_BACK, wx.WXK_DELETE,
wx.WXK_NUMPAD_DELETE]:
self.revertMidiAssignation()
event.Skip()
return
if self.selected:
char = ''
if event.GetKeyCode() in range(324, 334):
char = str(event.GetKeyCode() - 324)
elif event.GetKeyCode() == 390:
char = '-'
elif event.GetKeyCode() == 391:
char = '.'
elif event.GetKeyCode() == wx.WXK_BACK:
if self.new != '':
self.new = self.new[0:-1]
self.labelChanged()
elif event.GetKeyCode() < 256:
char = chr(event.GetKeyCode())
if char in ['0','1','2','3','4','5','6','7','8','9','.','-']:
self.new += char
self.labelChanged()
elif event.GetKeyCode() in [wx.WXK_RETURN, wx.WXK_NUMPAD_ENTER]:
self.SetValue(eval(self.new))
self.new = ''
self.selected = False
QLiveLib.setVar("CanProcessCueKeys", True)
wx.CallAfter(self.Refresh)
event.Skip()
示例2: output
# 需要导入模块: import QLiveLib [as 别名]
# 或者: from QLiveLib import setVar [as 别名]
def output(self, evt):
if self.previous in ["", ".", "-"]:
self.previous = "0"
self.value = 0
self.ChangeValue(self.previous)
if self.callback is not None:
self.callback(self.value, self.interp)
QLiveLib.setVar("CanProcessCueKeys", True)
示例3: setMidiLearn
# 需要导入模块: import QLiveLib [as 别名]
# 或者: from QLiveLib import setVar [as 别名]
def setMidiLearn(self, state):
self.midiLearn = state
if self.midiLearn:
QLiveLib.setVar("CanProcessCueKeys", False)
self.backColour = MIDILEARN_COLOUR
else:
QLiveLib.setVar("CanProcessCueKeys", True)
self.backColour = CONTROLSLIDER_BACK_COLOUR
wx.CallAfter(self.Refresh)
示例4: DoubleClick
# 需要导入模块: import QLiveLib [as 别名]
# 或者: from QLiveLib import setVar [as 别名]
def DoubleClick(self, event):
if QLiveLib.getVar("MidiLearnMode"):
return
w, h = self.GetSize()
pos = event.GetPosition()
if self.textrect.Contains(pos):
QLiveLib.setVar("CanProcessCueKeys", False)
self.selected = True
wx.CallAfter(self.Refresh)
event.Skip()
示例5: onApply
# 需要导入模块: import QLiveLib [as 别名]
# 或者: from QLiveLib import setVar [as 别名]
def onApply(self, evt):
cue = self.cueButton.GetSelection() # 0 = current, 1 = all
track = self.trackButton.GetSelection() # 0 = current, 1 = all, 2 = none
snd = self.sndButton.GetSelection() # 0 = current, 1 = all = 2 = none
value = self.knob.GetValue() # interpolation time in secs
meth = self.method.GetSelection() # 0 = overwrite, 1 = add, 2 = sub
if meth == 0:
QLiveLib.setVar("globalInterpTime", value)
if self.callback is not None:
self.callback(cue, track, snd, value, meth)
示例6: saveFile
# 需要导入模块: import QLiveLib [as 别名]
# 或者: from QLiveLib import setVar [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))
示例7: SetValue
# 需要导入模块: import QLiveLib [as 别名]
# 或者: from QLiveLib import setVar [as 别名]
def SetValue(self, value, propagate=True):
self.propagate = propagate
if self.HasCapture():
self.ReleaseMouse()
value = clamp(value, self.minvalue, self.maxvalue)
t = tFromValue(value, self.minvalue, self.maxvalue)
self.value = interpFloat(t, self.minvalue, self.maxvalue)
self.clampPos()
self.selected = False
QLiveLib.setVar("CanProcessCueKeys", True)
self.valueChanged()
wx.CallAfter(self.Refresh)
示例8: MouseMotion
# 需要导入模块: import QLiveLib [as 别名]
# 或者: from QLiveLib import setVar [as 别名]
def MouseMotion(self, evt):
if QLiveLib.getVar("MidiLearnMode"):
return
posY = evt.GetPosition()[1]
h = self.GetSize()[1] - self.meterOffset
if evt.LeftIsDown() and evt.Dragging():
self.pos = clamp(posY, self.knobHalfSize, h-self.knobHalfSize)
self.value = self.scale()
self.selected = False
QLiveLib.setVar("CanProcessCueKeys", True)
self.valueChanged()
wx.CallAfter(self.Refresh)
示例9: filter
# 需要导入模块: import QLiveLib [as 别名]
# 或者: from QLiveLib import setVar [as 别名]
def filter(self, evt):
QLiveLib.setVar("CanProcessCueKeys", False)
value = self.GetValue().strip()
# numeric check
if value.count(".") > 1 or value.count("-") > 1:
self.ChangeValue(self.previous)
elif value in ["", ".", "-"]:
self.previous = value
elif value and all(x in '0123456789.-' for x in value):
self.previous = value
try:
tmp = float(value)
except:
tmp = 0
if self.mode == 0:
self.value = tmp
else:
self.interp = tmp
else:
self.ChangeValue(self.previous)
示例10: MouseDown
# 需要导入模块: import QLiveLib [as 别名]
# 或者: from QLiveLib import setVar [as 别名]
def MouseDown(self, evt):
if QLiveLib.getVar("MidiLearnMode"):
self.parent.handleMidiScan()
evt.Skip()
return
w, h = self.GetSize()
if self._enable:
rec = wx.Rect(5, 13, 45, 45)
pos = evt.GetPosition()
if rec.Contains(pos):
self.clickPos = wx.GetMousePosition()
self.oldValue = self.value
self.CaptureMouse()
self.selected = False
rec = wx.Rect(w-15, 69, 15, 15)
if rec.Contains(pos):
self.showEdit = not self.showEdit
self.editFunction(self.showEdit)
QLiveLib.setVar("CanProcessCueKeys", True)
wx.CallAfter(self.Refresh)
evt.Skip()
示例11: onMidiLearn
# 需要导入模块: import QLiveLib [as 别名]
# 或者: from QLiveLib import setVar [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)
示例12: loadFile
# 需要导入模块: import QLiveLib [as 别名]
# 或者: from QLiveLib import setVar [as 别名]
def loadFile(self, path):
with open(path, "r") as f:
magicline = f.readline()
if magicline != QLIVE_MAGIC_LINE:
print "The file loaded is not a valid QLive file."
return
self.tracks.close()
execfile(path, globals())
if path == NEW_FILE_PATH:
QLiveLib.setVar("currentProject", "")
QLiveLib.setVar("projectFolder", "")
else:
QLiveLib.setVar("currentProject", path)
QLiveLib.setVar("projectFolder", os.path.dirname(path))
self.newRecent(path)
self.saveState = copy.deepcopy(dictSave)
self.tracks.setSaveState(self.saveState["tracks"])
self.cues.setSaveDict(self.saveState["cues"])
self.mixer.setSaveDict(self.saveState["mixer"])
self.audioServer.setSaveState(self.saveState.get("server", {}))
if "soundfiles" in self.saveState:
self.soundfiles.setSaveState(self.saveState["soundfiles"])
linkMenuItem = self.GetMenuBar().FindItemById(LINK_STEREO_ID)
linkMenuItem.Check(dictSave["mixer"].get("inputLinked", False))
示例13: __init__
# 需要导入模块: import QLiveLib [as 别名]
# 或者: from QLiveLib import setVar [as 别名]
def __init__(self, pos, size):
wx.Frame.__init__(self, None, pos=pos, size=size)
self.SetMinSize((600, 400))
self.SetTitle("QLive Session")
# Status bar, the third filed is unused yet.
self.status = self.CreateStatusBar(3)
self.status.SetStatusWidths([100, 100, -1])
self.status.SetStatusText("CPU: 0.0 %", 0)
self.status.SetStatusText("MEM: 0.00 Mb", 1)
# Retrieve the current process
self.process = psutil.Process()
# Start a timer to update CPU and memory usage
self.timer = wx.Timer(self)
self.Bind(wx.EVT_TIMER, self.updateUsage, self.timer)
self.timer.Start(1000)
self.audioServer = AudioServer()
QLiveLib.setVar("AudioServer", self.audioServer)
self.saveState = None
menubar = wx.MenuBar()
menu1 = wx.Menu()
menu1.Append(wx.ID_NEW, "New\tCtrl+N")
self.Bind(wx.EVT_MENU, self.onNew, id=wx.ID_NEW)
menu1.Append(wx.ID_OPEN, "Open\tCtrl+O")
self.Bind(wx.EVT_MENU, self.onLoad, id=wx.ID_OPEN)
self.submenu1 = wx.Menu()
ID_OPEN_RECENT = 2000
recentFiles = []
filename = QLiveLib.ensureNFD(OPEN_RECENT_PATH)
if os.path.isfile(filename):
f = codecs.open(filename, "r", encoding="utf-8")
for line in f.readlines():
recentFiles.append(line.replace("\n", ""))
f.close()
if recentFiles:
for file in recentFiles:
self.submenu1.Append(ID_OPEN_RECENT, file)
self.Bind(wx.EVT_MENU, self.openRecent, id=ID_OPEN_RECENT)
ID_OPEN_RECENT += 1
menu1.AppendMenu(1999, "Open Recent...", self.submenu1)
menu1.AppendSeparator()
menu1.Append(wx.ID_CLOSE, "Close\tCtrl+W")
self.Bind(wx.EVT_MENU, self.onClose, id=wx.ID_CLOSE)
menu1.Append(wx.ID_SAVE, "Save\tCtrl+S")
self.Bind(wx.EVT_MENU, self.onSave, id=wx.ID_SAVE)
menu1.Append(wx.ID_SAVEAS, "Save As...\tShift+Ctrl+S")
self.Bind(wx.EVT_MENU, self.onSaveAs, id=wx.ID_SAVEAS)
if PLATFORM != "darwin":
menu1.AppendSeparator()
prefItem = menu1.Append(wx.ID_PREFERENCES, "Preferences...\tCtrl+;")
self.Bind(wx.EVT_MENU, self.openPrefs, prefItem)
if PLATFORM != "darwin":
menu1.AppendSeparator()
quitItem = menu1.Append(wx.ID_EXIT, "Quit\tCtrl+Q")
self.Bind(wx.EVT_MENU, self.OnClose, quitItem)
menubar.Append(menu1, 'File')
menu2 = wx.Menu()
menu2.Append(NEW_TRACK_ID, "Add Track\tCtrl+T")
self.Bind(wx.EVT_MENU, self.onNewTrack, id=NEW_TRACK_ID)
menu2.Append(DELETE_TRACK_ID, "Delete Track\tShift+Ctrl+D")
self.Bind(wx.EVT_MENU, self.onDeleteTrack, id=DELETE_TRACK_ID)
menubar.Append(menu2, 'Tracks')
menu3 = wx.Menu()
menu3.AppendCheckItem(LINK_STEREO_ID, "Link Mixer Sliders\tCtrl+L")
self.Bind(wx.EVT_MENU, self.onLinkSliders, id=LINK_STEREO_ID)
menubar.Append(menu3, 'Mixer')
self.SetMenuBar(menubar)
tabId = wx.NewId()
self.prevId = wx.NewId()
self.nextId = wx.NewId()
accel_tbl = wx.AcceleratorTable([(wx.ACCEL_NORMAL, wx.WXK_TAB, tabId),
(wx.ACCEL_NORMAL, wx.WXK_LEFT, self.prevId),
(wx.ACCEL_NORMAL, wx.WXK_RIGHT, self.nextId)])
self.SetAcceleratorTable(accel_tbl)
self.Bind(wx.EVT_MENU, self.onTabulate, id=tabId)
self.Bind(wx.EVT_MENU, self.onMoveCue, id=self.prevId, id2=self.nextId)
self.mainPanel = wx.Panel(self, style=wx.SUNKEN_BORDER)
self.mainPanel.SetBackgroundColour(BACKGROUND_COLOUR)
self.audioMixer = AudioMixer()
QLiveLib.setVar("AudioMixer", self.audioMixer)
self.controlPanel = ControlPanel(self.mainPanel)
QLiveLib.setVar("ControlPanel", self.controlPanel)
csize = self.controlPanel.GetSize()
self.cues = CuesPanel(self.mainPanel, size=(csize[0], 1000))
QLiveLib.setVar("CuesPanel", self.cues)
#.........这里部分代码省略.........
示例14: onfocus
# 需要导入模块: import QLiveLib [as 别名]
# 或者: from QLiveLib import setVar [as 别名]
def onfocus(self, evt):
QLiveLib.setVar("CanProcessCueKeys", False)
示例15: doubleClick
# 需要导入模块: import QLiveLib [as 别名]
# 或者: from QLiveLib import setVar [as 别名]
def doubleClick(self, evt):
self.SelectAll()
QLiveLib.setVar("CanProcessCueKeys", False)