Audio settings: Sinks and sources control fully implemented (cards wip), port pactl_wrapper

This commit is contained in:
Aleksander
2025-12-05 21:30:17 +01:00
parent 9767940923
commit 1d60bed361
9 changed files with 948 additions and 49 deletions

21
dash-frontend/src/task.rs Normal file
View File

@@ -0,0 +1,21 @@
use std::{cell::RefCell, collections::VecDeque, rc::Rc};
#[derive(Clone)]
pub struct Tasks<TaskType>(Rc<RefCell<VecDeque<TaskType>>>)
where
TaskType: Clone;
impl<TaskType: Clone + 'static> Tasks<TaskType> {
pub fn new() -> Self {
Self(Rc::new(RefCell::new(VecDeque::new())))
}
pub fn push(&self, task: TaskType) {
self.0.borrow_mut().push_back(task);
}
pub fn drain(&mut self) -> VecDeque<TaskType> {
let mut tasks = self.0.borrow_mut();
std::mem::take(&mut *tasks)
}
}