# Path: hearinglosssimulator/gui/myqt.py
# QT = ModuleProxy(['', 'Q', 'Qt'], [QtCore.Qt, QtCore, QtGui, QtWidgets])
# 
# Path: hearinglosssimulator/gui/guitools.py
# def get_dict_from_group_param(param, cascade = False):
#     assert param.type() == 'group'
#     d = {}
#     for p in param.children():
#         if p.type() == 'group':
#             if cascade:
#                 d[p.name()] = get_dict_from_group_param(p, cascade = True)
#             continue
#         else:
#             d[p.name()] = p.value()
#     return d


from hearinglosssimulator.gui.myqt import QT
from hearinglosssimulator.gui.guitools import get_dict_from_group_param
import pyqtgraph as pg
import numpy as np
import sounddevice as sd

#~ import pyaudio





_params = [
    {'name': 'nb_buffer_latency', 'type': 'int', 'value': 6},
    {'name': 'sample_rate', 'type': 'float', 'value':44100., 'suffix': 'Hz', 'siPrefix': True},
    
    {'name': 'speaker_gain', 'type': 'float', 'value':0., 'limits': (-63.5, 24.), 'step' :0.5, 'suffix': 'dB', 'siPrefix': True},
    {'name': 'microphone_gain', 'type': 'float', 'value':20.,  'limits': (-12, 20.), 'step' :0.5, 'suffix': 'dB', 'siPrefix': True},
    
    
]


class WifiDeviceParameter(QT.QWidget):
    def __init__(self, parent = None):

# Path: hearinglosssimulator/gui/myqt.py
# QT = ModuleProxy(['', 'Q', 'Qt'], [QtCore.Qt, QtCore, QtGui, QtWidgets])
# 
# Path: hearinglosssimulator/gui/guitools.py
# def get_dict_from_group_param(param, cascade = False):
#     assert param.type() == 'group'
#     d = {}
#     for p in param.children():
#         if p.type() == 'group':
#             if cascade:
#                 d[p.name()] = get_dict_from_group_param(p, cascade = True)
#             continue
#         else:
#             d[p.name()] = p.value()
#     return d


# Path: hearinglosssimulator/gui/wifidevice/wifideviceparameters.py
from hearinglosssimulator.gui.myqt import QT
from hearinglosssimulator.gui.guitools import get_dict_from_group_param
import pyqtgraph as pg
import numpy as np
import sounddevice as sd


#~ import pyaudio





_params = [
    {'name': 'nb_buffer_latency', 'type': 'int', 'value': 6},
    {'name': 'sample_rate', 'type': 'float', 'value':44100., 'suffix': 'Hz', 'siPrefix': True},
    
    {'name': 'speaker_gain', 'type': 'float', 'value':0., 'limits': (-63.5, 24.), 'step' :0.5, 'suffix': 'dB', 'siPrefix': True},
    {'name': 'microphone_gain', 'type': 'float', 'value':20.,  'limits': (-12, 20.), 'step' :0.5, 'suffix': 'dB', 'siPrefix': True},
    
    
]


class WifiDeviceParameter(QT.QWidget):
    def __init__(self, parent = None):

        QT.QWidget.__init__(self, parent)