mirror of
https://github.com/haileys/bark
synced 2025-03-16 22:57:00 +00:00
wire up alsa config to bark.toml config
This commit is contained in:
parent
06bd231412
commit
e2fe6cc5a3
2 changed files with 9 additions and 4 deletions
|
@ -1 +1,4 @@
|
|||
multicast = "224.100.100.100:1530"
|
||||
|
||||
[source.input]
|
||||
device = "pipewire:NODE=Bark"
|
||||
|
|
|
@ -15,17 +15,17 @@ pub struct Config {
|
|||
|
||||
#[derive(Deserialize, Default)]
|
||||
pub struct Source {
|
||||
device: Option<String>,
|
||||
input: Device,
|
||||
delay_ms: Option<u64>,
|
||||
}
|
||||
|
||||
#[derive(Deserialize, Default)]
|
||||
pub struct Receive {
|
||||
output: Output,
|
||||
output: Device,
|
||||
}
|
||||
|
||||
#[derive(Deserialize, Default)]
|
||||
pub struct Output {
|
||||
pub struct Device {
|
||||
device: Option<String>,
|
||||
period: Option<u64>,
|
||||
buffer: Option<u64>,
|
||||
|
@ -39,8 +39,10 @@ fn set_env_option<T: ToString>(name: &str, value: Option<T>) {
|
|||
|
||||
pub fn load_into_env(config: &Config) {
|
||||
set_env_option("BARK_MULTICAST", config.multicast);
|
||||
set_env_option("BARK_SOURCE_DEVICE", config.source.device.as_ref());
|
||||
set_env_option("BARK_SOURCE_DELAY_MS", config.source.delay_ms);
|
||||
set_env_option("BARK_SOURCE_INPUT_DEVICE", config.source.input.device.as_ref());
|
||||
set_env_option("BARK_SOURCE_INPUT_PERIOD", config.source.input.period);
|
||||
set_env_option("BARK_SOURCE_INPUT_BUFFER", config.source.input.buffer);
|
||||
set_env_option("BARK_RECEIVE_OUTPUT_DEVICE", config.receive.output.device.as_ref());
|
||||
set_env_option("BARK_RECEIVE_OUTPUT_PERIOD", config.receive.output.period);
|
||||
set_env_option("BARK_RECEIVE_OUTPUT_BUFFER", config.receive.output.buffer);
|
||||
|
|
Loading…
Add table
Reference in a new issue