Skip to content

Commit

Permalink
refactor: consolidate dsp and dsp_grouped_childs
Browse files Browse the repository at this point in the history
Instead of a separate entry for the leader, DSPDetails now has a
is_leader field.
  • Loading branch information
maximmaxim345 committed Jan 14, 2025
1 parent 40ffbf3 commit ee27134
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
1 change: 1 addition & 0 deletions music_assistant_models/dsp.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
11 changes: 5 additions & 6 deletions music_assistant_models/streamdetails.py
Original file line number Diff line number Diff line change
Expand Up @@ -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."""
Expand Down

0 comments on commit ee27134

Please sign in to comment.