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


Python CeciliaLib.getAudioPort方法代码示例

本文整理汇总了Python中CeciliaLib.getAudioPort方法的典型用法代码示例。如果您正苦于以下问题:Python CeciliaLib.getAudioPort方法的具体用法?Python CeciliaLib.getAudioPort怎么用?Python CeciliaLib.getAudioPort使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在CeciliaLib的用法示例。


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

示例1: createAudioPanel

# 需要导入模块: import CeciliaLib [as 别名]
# 或者: from CeciliaLib import getAudioPort [as 别名]
    def createAudioPanel(self, panel):        
        audioParamPanel = wx.Panel(panel)
        audioParamPanel.SetBackgroundColour(BACKGROUND_COLOUR)
        
        box = wx.BoxSizer(wx.VERTICAL)

        # Audio driver
        box1 = wx.BoxSizer(wx.HORIZONTAL)
        textInOutConfig = wx.StaticText(audioParamPanel, 0, 'Audio Driver :')
        textInOutConfig.SetFont(self.font)       
        self.driverChoice = CustomMenu(audioParamPanel, choice=AUDIO_DRIVERS, 
                                       init=CeciliaLib.getAudioPort(), 
                                       outFunction=self.onDriverPageChange)

        box1.Add(textInOutConfig, 0, wx.LEFT | wx.ALIGN_CENTER_VERTICAL, PADDING)
        box1.AddStretchSpacer()
        box1.Add(self.driverChoice, 1, wx.RIGHT | wx.ALIGN_CENTER_VERTICAL, 0)
        
        # Audio driver panels
        self.driverBox = wx.BoxSizer(wx.VERTICAL)
        self.driverCurrentPane = self.driverChoice.getLabel()
        self.driverPanels = {}
        coreaudioPane = self.createCoreaudioPane(audioParamPanel)
        portaudioPane = self.createPortaudioPane(audioParamPanel)
        jackPane = self.createJackPane(audioParamPanel)
        if self.driverCurrentPane != 'CoreAudio':
            coreaudioPane.Hide()
        if self.driverCurrentPane != 'PortAudio':    
            portaudioPane.Hide()
        if self.driverCurrentPane != 'Jack':
            jackPane.Hide()
        self.driverPanels['CoreAudio'] = coreaudioPane
        self.driverPanels['PortAudio'] = portaudioPane
        self.driverPanels['Jack'] = jackPane
        self.driverBox.Add(self.driverPanels[self.driverCurrentPane])
        
        box2 = wx.BoxSizer(wx.HORIZONTAL)
        # File Format
        textFileFormat = wx.StaticText(audioParamPanel, 0, 'File Format :')
        textFileFormat.SetFont(self.font)       
        self.choiceFileFormat = CustomMenu(audioParamPanel, choice=AUDIO_FILE_FORMATS, 
                                      init=CeciliaLib.getFileType(), outFunction=self.changeFileType)
        box2.Add(textFileFormat, 0, wx.LEFT | wx.ALIGN_CENTER_VERTICAL, PADDING)
        box2.AddStretchSpacer()
        box2.Add(self.choiceFileFormat, 1, wx.RIGHT | wx.ALIGN_CENTER_VERTICAL, 0)
        
        # Bit depth
        box3 = wx.BoxSizer(wx.HORIZONTAL)
        textBD = wx.StaticText(audioParamPanel, 0, 'Bit Depth :')
        textBD.SetFont(self.font)       
        self.choiceBD = CustomMenu(audioParamPanel, choice=BIT_DEPTHS.keys(), outFunction=self.changeSampSize)
        box3.Add(textBD, 0, wx.LEFT | wx.ALIGN_CENTER_VERTICAL, PADDING)
        box3.AddStretchSpacer()
        box3.Add(self.choiceBD, 1, wx.RIGHT | wx.ALIGN_CENTER_VERTICAL, 0)
        
        for item in BIT_DEPTHS.items():
            if item[1]==CeciliaLib.getSampleSize():
                self.choiceBD.setStringSelection(item[0])
                        
        # Number of channels
        formats, selectedNCHNLS = self.defineFormatsList()
        
        box4 = wx.BoxSizer(wx.HORIZONTAL)
        textNCHNLS = wx.StaticText(audioParamPanel, 0, '# of channels :')
        textNCHNLS.SetFont(self.font)       
        self.choiceNCHNLS = CustomMenu(audioParamPanel, choice=formats, 
                            init=selectedNCHNLS, outFunction=self.changeNchnls)        
        box4.Add(textNCHNLS, 0, wx.LEFT | wx.ALIGN_CENTER_VERTICAL, PADDING)
        box4.AddStretchSpacer()
        box4.Add(self.choiceNCHNLS, 1, wx.RIGHT | wx.ALIGN_CENTER_VERTICAL, 0)
 
        # Sampling rate
        box5 = wx.BoxSizer(wx.HORIZONTAL)
        textSR = wx.StaticText(audioParamPanel, 0, 'Sample Rate :')
        textSR.SetFont(self.font)       
        self.comboSR = CustomMenu(audioParamPanel, choice=SAMPLE_RATES, 
                            init=str(CeciliaLib.getSr()), outFunction=self.changeSr)        
        box5.Add(textSR, 0, wx.LEFT | wx.ALIGN_CENTER_VERTICAL, PADDING)
        box5.AddStretchSpacer()
        box5.Add(self.comboSR, 1, wx.RIGHT | wx.ALIGN_CENTER_VERTICAL, 0)

        box.Add(box1, 0, wx.EXPAND)
        box.AddSpacer(20)
        box.Add(self.driverBox)
        box.AddSpacer([60,30,20,60][['CoreAudio', 'PortAudio', 'Jack'].index(self.driverCurrentPane)])
        box.Add(box2, 0, wx.EXPAND)
        box.Add(box3, 0, wx.EXPAND | wx.TOP, 5)
        box.Add(box4, 0, wx.EXPAND | wx.TOP, 5)
        box.Add(box5, 0, wx.EXPAND | wx.TOP, 5)
        audioParamPanel.SetSizerAndFit(box)
        return audioParamPanel
开发者ID:belangeo,项目名称:cecilia4csound,代码行数:93,代码来源:PreferencePanel.py


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