diff --git a/BUILDING.md b/BUILDING.md index b575c97..252fe58 100644 --- a/BUILDING.md +++ b/BUILDING.md @@ -26,6 +26,7 @@ pyinstaller ` --hidden-import "numpy" ` --collect-submodules "demucs" ` --collect-submodules "numpy" ` + --optimize 2 ` ".\src\cli.py" ``` @@ -37,13 +38,14 @@ On the TODO: dtc_cli.exe is hard-coded and that's gross. I don't want to have to pyinstaller ` --onefile ` --noconfirm ` - --console ` + --windowed ` --icon ".\assets\icon.ico" ` --splash ".\assets\splash.png" ` --name "Drum Track Converter" ` --add-data ".\src;src/" ` --add-data=".\assets;assets/" ` --add-data ".\dist\dtc_cli.exe;." ` + --optimize 2 ` ".\src\gui.py" ``` diff --git a/README.md b/README.md index e22726a..88b7b52 100644 --- a/README.md +++ b/README.md @@ -8,6 +8,10 @@ I'm not entirely sure if this application _requires_ an Nvidia GPU or not, I act As `demucs` has a dependency on FFmpeg, so does this project. Installation is easy and lightweight. You can install FFMpeg for your operating system of choice from the [official site](https://ffmpeg.org/download.html). +```powershell +winget install ffmpeg +``` + # ℹ️ Using Your Nvidia GPU ℹ️ If you wish to use your Nvidia GPU, be sure to install the Cuda Toolkit version 11.8 from [here](https://developer.download.nvidia.com/compute/cuda/11.8.0/local_installers/cuda_11.8.0_522.06_windows.exe) before proceeding. diff --git a/scripts/windows/refresh_env.bat b/scripts/windows/refresh_env.bat deleted file mode 100644 index a551f52..0000000 --- a/scripts/windows/refresh_env.bat +++ /dev/null @@ -1,68 +0,0 @@ -:: -:: RefreshEnv.cmd -:: -:: Batch file to read environment variables from registry and -:: set session variables to these values. -:: -:: With this batch file, there should be no need to reload command -:: environment every time you want environment changes to propagate - -::echo "RefreshEnv.cmd only works from cmd.exe, please install the Chocolatey Profile to take advantage of refreshenv from PowerShell" -echo | set /p dummy="Refreshing environment variables from registry for cmd.exe. Please wait..." - -@echo off - -goto main - -:: Set one environment variable from registry key -:SetFromReg - "%WinDir%\System32\Reg" QUERY "%~1" /v "%~2" > "%TEMP%\_envset.tmp" 2>NUL - for /f "usebackq skip=2 tokens=2,*" %%A IN ("%TEMP%\_envset.tmp") do ( - echo/set "%~3=%%B" - ) - goto :EOF - -:: Get a list of environment variables from registry -:GetRegEnv - "%WinDir%\System32\Reg" QUERY "%~1" > "%TEMP%\_envget.tmp" - for /f "usebackq skip=2" %%A IN ("%TEMP%\_envget.tmp") do ( - if /I not "%%~A"=="Path" ( - call :SetFromReg "%~1" "%%~A" "%%~A" - ) - ) - goto :EOF - -:main - echo/@echo off >"%TEMP%\_env.cmd" - - :: Slowly generating final file - call :GetRegEnv "HKLM\System\CurrentControlSet\Control\Session Manager\Environment" >> "%TEMP%\_env.cmd" - call :GetRegEnv "HKCU\Environment">>"%TEMP%\_env.cmd" >> "%TEMP%\_env.cmd" - - :: Special handling for PATH - mix both User and System - call :SetFromReg "HKLM\System\CurrentControlSet\Control\Session Manager\Environment" Path Path_HKLM >> "%TEMP%\_env.cmd" - call :SetFromReg "HKCU\Environment" Path Path_HKCU >> "%TEMP%\_env.cmd" - - :: Caution: do not insert space-chars before >> redirection sign - echo/set "Path=%%Path_HKLM%%;%%Path_HKCU%%" >> "%TEMP%\_env.cmd" - - :: Cleanup - del /f /q "%TEMP%\_envset.tmp" 2>nul - del /f /q "%TEMP%\_envget.tmp" 2>nul - - :: capture user / architecture - SET "OriginalUserName=%USERNAME%" - SET "OriginalArchitecture=%PROCESSOR_ARCHITECTURE%" - - :: Set these variables - call "%TEMP%\_env.cmd" - - :: Cleanup - del /f /q "%TEMP%\_env.cmd" 2>nul - - :: reset user / architecture - SET "USERNAME=%OriginalUserName%" - SET "PROCESSOR_ARCHITECTURE=%OriginalArchitecture%" - - echo | set /p dummy="Finished." - echo .``` \ No newline at end of file diff --git a/scripts/windows/run.bat b/scripts/windows/run.bat deleted file mode 100644 index 8fdcdf5..0000000 --- a/scripts/windows/run.bat +++ /dev/null @@ -1,9 +0,0 @@ -@REM @echo off - -call setup.bat - -cd ..\.. - -start /B cmd /C call .venv\Scripts\python.exe -m src.gui - -cd scripts\windows \ No newline at end of file diff --git a/scripts/windows/setup.bat b/scripts/windows/setup.bat deleted file mode 100644 index 01f95c6..0000000 --- a/scripts/windows/setup.bat +++ /dev/null @@ -1,19 +0,0 @@ -@echo off - -@REM Install Python using WinGet if necessary -python --version >nul 2>&1 || ( winget install -e --id Python.Python.3.10 ) - -@REM Install ffmpeg using WinGet if necessary -ffmpeg -version >nul 2>&1 || ( winget install ffmpeg ) - -@REM Refresh the environment vars so any installed commands above are active -call refresh_env.bat - -@REM Set up the venv if it needs to be -if not exist ..\..\.venv\ ( python -m venv ..\..\.venv ) - -@REM Install required scripts -..\..\.venv\Scripts\pip.exe install -r ..\..\requirements.txt - -@REM Activate the new venv -..\..\.venv\Scripts\activate.bat diff --git a/src/processor.py b/src/processor.py index c18c111..fcdf680 100644 --- a/src/processor.py +++ b/src/processor.py @@ -75,7 +75,6 @@ class FolderProcessor: src: Path = Path(self.input_dir) dest: Path = Path(self.output_dir) - cur_dir: Path = Path(".").resolve() # Used just for logging if not src.exists(): raise Exception("Input directory does not exist!") @@ -103,12 +102,12 @@ class FolderProcessor: file_output_root = Path(file_output_root).resolve() # We also need to replace the original {file} extension with .mp3 filename_with_mp3_ext = f"{Path(file).stem}.mp3" - file_dest = file_output_root.joinpath(filename_with_mp3_ext) + file_dest = file_output_root.joinpath(filename_with_mp3_ext).resolve() # Make the output subdir(s) and move the no-drums file from the temp output to the final destination - os.makedirs(file_output_root, exist_ok=True) + os.makedirs(file_dest.parent, exist_ok=True) shutil.move(no_drums_path, file_dest) - self.output.info(f"Done processing {original_path.name} and relocated it to {file_dest.relative_to(cur_dir)}!") + self.output.info(f"✅ Done Processing {filename_with_mp3_ext}") # Remove the model output since we don't need it anymore if os.path.exists(self.model_name):