👍️[Update] Model: Auto Mic/Speaker Select ON時にDefault DeviceをUIにセットするように変更
This commit is contained in:
@@ -125,11 +125,7 @@ class DeviceManager:
|
||||
sleep(1)
|
||||
enumerator.UnregisterEndpointNotificationCallback(cb)
|
||||
self.update()
|
||||
|
||||
if self.callback_default_input_device is not None:
|
||||
self.callback_default_input_device(self.default_input_device["host"]["name"], self.default_input_device["device"]["name"])
|
||||
if self.callback_default_output_device is not None:
|
||||
self.callback_default_output_device(self.default_output_device["device"]["name"])
|
||||
self.noticeDefaultDevice()
|
||||
|
||||
cb = Client()
|
||||
enumerator = AudioUtilities.GetDeviceEnumerator()
|
||||
@@ -160,6 +156,12 @@ class DeviceManager:
|
||||
def clearCallbackDefaultOutputDevice(self):
|
||||
self.callback_default_output_device = None
|
||||
|
||||
def noticeDefaultDevice(self):
|
||||
if self.callback_default_input_device is not None:
|
||||
self.callback_default_input_device(self.default_input_device["host"]["name"], self.default_input_device["device"]["name"])
|
||||
if self.callback_default_output_device is not None:
|
||||
self.callback_default_output_device(self.default_output_device["device"]["name"])
|
||||
|
||||
def getInputDevices(self):
|
||||
return self.input_devices
|
||||
|
||||
|
||||
@@ -552,9 +552,10 @@ def getAutoMicSelect(*args, **kwargs) -> dict:
|
||||
return {"status":200, "result":config.AUTO_MIC_SELECT}
|
||||
|
||||
def setEnableAutoMicSelect(data, action, *args, **kwargs) -> dict:
|
||||
config.AUTO_MIC_SELECT = True
|
||||
update_device = UpdateSelectedMicDevice(action)
|
||||
device_manager.setCallbackDefaultInputDevice(update_device.set)
|
||||
config.AUTO_MIC_SELECT = True
|
||||
device_manager.noticeDefaultDevice()
|
||||
return {"status":200, "result":config.AUTO_MIC_SELECT}
|
||||
|
||||
def setDisableAutoMicSelect(*args, **kwargs) -> dict:
|
||||
@@ -710,9 +711,10 @@ def getAutoSpeakerSelect(*args, **kwargs) -> dict:
|
||||
return {"status":200, "result":config.AUTO_SPEAKER_SELECT}
|
||||
|
||||
def setEnableAutoSpeakerSelect(data, action, *args, **kwargs) -> dict:
|
||||
config.AUTO_SPEAKER_SELECT = True
|
||||
update_device = UpdateSelectedSpeakerDevice(action)
|
||||
device_manager.setCallbackDefaultOutputDevice(update_device.set)
|
||||
config.AUTO_SPEAKER_SELECT = True
|
||||
device_manager.noticeDefaultDevice()
|
||||
return {"status":200, "result":config.AUTO_SPEAKER_SELECT}
|
||||
|
||||
def setDisableAutoSpeakerSelect(*args, **kwargs) -> dict:
|
||||
|
||||
Reference in New Issue
Block a user