Exemplo n.º 1
0
 def newRecent(self, file):
     filename = QLiveLib.ensureNFD(OPEN_RECENT_PATH)
     lines = QLiveLib.getRecentFiles()
     if not file in lines:
         f = codecs.open(filename, "w", encoding="utf-8")
         lines.insert(0, file)
         if len(lines) > 20:
             lines = lines[0:20]
         for line in lines:
             f.write(line + '\n')
         f.close()
     subId = 2000
     if lines != []:
         for item in self.submenu1.GetMenuItems():
             self.submenu1.DeleteItem(item)
         for file in lines:
             self.submenu1.Append(subId, QLiveLib.toSysEncoding(file))
             subId += 1
Exemplo n.º 2
0
 def newRecent(self, file):
     filename = QLiveLib.ensureNFD(OPEN_RECENT_PATH)
     try:
         f = codecs.open(filename, "r", encoding="utf-8")
         lines = [line.replace("\n", "") for line in f.readlines()]
         f.close()
     except:
         lines = []
     if not file in lines:
         f = codecs.open(filename, "w", encoding="utf-8")
         lines.insert(0, file)
         if len(lines) > 20:
             lines = lines[0:20]
         for line in lines:
             f.write(line + '\n')
         f.close()
     subId = 2000
     if lines != []:
         for item in self.submenu1.GetMenuItems():
             self.submenu1.DeleteItem(item)
         for file in lines:
             self.submenu1.Append(subId, QLiveLib.toSysEncoding(file))
             subId += 1
Exemplo n.º 3
0
    def __init__(self, parent):
        wx.Panel.__init__(self, parent)

        self.reinit_server = False

        # Setting audio driver
        audioDriverDefault = QLiveLib.getVar("audio")
        audioDriverLabel = wx.StaticText(self, -1, "Audio driver:")
        self.audioDriverCB = wx.ComboBox(self, -1, audioDriverDefault,
                                         wx.DefaultPosition, wx.DefaultSize,
                                         AUDIO_DRIVERS,
                                         wx.CB_READONLY|wx.TE_PROCESS_ENTER)
        self.audioDriverCB.Bind(wx.EVT_COMBOBOX, self.setAudioDriver,
                                self.audioDriverCB)

        # Portaudio: Audio Input devices
        self.inputDeviceLabel = wx.StaticText(self, -1,
                                              "Audio Input (portaudio):")

        availableAudioIns = []
        for d in QLiveLib.getVar("availableAudioInputs"):
            availableAudioIns.append(QLiveLib.ensureNFD(d))
        initInput = QLiveLib.ensureNFD(QLiveLib.getVar("audioInput"))
        self.inputDeviceCB = wx.ComboBox(self, -1, initInput,
                                         wx.DefaultPosition, wx.DefaultSize,
                                         availableAudioIns,
                                         wx.CB_READONLY|wx.TE_PROCESS_ENTER)
        self.inputDeviceCB.Bind(wx.EVT_COMBOBOX, self.setInputDevice,
                                self.inputDeviceCB)

        # Portaudio: Audio Output devices
        self.outputDeviceLabel = wx.StaticText(self, -1,
                                               "Audio Output (portaudio):")
        availableAudioOuts = []
        for d in QLiveLib.getVar("availableAudioOutputs"):
            availableAudioOuts.append(QLiveLib.ensureNFD(d))
        initOutput = QLiveLib.ensureNFD(QLiveLib.getVar("audioOutput"))
        self.outputDeviceCB = wx.ComboBox(self, -1, initOutput,
                                          wx.DefaultPosition, wx.DefaultSize,
                                          availableAudioOuts,
                                          wx.CB_READONLY|wx.TE_PROCESS_ENTER)
        self.outputDeviceCB.Bind(wx.EVT_COMBOBOX, self.setOutputDevice,
                                 self.outputDeviceCB)

        # Number of input channels
        self.numInputChannelsLabel = wx.StaticText(self, -1,
                                                     "Number of Input Channels:")

        initInputChannels = str(QLiveLib.getVar("inchnls"))
        self.numInputChannelsCB = wx.ComboBox(self, -1, initInputChannels,
                                              wx.DefaultPosition,
                                              wx.DefaultSize,
                                              [str(x) for x in range(9)],
                                              wx.CB_READONLY|wx.TE_PROCESS_ENTER)
        self.numInputChannelsCB.Bind(wx.EVT_COMBOBOX,
                                     self.setnumInputChannels,
                                     self.numInputChannelsCB)

        # Number of output channels
        self.numOutputChannelsLabel = wx.StaticText(self, -1,
                                                    "Number of Output Channels:")

        initOutputChannels = str(QLiveLib.getVar("nchnls"))
        self.numOutputChannelsCB = wx.ComboBox(self, -1, initOutputChannels,
                                               wx.DefaultPosition,
                                               wx.DefaultSize,
                                               [str(x) for x in range(9)],
                                               wx.CB_READONLY|wx.TE_PROCESS_ENTER)
        self.numOutputChannelsCB.Bind(wx.EVT_COMBOBOX,
                                      self.setnumOutputChannels,
                                      self.numOutputChannelsCB)

        # First physical input device
        self.firstPhysicalInputLabel = wx.StaticText(self, -1,
                                                     "First Physical Input:")

        initPysicalInput = str(QLiveLib.getVar("defaultFirstInput"))
        self.firstPhysicalInputCB = wx.ComboBox(self, -1, initPysicalInput,
                                            wx.DefaultPosition,
                                            wx.DefaultSize,
                                            [str(x) for x in range(36)],
                                            wx.CB_READONLY|wx.TE_PROCESS_ENTER)
        self.firstPhysicalInputCB.Bind(wx.EVT_COMBOBOX,
                                       self.setFirstPhysicalInput,
                                       self.firstPhysicalInputCB)

        # First physical output device
        self.firstPhysicalOutputLabel = wx.StaticText(self, -1,
                                                      "First Physical Output:")

        initPysicalOutput = str(QLiveLib.getVar("defaultFirstOutput"))
        self.firstPhysicalOutputCB = wx.ComboBox(self, -1, initPysicalOutput,
                                             wx.DefaultPosition,
                                             wx.DefaultSize,
                                             [str(x) for x in range(36)],
                                             wx.CB_READONLY|wx.TE_PROCESS_ENTER)
        self.firstPhysicalOutputCB.Bind(wx.EVT_COMBOBOX,
                                        self.setFirstPhysicalOutput,
                                        self.firstPhysicalOutputCB)

        # Setting buffer size
        bufferSizeDefault = QLiveLib.getVar("bufferSize")
        bufferSizeLabel = wx.StaticText(self, -1, "Buffer size:")
        self.bufferSizeCB = wx.ComboBox(self, -1, bufferSizeDefault,
                                        wx.DefaultPosition, wx.DefaultSize,
                                        BUFFER_SIZES,
                                        wx.CB_READONLY|wx.TE_PROCESS_ENTER)
        self.bufferSizeCB.Bind(wx.EVT_COMBOBOX, self.setBufferSize,
                               self.bufferSizeCB)

        # Setting sampling rate
        samplingRateDefault = QLiveLib.getVar("sr")
        samplingRateLabel = wx.StaticText(self, -1, "Sampling rate:")
        self.samplingRateCB = wx.ComboBox(self, -1, samplingRateDefault,
                                          wx.DefaultPosition, wx.DefaultSize,
                                          SAMPLE_RATES,
                                          wx.CB_READONLY|wx.TE_PROCESS_ENTER)
        self.samplingRateCB.Bind(wx.EVT_COMBOBOX, self.setSamplingRate,
                                 self.samplingRateCB)

        # Setting duplex True/False
        duplexDefault = QLiveLib.getVar("duplex")
        duplexLabel = wx.StaticText(self, -1, "Duplex:")
        self.duplexCB = wx.CheckBox(self, -1, "", style=wx.ALIGN_LEFT)
        self.duplexCB.SetValue(bool(int(QLiveLib.getVar("duplex"))))
        self.duplexCB.Bind(wx.EVT_CHECKBOX, self.setDuplex, self.duplexCB)

        # Main box
        box = wx.StaticBox(self, -1, "Audio settings")

        # Sizers
        vsizer = wx.StaticBoxSizer(box, wx.VERTICAL)
        hsizerAudioDriver = wx.BoxSizer(wx.HORIZONTAL)
        hsizerInputDevice = wx.BoxSizer(wx.HORIZONTAL)
        hsizerOutputDevice = wx.BoxSizer(wx.HORIZONTAL)
        hsizerNumInputChannels = wx.BoxSizer(wx.HORIZONTAL)
        hsizerNumOutputChannels = wx.BoxSizer(wx.HORIZONTAL)
        hsizerFirstPhysicalInput = wx.BoxSizer(wx.HORIZONTAL)
        hsizerFirstPhysicalOutput = wx.BoxSizer(wx.HORIZONTAL)
        hsizerBufferSize  = wx.BoxSizer(wx.HORIZONTAL)
        hsizerSamplingRate  = wx.BoxSizer(wx.HORIZONTAL)
        hsizerDuplex  = wx.BoxSizer(wx.HORIZONTAL)

        hsizerAudioDriver.Add(audioDriverLabel, -1, wx.ALL|wx.ALIGN_CENTER, 3)
        hsizerAudioDriver.Add(self.audioDriverCB, -1, wx.ALL, 3)

        hsizerInputDevice.Add(self.inputDeviceLabel, -1,
                              wx.ALL|wx.ALIGN_CENTER, 3)
        hsizerInputDevice.Add(self.inputDeviceCB, -1, wx.ALL, 3)

        hsizerOutputDevice.Add(self.outputDeviceLabel, -1,
                               wx.ALL|wx.ALIGN_CENTER, 3)
        hsizerOutputDevice.Add(self.outputDeviceCB, -1, wx.ALL, 3)

        hsizerNumInputChannels.Add(self.numInputChannelsLabel, -1,
                                   wx.ALL|wx.ALIGN_CENTER, 3)
        hsizerNumInputChannels.Add(self.numInputChannelsCB, -1, wx.ALL, 3)

        hsizerNumOutputChannels.Add(self.numOutputChannelsLabel, -1,
                                    wx.ALL|wx.ALIGN_CENTER, 3)
        hsizerNumOutputChannels.Add(self.numOutputChannelsCB, -1, wx.ALL, 3)

        hsizerFirstPhysicalInput.Add(self.firstPhysicalInputLabel, -1,
                                     wx.ALL|wx.ALIGN_CENTER, 3)
        hsizerFirstPhysicalInput.Add(self.firstPhysicalInputCB, -1, wx.ALL, 3)

        hsizerFirstPhysicalOutput.Add(self.firstPhysicalOutputLabel, -1,
                                      wx.ALL|wx.ALIGN_CENTER, 3)
        hsizerFirstPhysicalOutput.Add(self.firstPhysicalOutputCB, -1, wx.ALL, 3)

        hsizerBufferSize.Add(bufferSizeLabel, -1, wx.ALL|wx.ALIGN_CENTER , 3)
        hsizerBufferSize.Add(self.bufferSizeCB, -1, wx.ALL, 3)

        hsizerSamplingRate.Add(samplingRateLabel, -1,
                               wx.ALL|wx.ALIGN_CENTER , 3)
        hsizerSamplingRate.Add(self.samplingRateCB, -1, wx.ALL, 3)

        hsizerDuplex.Add(duplexLabel, -1, wx.ALL|wx.ALIGN_CENTER , 3)
        hsizerDuplex.Add(self.duplexCB, -1, wx.ALL, 3)

        vsizer.AddSpacer(5)

        m = "The changes will be effective when the preferences will be closed."
        vsizer.Add(wx.StaticText(self, -1, m), 0, wx.ALIGN_CENTER_HORIZONTAL)

        vsizer.AddSpacer(5)
        vsizer.Add(hsizerAudioDriver, 0, wx.ALL|wx.EXPAND, 0)
        vsizer.Add(hsizerInputDevice, 0, wx.ALL|wx.EXPAND, 0)
        vsizer.Add(hsizerOutputDevice, 0, wx.ALL|wx.EXPAND, 0)
        vsizer.Add(hsizerNumInputChannels, 0, wx.ALL|wx.EXPAND, 0)
        vsizer.Add(hsizerNumOutputChannels, 0, wx.ALL|wx.EXPAND, 0)
        vsizer.Add(hsizerFirstPhysicalInput, 0, wx.ALL|wx.EXPAND, 0)
        vsizer.Add(hsizerFirstPhysicalOutput, 0, wx.ALL|wx.EXPAND, 0)
        vsizer.Add(hsizerBufferSize, 0, wx.ALL|wx.EXPAND, 0)
        vsizer.Add(hsizerSamplingRate, 0, wx.ALL|wx.EXPAND, 0)
        vsizer.Add(hsizerDuplex, 0, wx.ALL|wx.EXPAND, 0)

        border = wx.BoxSizer()
        border.Add(vsizer, -1, wx.EXPAND|wx.ALL, 5)
        self.SetSizerAndFit(border)

        self.EnableDisablePortaudioOpts()
Exemplo n.º 4
0
    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)

        splitter = wx.SplitterWindow(self.mainPanel, 
                                     style=wx.SP_LIVE_UPDATE|wx.SP_3DSASH)
        
        self.tracks = FxTracks(splitter)
        QLiveLib.setVar("FxTracks", self.tracks)

        self.soundfiles = SoundFilePanel(splitter)
        QLiveLib.setVar("Soundfiles", self.soundfiles)

        splitter.SetMinimumPaneSize(60)
        splitter.SplitHorizontally(self.tracks, self.soundfiles, 350)

        self.mixer = MixerPanel(self.mainPanel, self.audioMixer)
        QLiveLib.setVar("MixerPanel", self.mixer)

        self.mainSizer = wx.BoxSizer(wx.HORIZONTAL)
        self.rightSizer = wx.BoxSizer(wx.VERTICAL)
        self.controlSizer = wx.BoxSizer(wx.VERTICAL)
        self.controlSizer.Add(self.controlPanel, 0)
        self.controlSizer.Add(self.cues, 1, wx.EXPAND)
        self.rightSizer.Add(splitter, 1, wx.EXPAND, 5)
        self.rightSizer.Add(self.mixer, 0, wx.EXPAND, 5)
        self.mainSizer.Add(self.controlSizer, 0)
        self.mainSizer.AddSizer(self.rightSizer, 2, wx.EXPAND, 5)
        self.mainPanel.SetSizer(self.mainSizer)

        wx.CallAfter(self.showIntro)
Exemplo n.º 5
0
    def __init__(self, parent):
        wx.Panel.__init__(self, parent)

        self.reinit_server = False

        # Setting audio driver
        audioDriverDefault = QLiveLib.getVar("audio")
        audioDriverLabel = wx.StaticText(self, -1, "Audio driver:")
        self.audioDriverCB = wx.ComboBox(self, -1, audioDriverDefault,
                                         wx.DefaultPosition, wx.DefaultSize,
                                         AUDIO_DRIVERS,
                                         wx.CB_READONLY|wx.TE_PROCESS_ENTER)
        self.audioDriverCB.Bind(wx.EVT_COMBOBOX, self.setAudioDriver,
                                self.audioDriverCB)

        # Portaudio: Audio Input devices
        self.inputDeviceLabel = wx.StaticText(self, -1,
                                              "Audio Input (portaudio):")

        availableAudioIns = []
        for d in QLiveLib.getVar("availableAudioInputs"):
            availableAudioIns.append(QLiveLib.ensureNFD(d))
        initInput = QLiveLib.ensureNFD(QLiveLib.getVar("audioInput"))
        self.inputDeviceCB = wx.ComboBox(self, -1, initInput,
                                         wx.DefaultPosition, wx.DefaultSize,
                                         availableAudioIns,
                                         wx.CB_READONLY|wx.TE_PROCESS_ENTER)
        self.inputDeviceCB.Bind(wx.EVT_COMBOBOX, self.setInputDevice,
                                self.inputDeviceCB)

        # Portaudio: Audio Output devices
        self.outputDeviceLabel = wx.StaticText(self, -1,
                                               "Audio Output (portaudio):")
        availableAudioOuts = []
        for d in QLiveLib.getVar("availableAudioOutputs"):
            availableAudioOuts.append(QLiveLib.ensureNFD(d))
        initOutput = QLiveLib.ensureNFD(QLiveLib.getVar("audioOutput"))
        self.outputDeviceCB = wx.ComboBox(self, -1, initOutput,
                                          wx.DefaultPosition, wx.DefaultSize,
                                          availableAudioOuts,
                                          wx.CB_READONLY|wx.TE_PROCESS_ENTER)
        self.outputDeviceCB.Bind(wx.EVT_COMBOBOX, self.setOutputDevice,
                                 self.outputDeviceCB)

        # First physical input device
        self.firstPhysicalInputLabel = wx.StaticText(self, -1,
                                                     "First Physical Input:")

        initPysicalInput = str(QLiveLib.getVar("defaultFirstInput"))
        self.firstPhysicalInputCB = wx.ComboBox(self, -1, initPysicalInput,
                                            wx.DefaultPosition,
                                            wx.DefaultSize,
                                            [str(x) for x in range(36)],
                                            wx.CB_READONLY|wx.TE_PROCESS_ENTER)
        self.firstPhysicalInputCB.Bind(wx.EVT_COMBOBOX,
                                       self.setFirstPhysicalInput,
                                       self.firstPhysicalInputCB)

        # First physical output device
        self.firstPhysicalOutputLabel = wx.StaticText(self, -1,
                                                      "First Physical Output:")

        initPysicalOutput = str(QLiveLib.getVar("defaultFirstOutput"))
        self.firstPhysicalOutputCB = wx.ComboBox(self, -1, initPysicalOutput,
                                             wx.DefaultPosition,
                                             wx.DefaultSize,
                                             [str(x) for x in range(36)],
                                             wx.CB_READONLY|wx.TE_PROCESS_ENTER)
        self.firstPhysicalOutputCB.Bind(wx.EVT_COMBOBOX,
                                        self.setFirstPhysicalOutput,
                                        self.firstPhysicalOutputCB)

        # Setting buffer size
        bufferSizeDefault = QLiveLib.getVar("bufferSize")
        bufferSizeLabel = wx.StaticText(self, -1, "Buffer size:")
        self.bufferSizeCB = wx.ComboBox(self, -1, bufferSizeDefault,
                                        wx.DefaultPosition, wx.DefaultSize,
                                        BUFFER_SIZES,
                                        wx.CB_READONLY|wx.TE_PROCESS_ENTER)
        self.bufferSizeCB.Bind(wx.EVT_COMBOBOX, self.setBufferSize,
                               self.bufferSizeCB)

        # Setting sampling rate
        samplingRateDefault = QLiveLib.getVar("sr")
        samplingRateLabel = wx.StaticText(self, -1, "Sampling rate:")
        self.samplingRateCB = wx.ComboBox(self, -1, samplingRateDefault,
                                          wx.DefaultPosition, wx.DefaultSize,
                                          SAMPLE_RATES,
                                          wx.CB_READONLY|wx.TE_PROCESS_ENTER)
        self.samplingRateCB.Bind(wx.EVT_COMBOBOX, self.setSamplingRate,
                                 self.samplingRateCB)

        # Setting duplex True/False
        duplexDefault = QLiveLib.getVar("duplex")
        duplexLabel = wx.StaticText(self, -1, "Duplex:")
        self.duplexCB = wx.CheckBox(self, -1, "", style=wx.ALIGN_LEFT)
        self.duplexCB.SetValue(bool(int(QLiveLib.getVar("duplex"))))
        self.duplexCB.Bind(wx.EVT_CHECKBOX, self.setDuplex, self.duplexCB)

        # Main box
        box = wx.StaticBox(self, -1, "Audio settings")

        # Sizers
        vsizer = wx.StaticBoxSizer(box, wx.VERTICAL)
        hsizerAudioDriver = wx.BoxSizer(wx.HORIZONTAL)
        hsizerInputDevice = wx.BoxSizer(wx.HORIZONTAL)
        hsizerOutputDevice = wx.BoxSizer(wx.HORIZONTAL)
        hsizerFirstPhysicalInput = wx.BoxSizer(wx.HORIZONTAL)
        hsizerFirstPhysicalOutput = wx.BoxSizer(wx.HORIZONTAL)
        hsizerBufferSize  = wx.BoxSizer(wx.HORIZONTAL)
        hsizerSamplingRate  = wx.BoxSizer(wx.HORIZONTAL)
        hsizerDuplex  = wx.BoxSizer(wx.HORIZONTAL)

        hsizerAudioDriver.Add(audioDriverLabel, -1, wx.ALL|wx.ALIGN_CENTER, 3)
        hsizerAudioDriver.Add(self.audioDriverCB, -1, wx.ALL, 3)

        hsizerInputDevice.Add(self.inputDeviceLabel, -1,
                              wx.ALL|wx.ALIGN_CENTER, 3)
        hsizerInputDevice.Add(self.inputDeviceCB, -1, wx.ALL, 3)

        hsizerOutputDevice.Add(self.outputDeviceLabel, -1,
                               wx.ALL|wx.ALIGN_CENTER, 3)
        hsizerOutputDevice.Add(self.outputDeviceCB, -1, wx.ALL, 3)

        hsizerFirstPhysicalInput.Add(self.firstPhysicalInputLabel, -1,
                                     wx.ALL|wx.ALIGN_CENTER, 3)
        hsizerFirstPhysicalInput.Add(self.firstPhysicalInputCB, -1, wx.ALL, 3)

        hsizerFirstPhysicalOutput.Add(self.firstPhysicalOutputLabel, -1,
                                      wx.ALL|wx.ALIGN_CENTER, 3)
        hsizerFirstPhysicalOutput.Add(self.firstPhysicalOutputCB, -1, wx.ALL, 3)

        hsizerBufferSize.Add(bufferSizeLabel, -1, wx.ALL|wx.ALIGN_CENTER , 3)
        hsizerBufferSize.Add(self.bufferSizeCB, -1, wx.ALL, 3)

        hsizerSamplingRate.Add(samplingRateLabel, -1,
                               wx.ALL|wx.ALIGN_CENTER , 3)
        hsizerSamplingRate.Add(self.samplingRateCB, -1, wx.ALL, 3)

        hsizerDuplex.Add(duplexLabel, -1, wx.ALL|wx.ALIGN_CENTER , 3)
        hsizerDuplex.Add(self.duplexCB, -1, wx.ALL, 3)

        vsizer.AddSpacer(5)

        m = "The changes will be effective when the preferences will be closed."
        vsizer.Add(wx.StaticText(self, -1, m), 0, wx.ALIGN_CENTER_HORIZONTAL)

        vsizer.AddSpacer(5)
        vsizer.Add(hsizerAudioDriver, 0, wx.ALL|wx.EXPAND, 0)
        vsizer.Add(hsizerInputDevice, 0, wx.ALL|wx.EXPAND, 0)
        vsizer.Add(hsizerOutputDevice, 0, wx.ALL|wx.EXPAND, 0)
        vsizer.Add(hsizerFirstPhysicalInput, 0, wx.ALL|wx.EXPAND, 0)
        vsizer.Add(hsizerFirstPhysicalOutput, 0, wx.ALL|wx.EXPAND, 0)
        vsizer.Add(hsizerBufferSize, 0, wx.ALL|wx.EXPAND, 0)
        vsizer.Add(hsizerSamplingRate, 0, wx.ALL|wx.EXPAND, 0)
        vsizer.Add(hsizerDuplex, 0, wx.ALL|wx.EXPAND, 0)

        border = wx.BoxSizer()
        border.Add(vsizer, -1, wx.EXPAND|wx.ALL, 5)
        self.SetSizerAndFit(border)

        self.EnableDisablePortaudioOpts()