Merge branch 'overlay_transparency' into develop
This commit is contained in:
@@ -101,11 +101,11 @@ def sendMicMessage(message):
|
||||
translation = f" ({translation})"
|
||||
model.logger.info(f"[SENT] {message}{translation}")
|
||||
|
||||
# if config.ENABLE_NOTICE_OVERLAY is True:
|
||||
# if config.ENABLE_OVERLAY_SMALL_LOG is True:
|
||||
# overlay_image = model.createOverlayImageShort(message, translation)
|
||||
# model.setOverlayImage(overlay_image)
|
||||
# model.updateOverlay(overlay_image)
|
||||
# overlay_image = model.createOverlayImageLong("send", message, translation)
|
||||
# model.setOverlayImage(overlay_image)
|
||||
# model.updateOverlay(overlay_image)
|
||||
|
||||
def startTranscriptionSendMessage():
|
||||
model.startMicTranscript(sendMicMessage, view.printToTextbox_TranscriptionSendNoDeviceError)
|
||||
@@ -164,11 +164,11 @@ def receiveSpeakerMessage(message):
|
||||
if model.th_overlay is None:
|
||||
model.startOverlay()
|
||||
|
||||
if config.ENABLE_NOTICE_OVERLAY is True:
|
||||
if config.ENABLE_OVERLAY_SMALL_LOG is True:
|
||||
overlay_image = model.createOverlayImageShort(message, translation)
|
||||
model.setOverlayImage(overlay_image)
|
||||
model.updateOverlay(overlay_image)
|
||||
# overlay_image = model.createOverlayImageLong("receive", message, translation)
|
||||
# model.setOverlayImage(overlay_image)
|
||||
# model.updateOverlay(overlay_image)
|
||||
|
||||
# ------------Speaker2Chatbox------------
|
||||
if config.ENABLE_SPEAKER2CHATBOX is True:
|
||||
@@ -245,11 +245,11 @@ def sendChatMessage(message):
|
||||
osc_message = messageFormatter("SEND", translation, message)
|
||||
model.oscSendMessage(osc_message)
|
||||
|
||||
# if config.ENABLE_NOTICE_OVERLAY is True:
|
||||
# if config.ENABLE_OVERLAY_SMALL_LOG is True:
|
||||
# overlay_image = model.createOverlayImageShort(message, translation)
|
||||
# model.setOverlayImage(overlay_image)
|
||||
# model.updateOverlay(overlay_image)
|
||||
# overlay_image = model.createOverlayImageLong("send", message, translation)
|
||||
# model.setOverlayImage(overlay_image)
|
||||
# model.updateOverlay(overlay_image)
|
||||
|
||||
# update textbox message log (Sent)
|
||||
view.printToTextbox_SentMessage(message, translation)
|
||||
@@ -858,6 +858,39 @@ def callbackSetWhisperWeightType(value):
|
||||
config.SELECTED_TRANSCRIPTION_ENGINE = "Google"
|
||||
view.showRestartButtonIfRequired()
|
||||
|
||||
# VR Tab
|
||||
def callbackSetOverlaySettings(value, set_type:str):
|
||||
print("callbackSetOverlaySettings", value, set_type)
|
||||
pre_settings = config.OVERLAY_SETTINGS
|
||||
pre_settings[set_type] = value
|
||||
config.OVERLAY_SETTINGS = pre_settings
|
||||
match (set_type):
|
||||
case "opacity":
|
||||
model.updateOverlayImageOpacity()
|
||||
case "ui_scaling":
|
||||
model.updateOverlayImageUiScaling()
|
||||
|
||||
def callbackSetEnableOverlaySmallLog(value):
|
||||
print("callbackSetEnableOverlaySmallLog", value)
|
||||
config.ENABLE_OVERLAY_SMALL_LOG = value
|
||||
|
||||
def callbackSetOverlaySmallLogSettings(value, set_type:str):
|
||||
print("callbackSetOverlaySmallLogSettings", value, set_type)
|
||||
pre_settings = config.OVERLAY_SMALL_LOG_SETTINGS
|
||||
pre_settings[set_type] = value
|
||||
config.OVERLAY_SMALL_LOG_SETTINGS = pre_settings
|
||||
match (set_type):
|
||||
case "x_pos":
|
||||
model.updateOverlayPosition()
|
||||
case "y_pos":
|
||||
model.updateOverlayPosition()
|
||||
case "depth":
|
||||
model.updateOverlayPosition()
|
||||
case "display_duration":
|
||||
model.updateOverlayTimes()
|
||||
case "fadeout_duration":
|
||||
model.updateOverlayTimes()
|
||||
|
||||
# Others Tab
|
||||
def callbackSetEnableAutoClearMessageBox(value):
|
||||
print("callbackSetEnableAutoClearMessageBox", value)
|
||||
@@ -1098,6 +1131,11 @@ def createMainWindow(splash):
|
||||
"callback_set_use_whisper_feature": callbackSetUserWhisperFeature,
|
||||
"callback_set_whisper_weight_type": callbackSetWhisperWeightType,
|
||||
|
||||
# VR Tab
|
||||
"callback_set_overlay_settings": callbackSetOverlaySettings,
|
||||
"callback_set_enable_overlay_small_log": callbackSetEnableOverlaySmallLog,
|
||||
"callback_set_overlay_small_log_settings": callbackSetOverlaySmallLogSettings,
|
||||
|
||||
# Others Tab
|
||||
"callback_set_enable_auto_clear_chatbox": callbackSetEnableAutoClearMessageBox,
|
||||
"callback_set_send_only_translated_messages": callbackSetEnableSendOnlyTranslatedMessages,
|
||||
|
||||
Reference in New Issue
Block a user