# Path: hearinglosssimulator/gui/myqt.py
# QT = ModuleProxy(['', 'Q', 'Qt'], [QtCore.Qt, QtCore, QtGui, QtWidgets])


from .myqt import QT
from matplotlib.backends.backend_qt5agg import FigureCanvasQTAgg
from matplotlib import pyplot
import pyqtgraph as pg
import numpy as np
import sounddevice as sd
import time
import hearinglosssimulator as hls



class MplCanvas(FigureCanvasQTAgg):
    def __init__(self, parent=None, ):
        self.fig, self.ax = pyplot.subplots()
        FigureCanvasQTAgg.__init__(self, self.fig)
        self.setParent(parent)
        self.setSizePolicy(QT.QSizePolicy.Expanding, QT.QSizePolicy.Expanding)
        self.updateGeometry()
        self.fig.set_facecolor('#FFFFFF')
        
def test_Canvas():
    app = pg.mkQApp()
    win = MplCanvas()
    win.show()
    app.exec_()    


class FreqGainDuration(QT.QWidget):
    def __init__(self, parent = None):
        QT.QWidget.__init__(self, parent)
        mainlayout  =QT.QHBoxLayout()
        self.setLayout(mainlayout)

        mainlayout.addWidget(QT.QLabel(u'Gain (dBFs)'))
        self.spinbox_gain = QT.QSpinBox(maximum = 0, minimum = -100)
        mainlayout.addWidget(self.spinbox_gain)
        mainlayout.addStretch()
        

# Path: hearinglosssimulator/gui/myqt.py
# QT = ModuleProxy(['', 'Q', 'Qt'], [QtCore.Qt, QtCore, QtGui, QtWidgets])


# Path: hearinglosssimulator/gui/guitools.py
from .myqt import QT
from matplotlib.backends.backend_qt5agg import FigureCanvasQTAgg
from matplotlib import pyplot
import pyqtgraph as pg
import numpy as np
import sounddevice as sd
import time
import hearinglosssimulator as hls




class MplCanvas(FigureCanvasQTAgg):
    def __init__(self, parent=None, ):
        self.fig, self.ax = pyplot.subplots()
        FigureCanvasQTAgg.__init__(self, self.fig)
        self.setParent(parent)
        self.setSizePolicy(QT.QSizePolicy.Expanding, QT.QSizePolicy.Expanding)
        self.updateGeometry()
        self.fig.set_facecolor('#FFFFFF')
        
def test_Canvas():
    app = pg.mkQApp()
    win = MplCanvas()
    win.show()
    app.exec_()    


class FreqGainDuration(QT.QWidget):
    def __init__(self, parent = None):
        QT.QWidget.__init__(self, parent)
        mainlayout  =QT.QHBoxLayout()
        self.setLayout(mainlayout)

        mainlayout.addWidget(QT.QLabel(u'Gain (dBFs)'))
        self.spinbox_gain = QT.QSpinBox(maximum = 0, minimum = -100)
        mainlayout.addWidget(self.spinbox_gain)
        mainlayout.addStretch()
        

        mainlayout.addWidget(QT.QLabel(u'Duration (s)'))