diff --git a/app.go b/app.go index fa59f7e..421e476 100644 --- a/app.go +++ b/app.go @@ -3,6 +3,7 @@ package main import ( "context" "ffmpeg-gui/internal/ffmpeg" + "ffmpeg-gui/internal/gpu" "ffmpeg-gui/internal/hwaccel" "ffmpeg-gui/internal/media" "ffmpeg-gui/internal/platform" @@ -106,6 +107,14 @@ func (a *App) GetHardwareEncoders() ([]hwaccel.HWEncoder, error) { return a.hwDetect.DetectEncoders() } +// GetGPUInfo returns detected GPU models and their encoder capabilities. +func (a *App) GetGPUInfo() []gpu.GPUInfo { + if a.exec == nil { + return nil + } + return gpu.DetectGPUs(a.exec) +} + // GetAccelerators returns detected hardware acceleration methods. func (a *App) GetAccelerators() ([]hwaccel.Accelerator, error) { if a.hwDetect == nil { @@ -200,7 +209,7 @@ func (a *App) SelectInputFile() (string, error) { // SelectOutputFile opens a save file dialog. func (a *App) SelectOutputFile(defaultName string) (string, error) { return runtime.SaveFileDialog(a.ctx, runtime.SaveDialogOptions{ - Title: "选择输出文件", + Title: "选择输出文件", DefaultFilename: defaultName, Filters: []runtime.FileFilter{ {DisplayName: "MP4 (*.mp4)", Pattern: "*.mp4"}, diff --git a/build.bat b/build.bat new file mode 100644 index 0000000..6777dd3 --- /dev/null +++ b/build.bat @@ -0,0 +1,42 @@ +@echo off +chcp 65001 >nul +echo === FFmpeg GUI Build Script === +echo. + +cd /d "%~dp0" + +echo [1/3] Installing frontend dependencies... +cd frontend +call npm install +if %errorlevel% neq 0 ( + echo ERROR: npm install failed + pause + exit /b %errorlevel% +) + +echo [2/3] Building frontend... +call npm run build +if %errorlevel% neq 0 ( + echo ERROR: frontend build failed + pause + exit /b %errorlevel% +) +cd .. + +echo [3/3] Cleaning icon cache... +if exist "build\windows\icon.ico" del /q "build\windows\icon.ico" +if exist "*-res.syso" del /q "*-res.syso" + +echo [4/4] Building Wails application... +wails build -clean -platform windows/amd64 +if %errorlevel% neq 0 ( + echo ERROR: wails build failed + pause + exit /b %errorlevel% +) + +echo. +echo === Build complete! === +echo Output: build\bin\ffmpeg-gui.exe +echo. +pause diff --git a/build/appicon.png b/build/appicon.png new file mode 100644 index 0000000..849e12f Binary files /dev/null and b/build/appicon.png differ diff --git a/frontend/src/App.vue b/frontend/src/App.vue index 530613a..ecaf48f 100644 --- a/frontend/src/App.vue +++ b/frontend/src/App.vue @@ -12,9 +12,9 @@