#![forbid(unsafe_code)]
#![warn(missing_docs)]
mod app;
mod components;
mod debounce;
mod ipc;
mod persistence;
mod reconnect;
mod reply;
mod shortcuts;
mod state;
use std::path::PathBuf;
use clap::Parser;
use fluxframe_core::protocol::default_socket_path;
use relm4::RelmApp;
use tracing_subscriber::EnvFilter;
use crate::app::AppModel;
#[derive(Debug, Parser)]
#[command(version, about, long_about = None)]
struct Args {
#[arg(long, value_name = "PATH")]
socket: Option<PathBuf>,
}
fn main() {
tracing_subscriber::fmt()
.with_env_filter(
EnvFilter::from_default_env()
.add_directive("info".parse().expect("static 'info' directive parses")),
)
.init();
let gst_ready = match gstreamer::init() {
Ok(()) => true,
Err(e) => {
tracing::warn!(error = %e, "gstreamer::init failed; embedded preview will be inert");
false
}
};
let args = Args::parse();
let socket_path = args.socket.unwrap_or_else(default_socket_path);
tracing::info!(path = %socket_path.display(), "starting fluxframe-gui");
let app = RelmApp::new("io.fluxframe.gui").with_args(Vec::new());
app.run::<AppModel>(app::AppInit {
socket_path,
gst_ready,
});
}