Function sbz_switch::set
source · [−]pub fn set(
logger: &Logger,
device_id: Option<&OsStr>,
configuration: &Configuration,
mute: bool
) -> Result<(), Box<dyn Error>>
Expand description
Applies a set of configuration values to a device.
If device_id
is None, the system default output device will be used.
mute
controls whether the device is muted at the start of the operation
and unmuted at the end. In any case, the device will not be unmuted if it
was already muted before calling this function.
Examples
let mut creative = BTreeMap::<String, BTreeMap<String, Value>>::new();
let mut device_control = BTreeMap::<String, Value>::new();
device_control.insert("SelectOutput".to_string(), Value::Integer(1));
let configuration = Configuration {
endpoint: None,
creative,
};
set(logger.clone(), None, &configuration, true);