# Path: friture/audiobackend.py
# def AudioBackend():
#     global __audiobackendInstance
#     if __audiobackendInstance is None:
#         __audiobackendInstance = __AudioBackend()
#     return __audiobackendInstance


from PyQt5 import QtCore, QtWidgets
from friture.audiobackend import AudioBackend
        self.stats_scrollarea.setObjectName("stats_scrollArea")

        self.scrollAreaWidgetContents = QtWidgets.QWidget(self.stats_scrollarea)
        self.scrollAreaWidgetContents.setGeometry(QtCore.QRect(0, 0, 87, 220))
        self.scrollAreaWidgetContents.setStyleSheet("""QWidget { background: white }""")
        self.scrollAreaWidgetContents.setObjectName("stats_scrollAreaWidgetContents")

        self.LabelStats = QtWidgets.QLabel(self.scrollAreaWidgetContents)
        self.LabelStats.setAlignment(QtCore.Qt.AlignLeading | QtCore.Qt.AlignLeft | QtCore.Qt.AlignTop)
        self.LabelStats.setTextInteractionFlags(QtCore.Qt.LinksAccessibleByKeyboard | QtCore.Qt.LinksAccessibleByMouse |
                                                QtCore.Qt.TextBrowserInteraction | QtCore.Qt.TextSelectableByKeyboard | QtCore.Qt.TextSelectableByMouse)
        self.LabelStats.setObjectName("LabelStats")

        self.stats_layout = QtWidgets.QVBoxLayout(self.scrollAreaWidgetContents)
        self.stats_layout.setObjectName("stats_layout")
        self.stats_layout.addWidget(self.LabelStats)
        self.stats_scrollarea.setWidget(self.scrollAreaWidgetContents)

        self.tab_stats_layout = QtWidgets.QGridLayout(self)
        self.tab_stats_layout.addWidget(self.stats_scrollarea)

        timer.timeout.connect(self.stats_update)

    # method
    def stats_update(self):
        if not self.LabelStats.isVisible():
            return

        label = "Chunk #%d\n"\
            "Number of overflowed inputs (XRUNs): %d"\

# Path: friture/audiobackend.py
# def AudioBackend():
#     global __audiobackendInstance
#     if __audiobackendInstance is None:
#         __audiobackendInstance = __AudioBackend()
#     return __audiobackendInstance


# Path: friture/statisticswidget.py
from PyQt5 import QtCore, QtWidgets
from friture.audiobackend import AudioBackend

        self.stats_scrollarea.setObjectName("stats_scrollArea")

        self.scrollAreaWidgetContents = QtWidgets.QWidget(self.stats_scrollarea)
        self.scrollAreaWidgetContents.setGeometry(QtCore.QRect(0, 0, 87, 220))
        self.scrollAreaWidgetContents.setStyleSheet("""QWidget { background: white }""")
        self.scrollAreaWidgetContents.setObjectName("stats_scrollAreaWidgetContents")

        self.LabelStats = QtWidgets.QLabel(self.scrollAreaWidgetContents)
        self.LabelStats.setAlignment(QtCore.Qt.AlignLeading | QtCore.Qt.AlignLeft | QtCore.Qt.AlignTop)
        self.LabelStats.setTextInteractionFlags(QtCore.Qt.LinksAccessibleByKeyboard | QtCore.Qt.LinksAccessibleByMouse |
                                                QtCore.Qt.TextBrowserInteraction | QtCore.Qt.TextSelectableByKeyboard | QtCore.Qt.TextSelectableByMouse)
        self.LabelStats.setObjectName("LabelStats")

        self.stats_layout = QtWidgets.QVBoxLayout(self.scrollAreaWidgetContents)
        self.stats_layout.setObjectName("stats_layout")
        self.stats_layout.addWidget(self.LabelStats)
        self.stats_scrollarea.setWidget(self.scrollAreaWidgetContents)

        self.tab_stats_layout = QtWidgets.QGridLayout(self)
        self.tab_stats_layout.addWidget(self.stats_scrollarea)

        timer.timeout.connect(self.stats_update)

    # method
    def stats_update(self):
        if not self.LabelStats.isVisible():
            return

        label = "Chunk #%d\n"\
            "Number of overflowed inputs (XRUNs): %d"\

            % (AudioBackend().chunk_number,