From 6bae8ab865b430d64a6404e484f8d312a9e793c7 Mon Sep 17 00:00:00 2001 From: Prohurtz <48768484+RedHawk989@users.noreply.github.com> Date: Fri, 16 Jun 2023 18:32:08 -0700 Subject: [PATCH] adjust settings layout, bump ver, add credits --- BabbleApp/algo_settings_widget.py | 51 ++++++++++++++++++++++------ BabbleApp/babbleapp.py | 22 ++++++++++-- BabbleApp/general_settings_widget.py | 33 +++--------------- 3 files changed, 64 insertions(+), 42 deletions(-) diff --git a/BabbleApp/algo_settings_widget.py b/BabbleApp/algo_settings_widget.py index bdb7dc2..98d2afe 100644 --- a/BabbleApp/algo_settings_widget.py +++ b/BabbleApp/algo_settings_widget.py @@ -13,6 +13,8 @@ class AlgoSettingsWidget: self.gui_multiply = f"-MULTIPLY{widget_id}-" self.gui_model_file = f"-MODLEFILE{widget_id}-" self.gui_use_gpu = f"USEGPU{widget_id}" + self.gui_speed_coefficient = f"-SPEEDCOEFFICIENT{widget_id}-" + self.gui_min_cutoff = f"-MINCUTOFF{widget_id}-" self.main_config = main_config self.config = main_config.settings self.osc_queue = osc_queue @@ -20,19 +22,11 @@ class AlgoSettingsWidget: # Define the window's contents self.general_settings_layout = [ - [sg.Text("Model output multiplier:", background_color='#424042'), - sg.InputText( - self.config.gui_multiply, - key=self.gui_multiply, - size=(0,8), - tooltip = "Model output modifier.", - ), - ], [sg.Text("Model file:", background_color='#424042'), sg.InputText( self.config.gui_model_file, key=self.gui_model_file, - size=(0, 8), + size=(32), tooltip="Name of the model file.", ), ], @@ -44,13 +38,42 @@ class AlgoSettingsWidget: tooltip="Toggle GPU execution.", ), ], + [sg.Text("Model output multiplier:", background_color='#424042'), + sg.InputText( + self.config.gui_multiply, + key=self.gui_multiply, + size=(4), + tooltip = "Model output modifier.", + ), + ], + [ + sg.Text("One Euro Filter Paramaters:", background_color='#242224'), + ], + [ + + sg.Text("Min Frequency Cutoff", background_color='#424042'), + sg.InputText( + self.config.gui_min_cutoff, + key=self.gui_min_cutoff, + size=(7), + ), + # ], + # [ + sg.Text("Speed Coefficient", background_color='#424042'), + sg.InputText( + self.config.gui_speed_coefficient, + key=self.gui_speed_coefficient, + size=(5), + ), + ], + ] self.widget_layout = [ [ - sg.Text("Tracking Algorithm Settings:", background_color='#242224'), + sg.Text("Model Settings:", background_color='#242224'), ], [ sg.Column(self.general_settings_layout, key=self.gui_general_settings_layout, background_color='#424042' ), @@ -93,6 +116,14 @@ class AlgoSettingsWidget: self.config.gui_use_gpu = values[self.gui_use_gpu] changed = True + if self.config.gui_min_cutoff != values[self.gui_min_cutoff]: + self.config.gui_min_cutoff = values[self.gui_min_cutoff] + changed = True + + if self.config.gui_speed_coefficient != values[self.gui_speed_coefficient]: + self.config.gui_speed_coefficient = values[self.gui_speed_coefficient] + changed = True + if changed: self.main_config.save() #print(self.main_config) diff --git a/BabbleApp/babbleapp.py b/BabbleApp/babbleapp.py index 3f40888..1517c48 100644 --- a/BabbleApp/babbleapp.py +++ b/BabbleApp/babbleapp.py @@ -1,3 +1,21 @@ +''' +------------------------------------------------------------------------------------------------------------- +██████╗ ██████╗ ██████╗ ██╗███████╗ ██████╗████████╗ ██████╗ █████╗ ██████╗ ██████╗ ██╗ ███████╗ +██╔══██╗██╔══██╗██╔═══██╗ ██║██╔════╝██╔════╝╚══██╔══╝ ██╔══██╗██╔══██╗██╔══██╗██╔══██╗██║ ██╔════╝ +██████╔╝██████╔╝██║ ██║ ██║█████╗ ██║ ██║ ██████╔╝███████║██████╔╝██████╔╝██║ █████╗ +██╔═══╝ ██╔══██╗██║ ██║██ ██║██╔══╝ ██║ ██║ ██╔══██╗██╔══██║██╔══██╗██╔══██╗██║ ██╔══╝ +██║ ██║ ██║╚██████╔╝╚█████╔╝███████╗╚██████╗ ██║ ██████╔╝██║ ██║██████╔╝██████╔╝███████╗███████╗ +╚═╝ ╚═╝ ╚═╝ ╚═════╝ ╚════╝ ╚══════╝ ╚═════╝ ╚═╝ ╚═════╝ ╚═╝ ╚═╝╚═════╝ ╚═════╝ ╚══════╝╚══════╝ +-------------------------------------------------------------------------------------------------------------- +GUI by: Prohurtz, qdot +Model by: Summer +App model implementation: Prohurtz, Summer + +Additional contributors: RamesTheGeneric (dataset synthesizer), + +Copyright (c) 2023 Project Babble <3 +''' + import os import PySimpleGUI as sg import queue @@ -10,9 +28,7 @@ from tab import CamInfo, Tab from osc import VRChatOSCReceiver, VRChatOSC from general_settings_widget import SettingsWidget from algo_settings_widget import AlgoSettingsWidget - from utils.misc_utils import is_nt - if is_nt: from winotify import Notification os.system('color') # init ANSI color @@ -30,7 +46,7 @@ SETTINGS_RADIO_NAME = "-SETTINGSRADIO-" ALGO_SETTINGS_RADIO_NAME = "-ALGOSETTINGSRADIO-" page_url = "https://github.com/SummerSigh/ProjectBabble/releases/latest" -appversion = "Babble v0.2.0 BETA" +appversion = "Babble v0.2.1" def main(): diff --git a/BabbleApp/general_settings_widget.py b/BabbleApp/general_settings_widget.py index 88f2a72..8faf205 100644 --- a/BabbleApp/general_settings_widget.py +++ b/BabbleApp/general_settings_widget.py @@ -33,26 +33,7 @@ class SettingsWidget: tooltip = "Toggle update check on launch.", ), ], - [ - sg.Text("One Euro Filter Paramaters:", background_color='#242224'), - ], - [ - - sg.Text("Min Frequency Cutoff", background_color='#424042'), - sg.InputText( - self.config.gui_min_cutoff, - key=self.gui_min_cutoff, - size=(0,10), - ), - #], - #[ - sg.Text("Speed Coefficient", background_color='#424042'), - sg.InputText( - self.config.gui_speed_coefficient, - key=self.gui_speed_coefficient, - size=(0,10), - ), - ], + [ sg.Text("OSC Settings:", background_color='#242224'), ], @@ -61,9 +42,11 @@ class SettingsWidget: sg.InputText( self.config.gui_osc_location, key=self.gui_osc_location, - size=(0, 30), + size=(30), tooltip="Prefix for OSC address.", ), + ], + [ sg.Text("Address:", background_color='#424042'), sg.InputText( self.config.gui_osc_address, @@ -178,14 +161,6 @@ class SettingsWidget: if self.config.gui_osc_recalibrate_address != values[self.gui_osc_recalibrate_address]: self.config.gui_osc_recalibrate_address = values[self.gui_osc_recalibrate_address] changed = True - - if self.config.gui_min_cutoff != values[self.gui_min_cutoff]: - self.config.gui_min_cutoff = values[self.gui_min_cutoff] - changed = True - - if self.config.gui_speed_coefficient != values[self.gui_speed_coefficient]: - self.config.gui_speed_coefficient = values[self.gui_speed_coefficient] - changed = True if self.config.gui_update_check != values[self.gui_update_check]: self.config.gui_update_check = values[self.gui_update_check]