pub const VERSION: &str = "0.1.0"; // AUDREY_VERSION pub const USER_AGENT: &str = "audrey/linux"; pub const APP_ID: &str = "eu.callcc.audrey"; mod application; pub use application::Application; mod meson_config; pub mod ui; pub mod mpris; pub use mpris::Mpris; pub mod model; pub mod subsonic; use gettextrs::{bind_textdomain_codeset, bindtextdomain, setlocale, textdomain, LocaleCategory}; use gtk::prelude::*; use gtk::{gio, glib}; pub mod mpv; #[cfg(debug_assertions)] fn init_tracing() { tracing_subscriber::fmt::init(); } #[cfg(not(debug_assertions))] fn init_tracing() {} fn main() -> glib::ExitCode { // abort on any panic let orig_hook = std::panic::take_hook(); std::panic::set_hook(Box::new(move |panic_info| { orig_hook(panic_info); std::process::exit(1); })); gio::resources_register_include!("audrey.gresource").expect("could not register resources"); init_tracing(); gtk::disable_setlocale(); bindtextdomain("audrey", meson_config::LOCALEDIR).expect("failed to bind text domain"); bind_textdomain_codeset("audrey", "UTF-8").expect("failed to bind textdomaincodeset"); textdomain("audrey").expect("unable to switch to text domain"); setlocale(LocaleCategory::LcAll, ""); setlocale(LocaleCategory::LcNumeric, "C.UTF-8"); let app = Application::new(); app.run() }