当前位置: 首页>>代码示例>>Python>>正文


Python QLiveLib类代码示例

本文整理汇总了Python中QLiveLib的典型用法代码示例。如果您正苦于以下问题:Python QLiveLib类的具体用法?Python QLiveLib怎么用?Python QLiveLib使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。


在下文中一共展示了QLiveLib类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。

示例1: connectAudioMixer

    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])
开发者ID:belangeo,项目名称:qlive,代码行数:28,代码来源:FxTrack.py

示例2: assignMidiCtl

 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)
开发者ID:belangeo,项目名称:qlive,代码行数:7,代码来源:CuesPanel.py

示例3: doLabelAction

    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)
开发者ID:belangeo,项目名称:qlive,代码行数:31,代码来源:SoundFilePanel.py

示例4: revertMidiAssignation

 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)
开发者ID:belangeo,项目名称:qlive,代码行数:7,代码来源:FxView.py

示例5: keyDown

 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()
开发者ID:belangeo,项目名称:qlive,代码行数:31,代码来源:Widgets.py

示例6: setSaveState

 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)
开发者ID:lucasParis,项目名称:QLive,代码行数:7,代码来源:AudioServer.py

示例7: onClose

 def onClose(self, evt):
     if self.tabAudio.reinit_server:
         try:
             QLiveLib.getVar("AudioServer").reinitServer()
         except:
             pass
     self.Destroy()
开发者ID:belangeo,项目名称:qlive,代码行数:7,代码来源:PreferencePanel.py

示例8: output

 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)
开发者ID:belangeo,项目名称:qlive,代码行数:8,代码来源:Widgets.py

示例9: onMoveCue

 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)
开发者ID:tiagovaz,项目名称:qlive,代码行数:8,代码来源:FxView.py

示例10: onMidiLearn

 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)
开发者ID:belangeo,项目名称:qlive,代码行数:8,代码来源:MainWindow.py

示例11: __init__

    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)
开发者ID:lucasParis,项目名称:QLive,代码行数:58,代码来源:CuesPanel.py

示例12: handleMidiScan

 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)
开发者ID:belangeo,项目名称:qlive,代码行数:9,代码来源:FxView.py

示例13: setMidiLearn

 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)
开发者ID:belangeo,项目名称:qlive,代码行数:9,代码来源:Widgets.py

示例14: cueMidiLearnCallback

 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()
开发者ID:lucasParis,项目名称:QLive,代码行数:9,代码来源:AudioServer.py

示例15: deleteButton

 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()
开发者ID:lucasParis,项目名称:QLive,代码行数:9,代码来源:FxTrack.py


注:本文中的QLiveLib类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。