From ee27134f2b8da01d273a8a2f5d1ca82a4de99b86 Mon Sep 17 00:00:00 2001 From: Maxim Raznatovski Date: Tue, 14 Jan 2025 08:53:41 +0100 Subject: [PATCH] refactor: consolidate `dsp` and `dsp_grouped_childs` Instead of a separate entry for the leader, DSPDetails now has a is_leader field. --- music_assistant_models/dsp.py | 1 + music_assistant_models/streamdetails.py | 11 +++++------ 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/music_assistant_models/dsp.py b/music_assistant_models/dsp.py index 9096750..060ac59 100644 --- a/music_assistant_models/dsp.py +++ b/music_assistant_models/dsp.py @@ -158,6 +158,7 @@ class DSPDetails(DataClassDictMixin): """ state: DSPState = DSPState.DISABLED + is_leader: bool = False input_gain: float = 0.0 filters: list[DSPFilter] = field(default_factory=list) output_gain: float = 0.0 diff --git a/music_assistant_models/streamdetails.py b/music_assistant_models/streamdetails.py index 473d590..4d020f9 100644 --- a/music_assistant_models/streamdetails.py +++ b/music_assistant_models/streamdetails.py @@ -80,12 +80,11 @@ class StreamDetails(DataClassDictMixin): strip_silence_begin: bool = False strip_silence_end: bool = False stream_error: bool | None = None - # In case of grouped playback, this will contain the DSP details for - # the leader (keep in mind that PlayerGroups has no leader!) - dsp: DSPDetails | None = None - # In case of grouped playback, this will contain the DSP details for - # all other players of the group (indexed by player_id) - dsp_grouped_childs: dict[str, DSPDetails] | None = None + # This contains the DSPDetails of all players in the group. + # In case of single player playback, dict will contain only one entry. + # The leader will have is_leader set to True. + # (keep in mind that PlayerGroups have no (explicit) leader!) + dsp: dict[str, DSPDetails] | None = None def __str__(self) -> str: """Return pretty printable string of object."""