Exemplo n.º 1
0
    def populateTable(self) -> None:
        row = 0
        format = QAudioFormat()
        for codec in self.m_deviceInfo.supportedCodecs():
            format.setCodec(codec)
            for sample_rate in self.m_deviceInfo.supportedSampleRates():
                format.setSampleRate(sample_rate)
                for channel_count in self.m_deviceInfo.supportedChannelCounts(
                ):
                    format.setChannelCount(channel_count)
                    for sample_type in self.m_deviceInfo.supportedSampleTypes(
                    ):
                        format.setSampleType(sample_type)
                        for sample_size in self.m_deviceInfo.supportedSampleSizes(
                        ):
                            format.setSampleType(sample_type)
                            for endian in self.m_deviceInfo.supportedByteOrders(
                            ):
                                format.setByteOrder(endian)
                                self.allFormatsTable.setRowCount(row + 1)

                                codecItem = QTableWidgetItem(format.codec())
                                self.allFormatsTable.setItem(row, 0, codecItem)

                                sampleRateItem = QTableWidgetItem(
                                    f"{format.sampleRate()}")
                                self.allFormatsTable.setItem(
                                    row, 1, sampleRateItem)

                                channelsItem = QTableWidgetItem(
                                    f"{format.channelCount()}")
                                self.allFormatsTable.setItem(
                                    row, 2, channelsItem)

                                sampleTypeItem = QTableWidgetItem(
                                    toString(format.sampleType()))
                                self.allFormatsTable.setItem(
                                    row, 3, sampleTypeItem)

                                sampleSizeItem = QTableWidgetItem(
                                    f"{format.sampleSize()}")
                                self.allFormatsTable.setItem(
                                    row, 4, sampleSizeItem)

                                byteOrderItem = QTableWidgetItem(
                                    toString(format.byteOrder()))
                                self.allFormatsTable.setItem(
                                    row, 5, byteOrderItem)

                                row += 1
Exemplo n.º 2
0
    def populateTable(self):
        row = 0
        format = QAudioFormat()

        for codec in self.deviceInfo.supportedCodecs():
            format.setCodec(codec)

            for sampleRate in self.deviceInfo.supportedSampleRates():
                format.setSampleRate(sampleRate)

                for channels in self.deviceInfo.supportedChannelCounts():
                    format.setChannelCount(channels)

                    for sampleType in self.deviceInfo.supportedSampleTypes():
                        format.setSampleType(sampleType)

                        for sampleSize in self.deviceInfo.supportedSampleSizes(
                        ):
                            format.setSampleSize(sampleSize)

                            for endian in self.deviceInfo.supportedByteOrders(
                            ):
                                format.setByteOrder(endian)

                                if self.deviceInfo.isFormatSupported(format):
                                    self.allFormatsTable.setRowCount(row + 1)

                                    self.setFormatValue(row, 0, format.codec())
                                    self.setFormatValue(
                                        row, 1, str(format.sampleRate()))
                                    self.setFormatValue(
                                        row, 2, str(format.channelCount()))
                                    self.setFormatValue(
                                        row,
                                        3,
                                        self.sampleTypeToString(
                                            format.sampleType()),
                                    )
                                    self.setFormatValue(
                                        row, 4, str(format.sampleSize()))
                                    self.setFormatValue(
                                        row, 5,
                                        self.endianToString(
                                            format.byteOrder()))

                                    row += 1
Exemplo n.º 3
0
    def populateTable(self):
        row = 0
        format = QAudioFormat()

        for codec in self.deviceInfo.supportedCodecs():
            format.setCodec(codec)

            for sampleRate in self.deviceInfo.supportedSampleRates():
                format.setSampleRate(sampleRate)

                for channels in self.deviceInfo.supportedChannelCounts():
                    format.setChannelCount(channels)

                    for sampleType in self.deviceInfo.supportedSampleTypes():
                        format.setSampleType(sampleType)

                        for sampleSize in self.deviceInfo.supportedSampleSizes():
                            format.setSampleSize(sampleSize)

                            for endian in self.deviceInfo.supportedByteOrders():
                                format.setByteOrder(endian)

                                if self.deviceInfo.isFormatSupported(format):
                                    self.allFormatsTable.setRowCount(row + 1)

                                    self.setFormatValue(row, 0, format.codec())
                                    self.setFormatValue(row, 1,
                                            str(format.sampleRate()))
                                    self.setFormatValue(row, 2,
                                            str(format.channelCount()))
                                    self.setFormatValue(row, 3,
                                            self.sampleTypeToString(
                                                    format.sampleType()))
                                    self.setFormatValue(row, 4,
                                            str(format.sampleSize()))
                                    self.setFormatValue(row, 5,
                                            self.endianToString(
                                                    format.byteOrder()))

                                    row += 1