Files
netflex/src/main.rs
Tamas Csikel af4e21ee6f
Some checks failed
release / release (push) Failing after 18m38s
Netflex 0.1.2: new screens, and an ARM build for the Raspberry Pi
- Pages from the web app: search, my list, anime hub and anime details,
  settings; the home and detail screens moved under src/screens on the
  shared page model (src/page.rs, ui/page.slint).
- package.sh --arm cross-compiles support.bluefox.netflex-<version>-aarch64.tar.zst,
  which Fennec OS on ARM installs (docs/store.md). The release CI builds
  both: the GStreamer dev packages of amd64 and arm64 can't be installed
  together, so it swaps them between the two builds.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-01 18:33:29 +01:00

64 lines
2.0 KiB
Rust

//! Netflex for SmartFox: a native TV client for a Netflex server.
//!
//! - UI: Slint (ui/*.slint) on sf-ui's Liquid Glass layer.
//! - State and focus: src/app.rs and the screen modules; every remote key
//! arrives in `App::key`.
//! - Playback: sf-ui's GStreamer player (Linux), streaming the file straight
//! from the server while the torrent downloads.
// Without a player (Windows, for UI work) some playback code sits unused.
#![cfg_attr(not(target_os = "linux"), allow(dead_code, unused_imports))]
mod api;
mod app;
mod config;
mod format;
mod page;
mod player;
mod screens;
mod task;
use slint::{ComponentHandle, Model};
slint::include_modules!();
sf_ui::glue!(App);
fn main() -> anyhow::Result<()> {
env_logger::Builder::from_env(env_logger::Env::default().default_filter_or("info")).init();
sf_ui::init()?;
#[cfg(target_os = "linux")]
if let Err(e) = sf_ui::video::init() {
log::error!("video: {e:#}");
}
let ui = App::new()?;
ui.sf_ui_setup();
if std::env::var_os("SF_UI_SIZE").is_none() && std::env::var_os("NETFLEX_WINDOWED").is_none() {
ui.window().set_fullscreen(true);
}
let glass = sf_ui::Glass::install(&ui, |ui, p| {
p.extend(ui.get_glass_message().iter());
p.extend(ui.get_glass_page().iter());
p.extend(ui.get_glass_page_keyboard().iter());
p.extend(ui.get_glass_player().iter());
p.extend(ui.get_glass_player_audio().iter());
p.extend(ui.get_glass_player_subs().iter());
p.extend(ui.get_glass_player_sync().iter());
p.extend(ui.get_glass_player_quality().iter());
p.extend(ui.get_glass_input().iter());
p.extend(ui.get_glass_input_keyboard().iter());
p.extend(ui.get_glass_select().iter());
p.extend(ui.get_glass_toast().iter());
})?;
glass.set_palette(sf_ui::Palette::from_hex(["#ff4a3d", "#8c0b14", "#120305"]));
let images = sf_ui::images::Images::new(384 << 20);
let app = app::Controller::new(&ui, glass, images);
app.start();
ui.run()?;
app.shutdown();
Ok(())
}