mirror of
https://github.com/narrrl/proton-stream.git
synced 2026-11-04 08:56:59 +01:00
A second launch hands its request to the open window and exits: over a Unix socket in the user's runtime directory, or a named pipe on Windows whose name carries a random key from the user's config directory, so another account cannot take the name first. The open window comes forward, and a share link given as the first such argument opens the Add form with it filled in. Setup failures are logged and the app runs without the lock.
35 lines
1.3 KiB
Rust
35 lines
1.3 KiB
Rust
//! The `proton-stream` desktop application, as a library.
|
|
//!
|
|
//! A window over one or more Proton Drive public links: crawl them once, and
|
|
//! what is behind them becomes a library that plays without downloading first.
|
|
//!
|
|
//! Three threads' worth of work, kept apart on purpose:
|
|
//!
|
|
//! * **The UI thread** draws. It never opens a share, reads the catalog or
|
|
//! decodes an image — see [`engine`]. It is also the only thread that may
|
|
//! touch OpenGL, which is why [`video`] and the construction of a
|
|
//! [`playback::Playback`] both live on it.
|
|
//! * **The tokio runtime** does everything with a network or a disk in it. It is
|
|
//! built by the binary rather than with `#[tokio::main]`, because
|
|
//! [`pstr_player`] needs an `Arc<Runtime>` it can block on from mpv's demuxer
|
|
//! thread, which is outside tokio entirely.
|
|
//! * **A player thread** drives mpv for the length of a file — see [`playback`].
|
|
//!
|
|
//! This is a library as well as a binary so the parts that can only be checked
|
|
//! against a real GPU are reachable from `examples/` — see
|
|
//! `examples/embedded_video.rs`, which is the smoke test for [`video`].
|
|
|
|
pub mod app;
|
|
pub mod desktop_prefs;
|
|
pub mod engine;
|
|
pub mod inhibit;
|
|
pub mod instance;
|
|
pub mod media;
|
|
pub mod notify;
|
|
pub mod pacing;
|
|
pub mod playback;
|
|
pub mod theme;
|
|
pub mod ui;
|
|
pub mod video;
|
|
pub mod window;
|