From bc7d62ca9a406bc30419e985016c7f4f56e54e76 Mon Sep 17 00:00:00 2001 From: Vidhu Kant Sharma Date: Fri, 24 Jul 2026 18:00:52 +0530 Subject: first commit --- main.py | 59 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 59 insertions(+) create mode 100644 main.py (limited to 'main.py') diff --git a/main.py b/main.py new file mode 100644 index 0000000..f8647ad --- /dev/null +++ b/main.py @@ -0,0 +1,59 @@ +# Soundboard Engine - customizable soundboard +# Copyright (C) 2026 Vidhu Kant Sharma +# +# This program is free software: you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation, either version 3 of the License, or +# (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program. If not, see . + +import os +import platform +import sys +from pathlib import Path + +from PySide6.QtWidgets import QApplication + +from Soundboard import Soundboard +from SoundboardEngine import SoundboardEngineWindow + +APP_VERSION = "0.1.0" + +if __name__ == "__main__": + config_path = ( + Path(sys.argv[1]).resolve() + if len(sys.argv) > 1 and sys.argv[1].endswith(".json") + else Path("soundboard.json").resolve() + ) + + if not config_path.exists(): + print(f"Error: Could not find soundboard JSON at {config_path}") + sys.exit(1) + + os.chdir(config_path.parent) + + _soundboard = Soundboard(config_path) + _soundboard.build() + + if platform.system() == "Linux": + os.environ["QT_QPA_PLATFORMTHEME"] = "gtk3" + + app = QApplication(sys.argv) + + if platform.system() == "Linux": + app.setStyle("Fusion") + + app.setOrganizationName("VidhuKant") + app.setApplicationName(_soundboard.soundboard_id) + + window = SoundboardEngineWindow(_soundboard, APP_VERSION) + window.show() + + sys.exit(app.exec()) -- cgit v1.2.3