Add splash screen to make the new long unpacking process seem active

New unpacking delay is because of the CUDNN install of PyTorch, used by Demucs. At some point I'll make a fork without CUDNN and that won't need this but will still have it :)
This commit is contained in:
oitsjustjose 2025-03-30 22:06:27 -05:00
commit 849a7e7571
4 changed files with 9 additions and 2 deletions

View file

@ -39,6 +39,7 @@ pyinstaller `
--noconfirm `
--console `
--icon ".\assets\icon.ico" `
--splash ".\assets\splash.png" `
--name "Drum Track Converter" `
--add-data ".\src;src/" `
--add-data=".\assets;assets/" `

BIN
assets/splash.afphoto Normal file

Binary file not shown.

BIN
assets/splash.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 111 KiB

View file

@ -2,6 +2,7 @@
@author: Jose Stovall | github.com/oitsjustjose | bsky||@oitsjustjose.com
"""
import importlib
import os
import platform
import subprocess
@ -91,8 +92,6 @@ class MainWindow(QMainWindow):
prefix = "start /wait" if platform.system() == "Windows" else ""
command = f"{prefix} {cli} {self.input_dir} {self.output_dir} -m {self.model_name}"
print(f"{command=}")
self.__child_proc = subprocess.Popen(command.split(" "), shell=True, creationflags=subprocess.CREATE_NEW_CONSOLE)
self.__child_proc.wait()
@ -240,6 +239,13 @@ def main() -> None:
When the app is closed, the exit code is stored for sys.exit() while
in the meantime the off-thread processing (if any) is stopped.
"""
# Tell the PyInstaller GUI that we're done loading
if "_PYI_SPLASH_IPC" in os.environ and importlib.util.find_spec("pyi_splash"):
import pyi_splash
pyi_splash.update_text("Done Loading!")
pyi_splash.close()
app = QApplication(sys.argv)
icon = QIcon()