Merge branch 'config_progressbar_energy' into UI_2.0

This commit is contained in:
misyaguziya
2023-09-05 02:45:35 +09:00
2 changed files with 15 additions and 9 deletions

18
main.py
View File

@@ -264,14 +264,15 @@ def callbackSetMicDynamicEnergyThreshold(value):
print("callbackSetMicDynamicEnergyThreshold", value) print("callbackSetMicDynamicEnergyThreshold", value)
config.INPUT_MIC_DYNAMIC_ENERGY_THRESHOLD = value config.INPUT_MIC_DYNAMIC_ENERGY_THRESHOLD = value
def setProgressBarMicEnergy(energy):
view.updateSetProgressBar_MicEnergy(energy)
def callbackCheckMicThreshold(is_turned_on): def callbackCheckMicThreshold(is_turned_on):
print("callbackCheckMicThreshold", is_turned_on) print("callbackCheckMicThreshold", is_turned_on)
if is_turned_on is True: if is_turned_on is True:
# UIの処理あり model.startCheckMicEnergy(setProgressBarMicEnergy)
pass
else: else:
# UIの処理あり model.stopCheckMicEnergy()
pass
def callbackSetMicRecordTimeout(value): def callbackSetMicRecordTimeout(value):
print("callbackSetMicRecordTimeout", int(value)) print("callbackSetMicRecordTimeout", int(value))
@@ -311,14 +312,15 @@ def callbackSetSpeakerDynamicEnergyThreshold(value):
print("callbackSetSpeakerDynamicEnergyThreshold", value) print("callbackSetSpeakerDynamicEnergyThreshold", value)
config.INPUT_SPEAKER_DYNAMIC_ENERGY_THRESHOLD = value config.INPUT_SPEAKER_DYNAMIC_ENERGY_THRESHOLD = value
def setProgressBarSpeakerEnergy(energy):
view.updateSetProgressBar_SpeakerEnergy(energy)
def callbackCheckSpeakerThreshold(is_turned_on): def callbackCheckSpeakerThreshold(is_turned_on):
print("callbackCheckSpeakerThreshold", is_turned_on) print("callbackCheckSpeakerThreshold", is_turned_on)
if is_turned_on is True: if is_turned_on is True:
# UIの処理あり model.startCheckSpeakerEnergy(setProgressBarSpeakerEnergy)
pass
else: else:
# UIの処理あり model.stopCheckSpeakerEnergy()
pass
def callbackSetSpeakerRecordTimeout(value): def callbackSetSpeakerRecordTimeout(value):
print("callbackSetSpeakerRecordTimeout", int(value)) print("callbackSetSpeakerRecordTimeout", int(value))

View File

@@ -422,10 +422,14 @@ class View():
def updateSelected_MicDevice(self, default_selected_mic_device_name:str): def updateSelected_MicDevice(self, default_selected_mic_device_name:str):
self.view_variable.VAR_MIC_DEVICE.set(default_selected_mic_device_name) self.view_variable.VAR_MIC_DEVICE.set(default_selected_mic_device_name)
def updateSetProgressBar_MicEnergy(self, new_mic_energy):
vrct_gui.config_window.sb__progressbar_x_slider__progressbar_mic_energy_threshold.set(new_mic_energy/config.MAX_MIC_ENERGY_THRESHOLD)
def updateList_SpeakerDevice(self, new_speaker_device_list): def updateList_SpeakerDevice(self, new_speaker_device_list):
self.view_variable.LIST_SPEAKER_DEVICE = new_speaker_device_list self.view_variable.LIST_SPEAKER_DEVICE = new_speaker_device_list
vrct_gui.config_window.sb__optionmenu_speaker_device.configure(values=new_speaker_device_list) vrct_gui.config_window.sb__optionmenu_speaker_device.configure(values=new_speaker_device_list)
def updateSetProgressBar_SpeakerEnergy(self, new_speaker_energy):
vrct_gui.config_window.sb__progressbar_x_slider__progressbar_speaker_energy_threshold.set(new_speaker_energy/config.MAX_SPEAKER_ENERGY_THRESHOLD)
view = View() view = View()