[Update] Config Window: Transcription (Speaker) Tab. Add Select Speaker Devices.

This commit is contained in:
Sakamoto Shiina
2024-04-07 11:56:39 +09:00
parent a9d0ca531e
commit 406d846b6b
6 changed files with 67 additions and 1 deletions

View File

@@ -43,6 +43,12 @@ def _changeConfigWindowWidgetsStatus(config_window, settings, view_variable, sta
disableLabelsWidgets(target_widget)
disableOptionmenuWidget(target_widget)
case "sb__optionmenu_speaker_device":
if status == "disabled":
target_widget = config_window.sb__widgets["sb__optionmenu_speaker_device"]
disableLabelsWidgets(target_widget)
disableOptionmenuWidget(target_widget)
case "sb__optionmenu_appearance_theme":
if status == "disabled":
target_widget = config_window.sb__widgets["sb__optionmenu_appearance_theme"]

View File

@@ -4,6 +4,7 @@ from .._SettingBoxGenerator import _SettingBoxGenerator
def createSettingBox_Speaker(setting_box_wrapper, config_window, settings, view_variable):
sbg = _SettingBoxGenerator(setting_box_wrapper, config_window, settings, view_variable)
createSettingBoxDropdownMenu = sbg.createSettingBoxDropdownMenu
createSettingBoxSwitch = sbg.createSettingBoxSwitch
createSettingBoxProgressbarXSlider = sbg.createSettingBoxProgressbarXSlider
createSettingBoxEntry = sbg.createSettingBoxEntry
@@ -13,6 +14,9 @@ def createSettingBox_Speaker(setting_box_wrapper, config_window, settings, view_
callFunctionIfCallable(view_variable.CALLBACK_CHECK_SPEAKER_THRESHOLD, is_turned_on)
def optionmenuInputSpeakerDeviceCallback(value):
callFunctionIfCallable(view_variable.CALLBACK_SET_SPEAKER_DEVICE, value)
def sliderInputSpeakerEnergyThresholdCallback(value):
callFunctionIfCallable(view_variable.CALLBACK_SET_SPEAKER_ENERGY_THRESHOLD, value)
@@ -32,6 +36,17 @@ def createSettingBox_Speaker(setting_box_wrapper, config_window, settings, view_
row=0
config_window.sb__speaker_device = createSettingBoxDropdownMenu(
for_var_label_text=view_variable.VAR_LABEL_SPEAKER_DEVICE,
for_var_desc_text=view_variable.VAR_DESC_SPEAKER_DEVICE,
optionmenu_attr_name="sb__optionmenu_speaker_device",
dropdown_menu_values=view_variable.LIST_SPEAKER_DEVICE,
command=lambda value: optionmenuInputSpeakerDeviceCallback(value),
variable=view_variable.VAR_SPEAKER_DEVICE,
)
config_window.sb__speaker_device.grid(row=row)
row+=1
config_window.sb__speaker_dynamic_energy_threshold = createSettingBoxSwitch(
for_var_label_text=view_variable.VAR_LABEL_SPEAKER_DYNAMIC_ENERGY_THRESHOLD,
for_var_desc_text=view_variable.VAR_DESC_SPEAKER_DYNAMIC_ENERGY_THRESHOLD,