Skip to content

Commit 0185e64

Browse files
committed
Mostly working Tauri & Qt concept/proto wrappers
1 parent f775dda commit 0185e64

15 files changed

Lines changed: 13845 additions & 2 deletions

File tree

.gitignore

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,19 @@
11

22
.DS_Store
33

4+
.scratch.txt
5+
scratch/
6+
47
media/
58

69
Jellyfin-Title-Speaker
710
YouTube-Title-Speaker
811

9-
.scratch.txt
1012
LocalWebAudioPlayer.code-workspace
13+
*.user
1114

12-
scratch/
15+
prototypes/tauri/src-tauri/gen/
16+
prototypes/tauri/src-tauri/target/
17+
18+
prototypes/qt/build/
19+
prototypes/qt/build-test/

README.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -145,3 +145,8 @@ yt-dlp -x --audio-format mp3 {URL}
145145
- `Sonic Electronix – Test Tones`: `yt-dlp -x --audio-format mp3 PLzFvCAfIq7a2SIBfDhpCytfJ4RHVb_KLY`
146146

147147
## TODO
148+
- Split into .css and .js file
149+
150+
## Experimental Desktop Shells
151+
- [**./prototypes/tauri/**](./prototypes/tauri/) – Rust/Tauri wrapper around bespoke copy of `player.html` to run as a native app.
152+
- [**./prototypes/qt/**](./prototypes/qt/) – C++/Qt wrapper around bespoke copy of `player.html` to run as a native app.

prototypes/README.md

Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
# Prototypes
2+
3+
## Comparison Snapshot
4+
5+
| Dimension | `prototypes/tauri` | `prototypes/qt` |
6+
| --- | --- | --- |
7+
| Primary stack | Rust + Tauri 2.x shell around the existing SPA | C++/Qt 6 WebEngine embedding the SPA |
8+
| Key source size | `main.rs` 215 LOC | `main.cpp` 386 LOC |
9+
| Footprint checked in | ~312 KB | ~11 MB (includes generated build output) |
10+
| Tooling needed | Rust toolchain, `tauri-cli` | Full Qt 6 WebEngine/WebChannel SDK, CMake |
11+
| Packaging | `cargo tauri build` produces cross-platform bundles using system webview | Requires bundling Qt frameworks; larger redistributables and LGPL/GPL considerations |
12+
13+
## Strengths
14+
15+
### `prototypes/tauri`
16+
- Small code surface and fast build loop (`cargo tauri dev`).
17+
- Reuses the SPA almost unchanged; lightweight bridge commands for folder scanning, text export, and logging.
18+
- Ships installers quickly thanks to Tauri’s packaging pipeline and native webview integration.
19+
20+
### `prototypes/qt`
21+
- Rich C++ bridge (`PlayerBridge`) with fine-grained control over file I/O and persistence via `QSettings`.
22+
- Qt WebChannel signals deliver immediate backend-driven updates and notifications.
23+
- Broader access to Qt modules if future native UI or audio features are required.
24+
25+
## Weaknesses
26+
27+
### `prototypes/tauri`
28+
- Deeper native integrations demand additional Rust commands.
29+
- Behavior depends on the quality and quirks of the platform webview.
30+
- Persists most state through web storage; fewer built-in desktop conveniences.
31+
32+
### `prototypes/qt`
33+
- Heavy setup: large SDK download, CMake configuration, and sizeable build artifacts.
34+
- More code to maintain and debug, with Chromium-sized runtime overhead from WebEngine.
35+
- Redistribution must account for Qt licensing and packaging of required frameworks.
36+
37+
## Recommendation
38+
39+
Objectively—looking at tooling weight, packaging effort, and maintenance cost—the Tauri prototype is the better fit for wrapping the current SPA as a desktop app. Subjectively, unless the roadmap includes deep Qt-specific integrations, sticking with Tauri keeps the project aligned with its web-centric workflow while still delivering a native shell.

prototypes/qt/CMakeLists.txt

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
cmake_minimum_required(VERSION 3.16)
2+
3+
project(QtWebEnginePrototype VERSION 0.1 LANGUAGES CXX)
4+
5+
set(CMAKE_CXX_STANDARD 17)
6+
set(CMAKE_CXX_STANDARD_REQUIRED ON)
7+
8+
set(CMAKE_AUTOMOC ON)
9+
set(CMAKE_AUTORCC ON)
10+
set(CMAKE_AUTOUIC ON)
11+
12+
find_package(Qt6 6.4 COMPONENTS Widgets WebEngineWidgets WebChannel REQUIRED)
13+
14+
qt_add_executable(QtWebEnginePrototype
15+
main.cpp
16+
)
17+
18+
target_link_libraries(QtWebEnginePrototype
19+
PRIVATE
20+
Qt6::Widgets
21+
Qt6::WebEngineWidgets
22+
Qt6::WebChannel
23+
)
24+
25+
if(APPLE)
26+
set(_qt_sdk "${CMAKE_OSX_SYSROOT}")
27+
if(_qt_sdk AND EXISTS "${_qt_sdk}/usr/include/c++/v1")
28+
target_include_directories(QtWebEnginePrototype
29+
SYSTEM BEFORE
30+
PRIVATE
31+
"${_qt_sdk}/usr/include/c++/v1"
32+
)
33+
endif()
34+
endif()
35+
36+
configure_file(index.html index.html COPYONLY)

prototypes/qt/README.md

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
# Qt WebEngine Prototype
2+
3+
Desktop wrapper around the single-page Local Web Audio Player. The Qt build embeds `index.html` in a `QWebEngineView`, uses a WebChannel bridge to scan folders and persist playback state, and removes the File System Access prompts required in the browser-only version.
4+
5+
## Requirements
6+
- Qt 6.4 or newer
7+
- Qt modules: **WebEngineWidgets** and **WebChannel**
8+
- Qt Maintenance Tool: enable **Qt 6.x → Qt WebEngine → Desktop** and **Qt 6.x → Qt WebChannel → Desktop**
9+
10+
## Build & Run
11+
From the repository root:
12+
```bash
13+
cd prototypes/qt
14+
cmake -B build -S .
15+
cmake --build build
16+
./build/QtWebEnginePrototype
17+
```
18+
19+
The executable launches the familiar player UI served from the bundled `index.html`.
20+
21+
## Manual Smoke Test
22+
1. Launch `QtWebEnginePrototype`.
23+
2. Click **Choose folder…**, select a directory containing `.mp3` files, and confirm the playlist populates and playback works.
24+
3. Close the app, relaunch, and verify the previous folder, last track, shuffle/loop/announce state, volume, and visualizer mode are restored automatically without additional prompts.
25+
26+
## Data Storage
27+
The bridge persists settings and recent folder selections via `QSettings` and the Qt web engine profile:
28+
- macOS: `~/Library/Application Support/NightVsKnight/QtWebEnginePrototype/`
29+
- Windows: `%APPDATA%\NightVsKnight\QtWebEnginePrototype\`
30+
- Linux: `${XDG_DATA_HOME:-~/.local/share}/NightVsKnight/QtWebEnginePrototype/`
31+
32+
These directories also host cached audio URLs and WebEngine profile data. Remove them to reset the prototype to a fresh state.

0 commit comments

Comments
 (0)