fix(qconnect): make SetVolume a supersedable pending action
Add `is_set_volume_action` to PendingQueueAction (set for CtrlSrvrSetVolume) and complete it on the SrvrCtrlVolumeChanged echo, so rapid volume changes can supersede the in-flight one instead of colliding on the single pending slot (the "pending queue action already active" spam). The frontend adapter clears the superseded pending before sending the next SetVolume (lands with the qbz-slint controller changes). cc
This commit is contained in:
2 files changed
+16
No files matched your search
@@ -173,6 +173,10 @@ where
|
|||||||
command.command_type,
|
command.command_type,
|
||||||
QueueCommandType::CtrlSrvrSetLoopMode
|
QueueCommandType::CtrlSrvrSetLoopMode
|
||||||
),
|
),
|
||||||
|
is_set_volume_action: matches!(
|
||||||
|
command.command_type,
|
||||||
|
QueueCommandType::CtrlSrvrSetVolume
|
||||||
|
),
|
||||||
is_set_active_renderer_action,
|
is_set_active_renderer_action,
|
||||||
expected_active_renderer_id: if is_set_active_renderer_action {
|
expected_active_renderer_id: if is_set_active_renderer_action {
|
||||||
pending_active_renderer_id_from_payload(&command.payload)
|
pending_active_renderer_id_from_payload(&command.payload)
|
||||||
@@ -1096,6 +1100,16 @@ fn session_management_event_completes_pending_action(
|
|||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if pending.is_set_volume_action
|
||||||
|
&& matches!(event_type, QueueEventType::SrvrCtrlVolumeChanged)
|
||||||
|
{
|
||||||
|
// Volume changes come back as session-management events without a
|
||||||
|
// stable action_uuid ack. Treat the first volume-changed echo as the
|
||||||
|
// completion signal so a rapid volume drag is not blocked behind the
|
||||||
|
// generic 10s pending timeout.
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
if !pending.is_set_active_renderer_action {
|
if !pending.is_set_active_renderer_action {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -13,6 +13,8 @@ pub struct PendingQueueAction {
|
|||||||
#[serde(default)]
|
#[serde(default)]
|
||||||
pub is_set_loop_mode_action: bool,
|
pub is_set_loop_mode_action: bool,
|
||||||
#[serde(default)]
|
#[serde(default)]
|
||||||
|
pub is_set_volume_action: bool,
|
||||||
|
#[serde(default)]
|
||||||
pub is_set_active_renderer_action: bool,
|
pub is_set_active_renderer_action: bool,
|
||||||
#[serde(default)]
|
#[serde(default)]
|
||||||
pub expected_active_renderer_id: Option<i32>,
|
pub expected_active_renderer_id: Option<i32>,
|
||||||
|
|||||||
Reference in new issue
Block a user