termusiclib/config/
mod.rs

1mod v1;
2pub mod v2;
3mod yaml_theme;
4
5mod server_overlay;
6mod tui_overlay;
7
8use parking_lot::RwLock;
9use std::sync::Arc;
10
11pub use server_overlay::ServerOverlay;
12pub use tui_overlay::TuiOverlay;
13
14/// The Server-Settings Object, but shared across many places
15// Note that this (at least currently) unused in lib itself, but used in many of the other dependent crates (playback, server, tui)
16pub type SharedServerSettings = Arc<RwLock<ServerOverlay>>;
17
18/// The Server-Settings Object, but shared across many places
19// Note that this (at least currently) unused in lib itself, but used in many of the other dependant crates (playback, server, tui)
20pub type SharedTuiSettings = Arc<RwLock<TuiOverlay>>;
21
22/// Create a new [`SharedServerSettings`] without having to also depend on [`parking_lot`]
23#[inline]
24#[must_use]
25pub fn new_shared_server_settings(settings: ServerOverlay) -> SharedServerSettings {
26    Arc::new(RwLock::new(settings))
27}
28
29/// Create a new [`SharedTuiSettings`] without having to also depend on [`parking_lot`]
30#[inline]
31#[must_use]
32pub fn new_shared_tui_settings(settings: TuiOverlay) -> SharedTuiSettings {
33    Arc::new(RwLock::new(settings))
34}