fix(sound): volume debounce not applied
This commit is contained in:
parent
b8f0be58a7
commit
1222cbb515
1 changed files with 4 additions and 4 deletions
|
|
@ -304,7 +304,7 @@ impl Page {
|
||||||
let mut command = None;
|
let mut command = None;
|
||||||
if let Some(&node_id) = self.source_ids.get(self.active_source.unwrap_or(0)) {
|
if let Some(&node_id) = self.source_ids.get(self.active_source.unwrap_or(0)) {
|
||||||
command = Some(cosmic::command::future(async move {
|
command = Some(cosmic::command::future(async move {
|
||||||
tokio::time::sleep(Duration::from_millis(500)).await;
|
tokio::time::sleep(Duration::from_millis(64)).await;
|
||||||
crate::pages::Message::Sound(Message::SourceVolumeApply(node_id))
|
crate::pages::Message::Sound(Message::SourceVolumeApply(node_id))
|
||||||
}));
|
}));
|
||||||
}
|
}
|
||||||
|
|
@ -316,7 +316,7 @@ impl Page {
|
||||||
}
|
}
|
||||||
|
|
||||||
Message::Pulse(pulse::Event::SourceVolume(volume)) => {
|
Message::Pulse(pulse::Event::SourceVolume(volume)) => {
|
||||||
if self.sink_volume_debounce {
|
if self.source_volume_debounce {
|
||||||
return Command::none();
|
return Command::none();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -334,13 +334,13 @@ impl Page {
|
||||||
let mut command = None;
|
let mut command = None;
|
||||||
if let Some(&node_id) = self.sink_ids.get(self.active_sink.unwrap_or(0)) {
|
if let Some(&node_id) = self.sink_ids.get(self.active_sink.unwrap_or(0)) {
|
||||||
command = Some(cosmic::command::future(async move {
|
command = Some(cosmic::command::future(async move {
|
||||||
tokio::time::sleep(Duration::from_millis(500)).await;
|
tokio::time::sleep(Duration::from_millis(64)).await;
|
||||||
crate::pages::Message::Sound(Message::SinkVolumeApply(node_id))
|
crate::pages::Message::Sound(Message::SinkVolumeApply(node_id))
|
||||||
}));
|
}));
|
||||||
}
|
}
|
||||||
|
|
||||||
if let Some(command) = command {
|
if let Some(command) = command {
|
||||||
self.source_volume_debounce = true;
|
self.sink_volume_debounce = true;
|
||||||
return command;
|
return command;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue