···11---
22+import Applet from "../components/Applet.astro";
33+import List from "../components/List.astro";
24import Page from "../layouts/page.astro";
3544-// import "@picocss/pico/css/pico.colors.css";
56import "../styles/pages/index.css";
6777-const configurators = [{ url: "configurator/storage/output/", title: "Storage / Output" }];
88+// Types
99+type Ref = {
1010+ url: string;
1111+ title: string;
1212+};
1313+1414+// Links
1515+const WEB_APPLETS_HREF = "https://unternet.co/docs/web-applets/introduction";
1616+1717+// Themes
1818+const themes = [{ url: "themes/pilot/", title: "Pilot" }];
1919+2020+// Abstractions
2121+// TODO
2222+2323+// Applets
2424+const configurators = [{ url: "configurator/output/", title: "Output" }];
825926const engines = [
1027 { url: "engine/audio/", title: "Audio" },
1128 { url: "engine/queue/", title: "Queue" },
1229];
13303131+const input = [
3232+ { url: "input/native-fs", title: "(TODO) Native File System" },
3333+ { url: "input/s3-compatible", title: "(TODO) S3-Compatible API" },
3434+];
3535+1436const orchestrators = [
1515- { url: "orchestrator/queue/", title: "Queue" },
1616- { url: "orchestrator/storage/", title: "Storage" },
3737+ { url: "orchestrator/output-management/", title: "Output management" },
3838+ { url: "orchestrator/single-queue/", title: "Single queue" },
1739];
18401919-const storages = [
2020- { url: "storage/output/indexed-db", title: "Output / IndexedDB" },
2121- { url: "storage/output/native-fs", title: "Output / Native File System" },
4141+const output = [
4242+ { url: "output/indexed-db", title: "IndexedDB" },
4343+ { url: "output/native-fs", title: "Native File System" },
2244];
23452424-const processors = [];
2525-2626-const themes = [{ url: "themes/pilot/", title: "Pilot" }];
4646+const processors = [
4747+ { url: "processor/artwork", title: "(TODO) Artwork fetcher" },
4848+ { url: "processor/http-metadata", title: "(TODO) HTTP(S) metadata fetcher" },
4949+];
2750---
28512952<Page title="Diffuse">
···3659 href="/images/diffuse-current.svg#diffuse"></use>
3760 </svg>
3861 </h1>
6262+ <p>
6363+ Diffuse is a collection of <a href={WEB_APPLETS_HREF}>web applets</a> that make it possible to
6464+ listen to audio from various sources on your devices and the web, and to create the ideal digital
6565+ listening experience for you.
6666+ </p>
6767+ <p>
6868+ These applets can be used in various ways. The main ways so far are: (a) through <a
6969+ href="#themes">themes</a
7070+ >, a traditional browser (web application) approach, and (b) <a href="#abstractions"
7171+ >abstractions</a
7272+ > for non-browser systems.
7373+ </p>
3974 </header>
4075 <main>
7676+ <!-- THEMES -->
4177 <section>
4242- <h2>Themes</h2>
7878+ <h2 id="themes">Themes</h2>
43794480 <p>
4545- <em
4646- >Themes are “applet compositions” and opt for a traditional way of interacting with them,
4747- like a regular (web) app:</em
4848- >
8181+ Themes are “applet compositions” and provide a traditional browser web application way of
8282+ using them. Each theme is unique, not just a skin (eg. not like winamp skins).
4983 </p>
50845151- <ul>
5252- {
5353- themes.map((item: any) => (
5454- <li>
5555- <a href={item.url}>{item.title}</a>
5656- </li>
5757- ))
5858- }
5959- </ul>
6060- </section>
6161-6262- <section>
6363- <h2>Applets</h2>
6464-6565- <h3>Configurators</h3>
6666-6785 <p>
6868- <em
6969- >Applets that serve as an intermediate in order to make a particular kind of applet
7070- configurable. In other words, these allow for an applet to be swapped out with another
7171- that takes the same actions and data output.</em
7272- >
8686+ For example, most themes here will limit the currently playing audio tracks to one item, but
8787+ you might as well create a DJ theme that can play multiple items at the same time.
7388 </p>
74897575- <ul>
7676- {
7777- configurators.map((item: any) => (
7878- <li>
7979- <a href={item.url}>{item.title}</a>
8080- </li>
8181- ))
8282- }
8383- </ul>
9090+ <List items={themes} />
9191+ </section>
84928585- <h3>Engines</h3>
9393+ <!-- ABSTRACTIONS -->
9494+ <section>
9595+ <h2 id="abstractions">Abstractions</h2>
86968797 <p>
8888- <em
8989- >Applets with each a singular purpose and don't have any UI. There are specialised UI
9090- applets in themes that control these.</em
9191- >
9898+ These are applet configurations that enable certain use cases outside the traditional web
9999+ app experience. Just like themes, these include various assumptions of how certain parts of
100100+ the system should interact.
92101 </p>
931029494- <ul>
9595- {
9696- engines.map((item: any) => (
9797- <li>
9898- <a href={item.url}>{item.title}</a>
9999- </li>
100100- ))
101101- }
102102- </ul>
103103+ <p><em>TODO: Enable intelligent user (ai) agent use-case.</em></p>
104104+105105+ <List items={[]} />
106106+ </section>
103107104104- <h3>Orchestrators</h3>
108108+ <!-- APPLETS -->
109109+ <section>
110110+ <h2 id="applets">Applets</h2>
105111106112 <p>
107107- <em
108108- >These too are applet compositions. However, unlike themes, these are purely logical, and
109109- reuse applet instances from the parent context (when available). Mostly exist in order to
110110- construct sensible defaults (eg. applet connections you want to reuse across themes).</em
111111- >
113113+ Applets are <a href={WEB_APPLETS_HREF}>web applets</a>, the components of the system. These
114114+ are then recombined into an entire music player experience, or whatever you want to build.
112115 </p>
113116114114- <ul>
115115- {
116116- orchestrators.map((item: any) => (
117117- <li>
118118- <a href={item.url}>{item.title}</a>
119119- </li>
120120- ))
121121- }
122122- </ul>
117117+ <div class="columns">
118118+ <Applet title="Configurators" list={configurators}>
119119+ Applets that serve as an intermediate in order to make a particular kind of applet
120120+ configurable. In other words, these allow for an applet to be swapped out with another
121121+ that takes the same actions and data output.
122122+ </Applet>
123123124124- <h3>Processors</h3>
124124+ <Applet title="Engines" list={engines}>
125125+ Applets with each a singular purpose and don't have any UI. There are specialised UI
126126+ applets in themes that control these.
127127+ </Applet>
125128126126- <p>
127127- <em
128128- >These applets interact with the bytes provided by the data storage applets, or provide
129129- to. This processed data can then be passed on to, for example, the UI layer and engine
130130- applets.</em
131131- >
132132- </p>
129129+ <Applet title="Input" list={input}>
130130+ Inputs are sources of audio tracks. Each track is an entry in the list of possible items
131131+ to play. These can be files or streams. Or in other words, static or dynamic.
132132+ </Applet>
133133134134- <ul>
135135- {
136136- processors.map((item: any) => (
137137- <li>
138138- <a href={item.url}>{item.title}</a>
139139- </li>
140140- ))
141141- }
142142- </ul>
143143-144144- <h3>Storages</h3>
145145-146146- <p>
147147- <em
148148- >Input and output managers of the system. Where input is audio files or streams, and
149149- output is derived data such as a music playlist and your processed input (tracks).</em
150150- >
151151- </p>
134134+ <Applet title="Orchestrators" list={orchestrators}>
135135+ These too are applet compositions. However, unlike themes, these are purely logical, and
136136+ reuse applet instances from the parent context (when available). Mostly exist in order to
137137+ construct sensible defaults to use across themes and abstractions.
138138+ </Applet>
152139153153- <ul>
154154- {
155155- storages.map((item: any) => (
156156- <li>
157157- <a href={item.url}>{item.title}</a>
158158- </li>
159159- ))
160160- }
161161- </ul>
140140+ <Applet title="Output" list={output}>
141141+ Output is application-derived data such as playlists. These applets can receive such data
142142+ and keep it around.
143143+ </Applet>
162144163163- <h3>Supplements</h3>
145145+ <Applet title="Processors" list={processors}>
146146+ These applets interact with the bytes provided by the input applets. This processed data
147147+ can then be passed on to other applets.
148148+ </Applet>
164149165165- <p>
166166- <em>Additional applets, such as scrobblers.</em>
167167- </p>
150150+ <Applet title="Supplements" list={[]}>Additional applets, such as scrobblers.</Applet>
151151+ </div>
168152 </section>
169153 </main>
170154</Page>
···1515import type * as AudioUI from "@applets/themes/pilot/ui/audio/types.d.ts";
16161717const _configurator = {
1818- storage: {
1919- output: await applet("../../configurator/storage/output"),
2020- },
1818+ output: await applet("../../configurator/output"),
2119};
22202321const engine = {
···2624};
27252826const _orchestrator = {
2929- queue: await applet("../../orchestrator/queue"),
3030- storage: await applet<Output>("../../orchestrator/storage"),
2727+ queue: await applet("../../orchestrator/single-queue"),
2828+ output: await applet<Output>("../../orchestrator/output-management"),
3129};
32303331const ui = {
3432 audio: await applet<AudioUI.State>("ui/audio", { setHeight: true }),
3533};
36343737-// NOTE:
3838-// Themes are just limited imaginations.
3939-//
4040-// For example, this theme limits the currently playing audio to one item.
4141-// But you might as well create a DJ "theme" that plays multiple items at
4242-// the same time. With that in mind, you could abstract things here that are
4343-// reused across multiple themes. But it might also be good to keep the code
4444-// repetition because there are some defaults hidden in here.
4545-4635////////////////////////////////////////////
4736// ⚙️ [Connections → Engines]
4837// 🔉 AUDIO
···53425443reactive(
5544 engine.audio,
5656- (data) =>
5757- data.items[engine.queue.data.now?.id ?? Infinity]?.isPlaying ?? false,
4545+ (data) => data.items[engine.queue.data.now?.id ?? Infinity]?.isPlaying ?? false,
5846 (isPlaying) => ui.audio.sendAction("modifyIsPlaying", isPlaying),
5947);
6048