termusiclib/config/
mod.rs

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
mod v1;
pub mod v2;
mod yaml_theme;

mod server_overlay;
mod tui_overlay;

use parking_lot::RwLock;
use std::sync::Arc;

pub use server_overlay::ServerOverlay;
pub use tui_overlay::TuiOverlay;

/// The Server-Settings Object, but shared across many places
// Note that this (at least currently) unused in lib itself, but used in many of the other dependant crates (playback, server, tui)
pub type SharedServerSettings = Arc<RwLock<ServerOverlay>>;

/// The Server-Settings Object, but shared across many places
// Note that this (at least currently) unused in lib itself, but used in many of the other dependant crates (playback, server, tui)
pub type SharedTuiSettings = Arc<RwLock<TuiOverlay>>;

/// Create a new [`SharedServerSettings`] without having to also depend on [`parking_lot`]
#[inline]
pub fn new_shared_server_settings(settings: ServerOverlay) -> SharedServerSettings {
    Arc::new(RwLock::new(settings))
}

/// Create a new [`SharedTuiSettings`] without having to also depend on [`parking_lot`]
#[inline]
pub fn new_shared_tui_settings(settings: TuiOverlay) -> SharedTuiSettings {
    Arc::new(RwLock::new(settings))
}