mirror of
https://github.com/Xetibo/ReSet.git
synced 2025-12-15 10:01:39 +01:00
feat: Add basic functionality to all audio usecases
This commit is contained in:
parent
2f1099267a
commit
c1984b5b79
32 changed files with 368 additions and 201 deletions
|
|
@ -42,7 +42,7 @@ impl SourceEntry {
|
|||
println!("{fraction}");
|
||||
let percentage = (fraction).to_string() + "%";
|
||||
imp.resetVolumePercentage.set_text(&percentage);
|
||||
set_inputstream_volume(value, imp.stream.clone());
|
||||
set_source_volume(value, imp.stream.clone());
|
||||
Propagation::Proceed
|
||||
}),
|
||||
);
|
||||
|
|
@ -51,7 +51,7 @@ impl SourceEntry {
|
|||
}
|
||||
}
|
||||
|
||||
fn set_inputstream_volume(value: f64, stream: Arc<RefCell<Source>>) -> bool {
|
||||
pub fn set_source_volume(value: f64, stream: Arc<RefCell<Source>>) -> bool {
|
||||
let mut stream = stream.borrow_mut().clone();
|
||||
// let x = stream.volume.iter_mut().map(|_| value as u32);
|
||||
stream.volume = vec![value as u32; stream.channels as usize];
|
||||
|
|
@ -61,7 +61,7 @@ fn set_inputstream_volume(value: f64, stream: Arc<RefCell<Source>>) -> bool {
|
|||
let proxy = conn.with_proxy(
|
||||
"org.xetibo.ReSet",
|
||||
"/org/xetibo/ReSet",
|
||||
Duration::from_millis(100),
|
||||
Duration::from_millis(1000),
|
||||
);
|
||||
let res: Result<(bool,), Error> =
|
||||
proxy.method_call("org.xetibo.ReSet", "SetSourceVolume", (stream,));
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue