generated from uwu/neptune-template
-
-
Notifications
You must be signed in to change notification settings - Fork 16
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Improve qualities & add Low quality tag
- Loading branch information
Showing
7 changed files
with
55 additions
and
48 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,38 +1,33 @@ | ||
import { ValueOf } from "@inrixia/helpers/ts"; | ||
|
||
export type PlaybackContext = { | ||
actualAudioQuality: AudioQuality; | ||
actualProductId: number; | ||
}; | ||
|
||
export type AudioQuality = ValueOf<typeof PlaybackContextAudioQuality>; | ||
|
||
export enum PlaybackContextAudioQuality { | ||
export enum AudioQuality { | ||
HiRes = "HI_RES_LOSSLESS", | ||
MQA = "HI_RES", | ||
High = "LOSSLESS", | ||
Low = "HIGH", | ||
Lowest = "LOW", | ||
} | ||
|
||
export enum MediaMetadataQuality { | ||
High = "LOSSLESS", | ||
MQA = "MQA", | ||
export enum QualityTag { | ||
HiRes = "HIRES_LOSSLESS", | ||
Atmos = "DOLBY_ATMOS", | ||
Sony360 = "SONY_360RA", | ||
MQA = "MQA", | ||
High = "LOSSLESS", | ||
DolbyAtmos = "DOLBY_ATMOS", | ||
Sony630 = "SONY_360RA", | ||
} | ||
|
||
export type PlaybackContext = { | ||
actualAudioQuality: AudioQuality; | ||
actualProductId: number; | ||
}; | ||
|
||
export const QualityMeta = { | ||
[MediaMetadataQuality.MQA]: { className: "quality-tag", textContent: "MQA", color: "#F9BA7A" }, | ||
[MediaMetadataQuality.HiRes]: { className: "quality-tag", textContent: "HiRes", color: "#ffd432" }, | ||
[MediaMetadataQuality.Atmos]: { className: "quality-tag", textContent: "Atmos", color: "#0052a3" }, | ||
[MediaMetadataQuality.Sony360]: undefined, | ||
[MediaMetadataQuality.High]: undefined, | ||
[QualityTag.MQA]: { className: "quality-tag", textContent: "MQA", color: "#F9BA7A" }, | ||
[QualityTag.HiRes]: { className: "quality-tag", textContent: "HiRes", color: "#ffd432" }, | ||
[QualityTag.DolbyAtmos]: { className: "quality-tag", textContent: "Atmos", color: "#0052a3" }, | ||
[QualityTag.Sony630]: undefined, | ||
[QualityTag.High]: undefined, | ||
} as const; | ||
|
||
export const validQualities = Object.values(PlaybackContextAudioQuality); | ||
export const validQualitiesSet = new Set(validQualities); | ||
|
||
export const audioQualities = Object.values(AudioQuality); | ||
// Dont show MQA as a option as if HiRes is avalible itl always be served even if MQA is requested. | ||
export const validQualitiesSettings = [PlaybackContextAudioQuality.HiRes, PlaybackContextAudioQuality.High]; | ||
export const validQualitiesSettings: AudioQuality[] = [AudioQuality.HiRes, AudioQuality.High]; | ||
|
||
export const AudioQualityInverse = Object.fromEntries(Object.entries(PlaybackContextAudioQuality).map(([key, value]) => [value, key])); | ||
export const AudioQualityInverse = Object.fromEntries(Object.entries(AudioQuality).map(([key, value]) => [value, key])); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters