mirror of
https://gitlab.freedesktop.org/pipewire/helvum
synced 2026-03-15 11:36:11 +08:00
Delete items from graph when they are removed by the pipewire server.
This commit is contained in:
@@ -142,4 +142,16 @@ impl Node {
|
||||
.get(&id)
|
||||
.map(|port_rc| port_rc.clone())
|
||||
}
|
||||
|
||||
pub fn remove_port(&self, id: u32) {
|
||||
let private = imp::Node::from_instance(self);
|
||||
if let Some(port) = private.ports.borrow_mut().remove(&id) {
|
||||
match port.direction {
|
||||
Direction::Input => private.num_ports_in.set(private.num_ports_in.get() - 1),
|
||||
Direction::Output => private.num_ports_in.set(private.num_ports_out.get() - 1),
|
||||
}
|
||||
|
||||
port.widget.unparent();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user