Skip to main content

selene_daemon/
lib.rs

1#![forbid(unsafe_code)]
2
3use std::sync::atomic::{AtomicBool, Ordering};
4
5/// Sleep the current thread for 1ms. Used to avoid busy looping
6pub(crate) fn wait() {
7    std::thread::sleep(std::time::Duration::from_millis(1));
8}
9
10// IPC
11pub mod client;
12
13// Config
14pub mod config;
15
16// Engines
17/// Defaults to `false`, if `true`, a shutdown has been requested due to a critical thread returning
18pub(crate) static SHUTDOWN: AtomicBool = AtomicBool::new(false);
19pub(crate) static STATE_CHANGED: AtomicBool = AtomicBool::new(false);
20
21pub(crate) fn changed_state() {
22    STATE_CHANGED.store(true, Ordering::Relaxed);
23}
24
25pub mod player;
26
27mod decoder;
28mod event_handler;
29mod listener;
30
31// Features
32#[cfg(feature = "mpris")]
33mod mpris;
34
35// Other
36mod playlist;
37
38mod shuffle_mode;
39pub use shuffle_mode::*;
40
41mod loop_mode;
42pub use loop_mode::*;