def __init__(self, parent=None):
        QT.QWidget.__init__(self, parent)
        mainlayout = QT.QVBoxLayout()
        self.setLayout(mainlayout)

        mainlayout.addWidget(QT.QLabel(u'<h1><b>Select device</b>'))
        but = QT.QPushButton('refresh device list')
        but.clicked.connect(self.resfresh_device_list)
        mainlayout.addWidget(but)

        mainlayout.addWidget(QT.QLabel(u'Input device'))
        self.comboin = QT.QComboBox()
        mainlayout.addWidget(self.comboin)
        mainlayout.addWidget(QT.QLabel(u'Output device'))
        self.comboout = QT.QComboBox()
        mainlayout.addWidget(self.comboout)

        mainlayout.addStretch()
        mainlayout.addWidget(QT.QLabel(u'<h1><b>Test device</b>'))

        self.freqgainduration = FreqGainDuration()
        mainlayout.addWidget(self.freqgainduration)

        but = QT.QPushButton('Test play sinus')
        but.clicked.connect(self.test_play_sinus)
        mainlayout.addWidget(but)

        but = QT.QPushButton('Test input to output')
        but.clicked.connect(self.play_input_to_output)
        mainlayout.addWidget(but)

        self.resfresh_device_list()
Ejemplo n.º 2
0
    def __init__(self, parent=None):
        QT.QWidget.__init__(self, parent)
        mainlayout = QT.QVBoxLayout()
        self.setLayout(mainlayout)

        h = QT.QHBoxLayout()
        mainlayout.addLayout(h)

        self.tab = QT.QTabWidget()
        h.addWidget(self.tab)

        ears = ('left', 'right')
        self.hl_params = {}
        for ear in ears:
            p = OneChannelHearingLossParameter()
            self.hl_params[ear] = p
            self.tab.addTab(p, ear)

        v = QT.QVBoxLayout()
        h.addLayout(v)

        v.addWidget(QT.QLabel('Hear level presets:'))
        self.combo_hearing_level_preset = QT.QComboBox()
        self.combo_hearing_level_preset.setMinimumHeight(48)
        v.addWidget(self.combo_hearing_level_preset)
        self.combo_hearing_level_preset.addItems(hearing_level_preset.keys())
        self.combo_hearing_level_preset.currentIndexChanged.connect(
            self.on_change_preset)
        v.addWidget(QT.QLabel('Compression healthiness:'))
        self.combo_compression_loss_preset = QT.QComboBox()
        self.combo_compression_loss_preset.setMinimumHeight(48)
        v.addWidget(self.combo_compression_loss_preset)
        self.combo_compression_loss_preset.addItems(compression_ratio.keys())
        self.combo_compression_loss_preset.setCurrentIndex(2)
        self.combo_compression_loss_preset.currentIndexChanged.connect(
            self.on_change_preset)
        v.addSpacing(30)
        but = QT.QPushButton(u'Copy L>R')
        v.addWidget(but)
        but.clicked.connect(self.copy_l_to_r)
        but = QT.QPushButton(u'Load')
        v.addWidget(but)
        but.clicked.connect(self.load)
        but = QT.QPushButton(u'Save')
        v.addWidget(but)
        but.clicked.connect(self.save)
        v.addStretch()

        self.nb_channel = 2
Ejemplo n.º 3
0
    def __init__(self, parent=None):
        QT.QWidget.__init__(self, parent)
        mainlayout = QT.QVBoxLayout()
        self.setLayout(mainlayout)

        mainlayout.addWidget(QT.QLabel(u'OpenCL Platform'))
        self.combo_platform = QT.QComboBox()
        mainlayout.addWidget(self.combo_platform)

        mainlayout.addWidget(QT.QLabel(u'OpenCL Device'))
        self.combo_dev = QT.QComboBox()
        mainlayout.addWidget(self.combo_dev)

        mainlayout.addStretch()

        self.resfresh_platform_list()
        self.combo_platform.currentIndexChanged.connect(
            self.resfresh_device_list)

        if len(pyopencl.get_platforms()) > 0:
            self.resfresh_device_list(0)