Skip to content

Commit 879a49b

Browse files
committed
2 parents 93a7127 + 612b7d9 commit 879a49b

File tree

5 files changed

+83
-2
lines changed

5 files changed

+83
-2
lines changed

src/assets/DSP.png

1.4 KB
Loading

src/assets/DSP_off.png

1.49 KB
Loading

src/components/QualityDetailsBtn.vue

Lines changed: 55 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -75,6 +75,42 @@
7575
/>
7676
{{ loudness }}
7777
</div>
78+
79+
<!-- For now, a very simple DSP indicator -->
80+
<div
81+
v-if="dsp_state == DSPState.DISABLED_BY_UNSUPPORTED_GROUP"
82+
style="height: 50px; display: flex; align-items: center"
83+
>
84+
<img
85+
height="30"
86+
width="50"
87+
contain
88+
src="@/assets/DSP_off.png"
89+
:style="
90+
$vuetify.theme.current.dark
91+
? 'object-fit: contain;'
92+
: 'object-fit: contain;filter: invert(100%);'
93+
"
94+
/>
95+
{{ $t("dsp_disabled_by_unsupported_group") }}
96+
</div>
97+
<div
98+
v-else-if="dsp_state == DSPState.ENABLED"
99+
style="height: 50px; display: flex; align-items: center"
100+
>
101+
<img
102+
height="30"
103+
width="50"
104+
contain
105+
src="@/assets/DSP.png"
106+
:style="
107+
$vuetify.theme.current.dark
108+
? 'object-fit: contain;'
109+
: 'object-fit: contain;filter: invert(100%);'
110+
"
111+
/>
112+
{{ $t("dsp_active") }}
113+
</div>
78114
</v-list>
79115
</v-card>
80116
</v-menu>
@@ -85,7 +121,11 @@ import { computed } from "vue";
85121
import ProviderIcon from "@/components/ProviderIcon.vue";
86122
import api from "@/plugins/api";
87123
import { store } from "@/plugins/store";
88-
import { ContentType, VolumeNormalizationMode } from "@/plugins/api/interfaces";
124+
import {
125+
ContentType,
126+
DSPState,
127+
VolumeNormalizationMode,
128+
} from "@/plugins/api/interfaces";
89129
import { $t } from "@/plugins/i18n";
90130
91131
// computed properties
@@ -123,6 +163,20 @@ const loudness = computed(() => {
123163
return null;
124164
}
125165
});
166+
// This is tempoary until the details show the whole DSP pipeline
167+
const dsp_state = computed(() => {
168+
const dsp = streamDetails.value?.dsp;
169+
if (!dsp) return DSPState.DISABLED;
170+
let at_least_one_working = Object.values(dsp).some(
171+
(d) => d.state == DSPState.ENABLED,
172+
);
173+
let at_least_one_unsupported = Object.values(dsp).some(
174+
(d) => d.state == DSPState.DISABLED_BY_UNSUPPORTED_GROUP,
175+
);
176+
if (at_least_one_unsupported) return DSPState.DISABLED_BY_UNSUPPORTED_GROUP;
177+
else if (at_least_one_working) return DSPState.ENABLED;
178+
else return DSPState.DISABLED;
179+
});
126180
const getContentTypeIcon = function (contentType: ContentType) {
127181
if (contentType == ContentType.AAC) return iconAac;
128182
if (contentType == ContentType.FLAC) return iconFlac;

src/plugins/api/interfaces.ts

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -60,6 +60,26 @@ export interface DSPConfig {
6060
output_limiter: boolean;
6161
}
6262

63+
// DSPDetails used in StreamDetails
64+
export enum DSPState {
65+
ENABLED = "enabled",
66+
DISABLED = "disabled",
67+
DISABLED_BY_UNSUPPORTED_GROUP = "disabled_by_unsupported_group",
68+
}
69+
70+
// This describes the DSP configuration as applied,
71+
// even when the DSP state is disabled. For example,
72+
// output_limiter can remain true while the DSP is disabled.
73+
// All filters in the list are guaranteed to be enabled.
74+
export interface DSPDetails {
75+
state: DSPState;
76+
is_leader: boolean;
77+
input_gain: number;
78+
filters: DSPFilter[];
79+
output_gain: number;
80+
output_limiter: boolean;
81+
}
82+
6383
/// enums
6484

6585
export enum MediaType {
@@ -612,6 +632,11 @@ export interface StreamDetails {
612632
prefer_album_loudness?: boolean;
613633
target_loudness?: number;
614634
volume_normalization_mode?: VolumeNormalizationMode;
635+
// This contains the DSPDetails of all players in the group.
636+
// In case of single player playback, dict will contain only one entry.
637+
// The leader will have is_leader set to True.
638+
// (keep in mind that PlayerGroups have no (explicit) leader!)
639+
dsp?: Record<string, DSPDetails>;
615640
}
616641

617642
// queue_item

src/translations/en.json

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -606,5 +606,7 @@
606606
"loudness_measurement": "{0} LUFS",
607607
"loudness_measurement_album": "{0} LUFS (album)",
608608
"loudness_dynamic": "Dynamic volume normalization",
609-
"loudness_fixed": "Fixed gain correction"
609+
"loudness_fixed": "Fixed gain correction",
610+
"dsp_disabled_by_unsupported_group": "Not supported for this group type",
611+
"dsp_active": "Active"
610612
}

0 commit comments

Comments
 (0)