mirror of
https://github.com/arabianq/pipewire-soundpad.git
synced 2026-04-28 06:21:23 +00:00
Added unlink() function
This commit is contained in:
@@ -420,6 +420,7 @@ impl App {
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
pwsp_output.unwrap().unlink(mic.unwrap());
|
||||||
pwsp_output.unwrap().link(mic.unwrap());
|
pwsp_output.unwrap().link(mic.unwrap());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -25,15 +25,29 @@ pub struct OutputDevice {
|
|||||||
|
|
||||||
impl OutputDevice {
|
impl OutputDevice {
|
||||||
pub fn link(&self, input_device: &InputDevice) {
|
pub fn link(&self, input_device: &InputDevice) {
|
||||||
let _ = Command::new("pw-link")
|
Command::new("pw-link")
|
||||||
.arg(&self.output_fl)
|
.arg(&self.output_fl)
|
||||||
.arg(&input_device.input_fl)
|
.arg(&input_device.input_fl)
|
||||||
.status();
|
.status().ok();
|
||||||
|
|
||||||
let _ = Command::new("pw-link")
|
Command::new("pw-link")
|
||||||
.arg(&self.output_fr)
|
.arg(&self.output_fr)
|
||||||
.arg(&input_device.input_fr)
|
.arg(&input_device.input_fr)
|
||||||
.status();
|
.status().ok();
|
||||||
|
}
|
||||||
|
|
||||||
|
pub fn unlink(&self, input_device: &InputDevice) {
|
||||||
|
Command::new("pw-link")
|
||||||
|
.arg("--disconnect")
|
||||||
|
.arg(&self.output_fl)
|
||||||
|
.arg(&input_device.input_fl)
|
||||||
|
.status().ok();
|
||||||
|
|
||||||
|
Command::new("pw-link")
|
||||||
|
.arg("--disconnect")
|
||||||
|
.arg(&self.output_fr)
|
||||||
|
.arg(&input_device.input_fr)
|
||||||
|
.status().ok();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user