···11-import type { Track, TrackStats, TrackTags } from "@components/core/types.d.ts";
11+import type { Track, TrackStats, TrackTags } from "@common/types.d.ts";
22import type { SignalReader } from "@common/signal.d.ts";
3344export type Actions = {
+1-1
src/components/engine/queue/worker.js
···6677/**
88 * @import {Actions, Item} from "./types.d.ts"
99- * @import {Track} from "@components/core/types.d.ts"
99+ * @import {Track} from "@common/types.d.ts"
1010 */
11111212const QUERY = QS.parse(location.search);
+1-1
src/components/input/opensubsonic/common.js
···88/**
99 * @import {Child} from "subsonic-api"
1010 * @import {Server} from "./types.d.ts";
1111- * @import {Track} from "@components/core/types.d.ts";
1111+ * @import {Track} from "@common/types.d.ts";
1212 */
13131414/**
+1-1
src/components/input/opensubsonic/element.js
···22import { use } from "@common/worker.js";
3344/**
55- * @import {InputActions} from "@components/core/types.d.ts"
55+ * @import {InputActions} from "@common/types.d.ts"
66 */
7788////////////////////////////////////////////
+1-1
src/components/input/opensubsonic/worker.js
···19192020/**
2121 * @import {Child, SubsonicAPI} from "subsonic-api"
2222- * @import {ConsultGrouping, InputActions as Actions, Track} from "@components/core/types.d.ts";
2222+ * @import {ConsultGrouping, InputActions as Actions, Track} from "@common/types.d.ts";
2323 * @import {Server} from "./types.d.ts"
2424 */
2525
+1-1
src/components/input/s3/common.js
···66import { ENCODINGS, IDB_BUCKETS, SCHEME } from "./constants.js";
7788/**
99- * @import { Track } from "@components/core/types.d.ts";
99+ * @import { Track } from "@common/types.d.ts";
1010 * @import { Bucket } from "./types.d.ts";
1111 */
1212
+1-1
src/components/input/s3/worker.js
···1212import { SCHEME } from "./constants.js";
13131414/**
1515- * @import { InputActions as Actions, Track } from "@components/core/types.d.ts";
1515+ * @import { InputActions as Actions, Track } from "@common/types.d.ts";
1616 * @import { Bucket } from "./types.d.ts"
1717 */
1818
···22import { untracked } from "@common/signal.js";
3344/**
55- * @import {InputElement, OutputElement, Track} from "@components/core/types.d.ts"
55+ * @import {InputElement, Track} from "@common/types.d.ts"
66+ * @import {OutputElement} from "@components/output/types.d.ts"
67 */
7889////////////////////////////////////////////
···1011////////////////////////////////////////////
11121213/**
1313- * Fill the queue automatically with tracks
1414- * whenever tracks have been loaded,
1414+ * Update the queue pool whenever
1515+ * tracks have been loaded,
1516 * or the tracks collection changes.
1617 */
1718class QueueTracksOrchestrator extends DiffuseElement {
···11+import type { SignalReader } from "@common/signal.d.ts";
22+import type { Track } from "@common/types.d.ts";
33+44+// TODO: Do we need this?
55+//
66+// export interface Output<S = TrackStats, T = TrackTags> {
77+// tracks: Track<S, T>[];
88+// }
99+1010+export type OutputElement = HTMLElement & OutputManager<Track[]>;
1111+1212+export type OutputManager<Tracks> = {
1313+ tracks: {
1414+ collection: SignalReader<Tracks>;
1515+ reload: () => Promise<void>;
1616+ save: (tracks: Tracks) => Promise<void>;
1717+ state: SignalReader<"loading" | "loaded">;
1818+ };
1919+};
2020+2121+export type OutputManagerProperties<Tracks> = {
2222+ init?: () => Promise<boolean>;
2323+ tracks: {
2424+ empty(): Tracks;
2525+ get(): Promise<Tracks>;
2626+ put(tracks: Tracks): Promise<void>;
2727+ };
2828+};
+1-1
src/components/processor/artwork/types.d.ts
···11-import type { TrackTags } from "@components/core/types.d.ts";
11+import type { TrackTags } from "@common/types.d.ts";
2233export type Actions = {
44 artwork(request: ArtworkRequest): Promise<Artwork[]>;
+1-1
src/components/processor/metadata/common.js
···44import { tokenizer as rangeTokenizer } from "@tokenizer/range";
5566/**
77- * @import { TrackStats, TrackTags } from "@components/core/types.d.ts";
77+ * @import { TrackStats, TrackTags } from "@common/types.d.ts";
88 * @import { Extraction, Urls } from "./types.d.ts";
99 */
1010
+1-1
src/components/processor/metadata/types.d.ts
···11import type { IPicture } from "music-metadata";
22-import type { TrackStats, TrackTags } from "@components/core/types.d.ts";
22+import type { TrackStats, TrackTags } from "@common/types.d.ts";
3344export type Actions = {
55 supply: (
+1-1
src/components/processor/search/types.d.ts
···11-import type { Track } from "@components/core/types.d.ts";
11+import type { Track } from "@common/types.d.ts";
2233export type Actions = {
44 search(term: string): Promise<Track[]>;
+1-1
src/components/processor/search/worker.js
···77import { signal } from "@common/signal.js";
8899/**
1010- * @import {Track} from "@components/core/types.d.ts"
1010+ * @import {Track} from "@common/types.d.ts"
1111 * @import {Actions} from "./types.d.ts"
1212 */
1313
···11111212# ELEMENTS
13131414+configurators:
1515+ - title: "Input"
1616+ desc: "Add multiple inputs."
1717+ todo: true
1818+ - title: "Output"
1919+ desc: "Allows the user to configure a specific output."
2020+ todo: true
2121+1422engines:
1523 - url: "components/engine/audio/element.js"
1624 title: "Audio"
2525+ desc: "Plays audio through audio elements."
1726 - url: "components/engine/queue/element.js"
1827 title: "Queue"
2828+ desc: "A simple queue for tracks. NOTE: Temporarily automatically adds tracks shuffled to the queue."
19292030input:
2131 - url: "components/input/opensubsonic/element.js"
2232 title: "Opensubsonic"
2333 - url: "components/input/s3/element.js"
2424- title: "S3 (TODO)"
3434+ title: "S3"
3535+ desc: "AWS S3 and services that provide the same surface API such as Cloudflare R2."
3636+ todo: true
25372638orchestrators:
2739 - url: "components/orchestrator/process-tracks/element.js"
2840 title: "Process inputs into tracks"
4141+ desc: "Whenever the cached tracks are initially loaded through the passed output element it will contextualize and then list tracks by using the passed input element. Afterwards it loops over all tracks and checks if metadata needs to be fetched. If anything has changed, it'll pass the results to the output element."
2942 - url: "components/orchestrator/queue-audio/element.js"
3043 title: "Queue ⭤ Audio"
4444+ desc: "Connects the given queue engine to the given audio engine."
3145 - url: "components/orchestrator/queue-tracks/element.js"
3246 title: "Queue ⭤ Tracks"
4747+ desc: "Sets the given queue element pool whenever the tracks signal from the given output changes."
4848+ - url: "components/orchestrator/search-tracks/element.js"
4949+ title: "Search ⭤ Tracks"
5050+ desc: "Supplies tracks to the given search processor whenever the tracks collection changes."
33513452output:
3535- - url: "components/output/indexed-db/element.js"
3636- title: "IndexedDB"
5353+ - url: "components/output/polymorphic/indexed-db/element.js"
5454+ title: "Polymorphic / IndexedDB"
5555+ desc: "Stores output into the local indexedDB. Supports any type of data that indexedDB supports."
37563857processors:
3958 - url: "components/processor/artwork/element.js"
4059 title: "Artwork"
6060+ desc: "Fetches cover art for a given set of tracks, stored locally in indexedDB. Checks the audio metadata first, then MusicBrainz and uses Last.fm as the fallback."
4161 - url: "components/processor/metadata/element.js"
4262 title: "Metadata"
6363+ desc: "Fetch audio metadata for a given set of tracks, adding to the `Track` object."
4364 - url: "components/processor/search/element.js"
4465 title: "Search"
6666+ desc: "Provides a way to search through a collection of tracks, powered by orama.js"
6767+6868+supplements:
6969+ - title: "Last.fm scrobbler"
7070+ todo: true
45714672transformers:
4747- - url: "components/transformer/output-lenses/element.js"
4848- title: "Output Lenses (TODO)"
7373+ - url: "components/transformer/output/bytes/cambria/element.js"
7474+ title: "Output / Bytes / Cambria lenses"
7575+ desc: "Uses the Cambria library to seamlessly translate between data schemas so that no data migration is needed."
7676+ todo: true
49775078# SCHEMAS
51795280schemas:
5381 - url: "schemas/output/tracks/lexicon.json"
5454- title: "Output / Tracks (TODO)"
8282+ title: "Output / Tracks"
8383+ todo: true
55845685---
5786<link rel="stylesheet" href="index.css" />
···111140 title: "Configurators",
112141 items: configurators,
113142 content: `
114114- Elements that serve as an intermediate in order to make a particular kind of element configurable. In other words, these allow for an element to be swapped out with another that takes the same, or a subset of the actions and data output.
143143+ Elements that serve as an intermediate in order to make a particular kind of element configurable. In other words, these allow for an element to be swapped out with another that takes the same set of the actions and data output.
115144 `
116145 }) }}
117146···143172 title: "Output",
144173 items: output,
145174 content: `
146146- Output is application-derived data such as playlists. These elements can receive such data and keep it around.
175175+ Output is application-derived data such as playlists. These elements can receive such data and keep it around. These are categorised by the type of data they ingest, or many types in the case of polymorphic.
147176 `
148177 }) }}
149178···167196 title: "Transformers",
168197 items: transformers,
169198 content: `
170170- Transform data from one schema into another. See schema section below for more information.
199199+ Transform data from one format or schema into another. See schema section below for more information. Just as configurators, these are intermediates and require to have the same set of actions as the element it targets.
171200 `
172201 }) }}
173202 </div>
···177206 <section>
178207 <h2 id="schemas">Schemas</h2>
179208180180- <p>All of the elements here are built with these specific data schemas in mind. That said, you can mix elements that use different schemas; you just have to put a transformer between them in order to translate between the schemas.</p>
209209+ <p>All of the elements here are built with these data schemas in mind. That said, you can mix elements that use different schemas; you just have to put a transformer between them in order to translate between the schemas.</p>
181210182211 {{ await comp.list({ items: schemas }) }}
183212 </section>
+1-5
src/themes/blur/index.js
···55import "@components/orchestrator/queue-tracks/element.js";
66import "@components/processor/metadata/element.js";
7788-import * as Output from "@components/output/indexed-db/element.js";
88+import * as Output from "@components/output/polymorphic/indexed-db/element.js";
99import * as Queue from "@components/engine/queue/element.js";
10101111import { component } from "@common/element.js";
1212import { effect } from "@common/signal.js";
1313-1414-/**
1515- * @import {Item} from "@components/engine/queue/types.d.ts"
1616- */
17131814const output = component(Output);
1915const queue = component(Queue);