···2424 async connectedCallback() {
2525 // Broadcast if needed
2626 if (this.hasAttribute("group")) {
2727+ // TODO: Replicate state (repeat & shuffle)
2728 this.broadcast(this.nameWithGroup, {});
2829 }
2930
src/fonts/CommitMonoVariable.woff2
This is a binary file and will not be displayed.
+47-31
src/index.vto
···3333 title: "Blur / Artwork controller"
3434 desc: >
3535 Audio playback controller with artwork display.
3636- - title: "Loader"
3636+ - url: "themes/loader/constituent/"
3737+ title: "Loader"
3738 desc: >
3839 **A constituent that loads other constituents!** Load a constituent from a URL, text snippet or from your user data output.
3940 todo: true
···173174# DEFINITIONS
174175175176definitions:
177177+ - title: "Output / Constituent"
178178+ desc: >
179179+ Custom constituents to keep around.
180180+ todo: true
176181 - title: "Output / Favourites"
177177- desc: "Indicate a user's favourite audio. Not a property of a track because tracks are associated with a specific source. Favourites may match with multiple tracks. Specified using the audio's title and artist."
182182+ desc: >
183183+ Indicate a user's favourite audio. Not a property of a track because tracks are associated with a specific source. Favourites may match with multiple tracks. Specified using the audio's title and artist.
178184 todo: true
179185 - title: "Output / Playlist"
180180- desc: "Just like favourites, does not refer to specific tracks. Unlike favourites, must also specify the album. Can also be considered a collection which is basically an unordered playlist."
186186+ desc: >
187187+ Just like favourites, does not refer to specific tracks. Unlike favourites, must also specify the album. Can also be considered a collection which is basically an unordered playlist.
181188 todo: true
182189 - title: "Output / Progress"
183183- desc: "Used to track progress of (long) audio playback."
190190+ desc: >
191191+ Used to track progress of (long) audio playback.
192192+ todo: true
193193+ - title: "Output / Theme"
194194+ desc: >
195195+ Custom theme to keep around.
184196 todo: true
185197 - title: "Output / Tracks"
186186- desc: "Represents audio that can be played, or a placeholder for a source of tracks. Contains a URI that will resolve to the audio. This object may be cached if convenient."
198198+ desc: >
199199+ Represents audio that can be played, or a placeholder for a source of tracks. Contains a URI that will resolve to the audio. This object may be cached if convenient.
187200 url: "definitions/output/tracks.json"
188201189202---
190203191204<header>
192192- <h1>
193193- {{ await comp.diffuse.logo() }}
194194- </h1>
195195- <p class="construct dither-mask">
196196- Construct your audio player.
197197- </p>
198198- <p>
199199- Diffuse is a collection of components and software that make it possible to listen to audio from various sources on your devices and the web, and to create the ideal digital
200200- audio listening experience for you.
201201- </p>
202202- <p style="align-items: center; display: flex; gap: var(--space-2xs); opacity: 0.55;">
203203- <i class="ph-fill ph-crane"></i>
204204- <strong style="font-weight: 700;">WORK IN PROGRESS</strong>
205205- </p>
206206- <ul class="table-of-contents">
207207- <li><a href="#usage">Usage</a></li>
208208- <li><a href="#demo">Demo</a></li>
209209- <li><a href="#themes">Themes</a></li>
210210- <li><a href="#constituents">Constituents</a></li>
211211- <li><a href="#take-control">Take control</a></li>
212212- <li><a href="#elements">Elements</a></li>
213213- <li><a href="#definitions">Definitions</a></li>
214214- </ul>
215215- <p>
216216- <small>Built by <a href="https://tokono.ma">tokono.ma</a></small>
217217- </p>
205205+ <div>
206206+ <h1 class="diffuse-logo">
207207+ {{ await comp.diffuse.logo() }}
208208+ </h1>
209209+ <p class="construct dither-mask">
210210+ Construct your audio player.
211211+ </p>
212212+ <p>
213213+ Diffuse is a collection of components and software that make it possible to listen to audio from various sources on your devices and the web, and to create the ideal digital
214214+ audio listening experience for you.
215215+ </p>
216216+ <p style="align-items: center; display: flex; gap: var(--space-2xs); opacity: 0.55;">
217217+ <i class="ph-fill ph-crane"></i>
218218+ <strong style="font-weight: 700;">WORK IN PROGRESS</strong>
219219+ </p>
220220+ <ul class="table-of-contents">
221221+ <li><a href="#usage">Usage</a></li>
222222+ <li><a href="#demo">Demo</a></li>
223223+ <li><a href="#themes">Themes</a></li>
224224+ <li><a href="#constituents">Constituents</a></li>
225225+ <li><a href="#take-control">Take control</a></li>
226226+ <li><a href="#elements">Elements</a></li>
227227+ <li><a href="#definitions">Definitions</a></li>
228228+ </ul>
229229+ <p>
230230+ <small>Built by <a href="https://tokono.ma">tokono.ma</a></small>
231231+ </p>
232232+ </div>
233233+ <div class="dither-mask filler"></div>
218234</header>
219235<main>
220236 <div class="columns">
···11import defaults from "@common/constituents/default/config.js";
22import { effect } from "@common/signal.js";
3344-import AudioEngine from "@components/engine/audio/element.js";
55-import ArtworkProcessor from "@components/processor/artwork/element.js";
66-import QueueAudioOrchestrator from "@components/orchestrator/queue-audio/element.js";
77-84import ArtworkController from "@themes/blur/artwork-controller/element.js";
95106// Prerequisites
1111-const aud = new AudioEngine();
1212-aud.setAttribute("group", defaults.GROUP);
77+const aud = defaults.lazy.engine.audio();
88+const queue = defaults.lazy.engine.queue();
1391414-const art = new ArtworkProcessor();
1515-const oqa = new QueueAudioOrchestrator();
1616-oqa.setAttribute("group", defaults.GROUP);
1717-oqa.setAttribute("input-selector", defaults.orchestrator.input.selector);
1818-oqa.setAttribute("audio-engine-selector", "de-audio");
1919-oqa.setAttribute("queue-engine-selector", defaults.engine.queue.selector);
1010+const art = defaults.lazy.processor.artwork();
1111+1212+const oqa = defaults.lazy.orchestrator.queueAudio();
1313+const rso = defaults.lazy.orchestrator.repeatShuffle();
1414+1515+defaults.lazy.orchestrator.queueTracks();
1616+defaults.lazy.orchestrator.repeatShuffle();
20172118// Controller
2219const dac = new ArtworkController();
2320dac.setAttribute("artwork-processor-selector", art.selector);
2421dac.setAttribute("audio-engine-selector", aud.selector);
2522dac.setAttribute("input-selector", defaults.orchestrator.input.selector);
2626-dac.setAttribute("queue-engine-selector", defaults.engine.queue.selector);
2323+dac.setAttribute("queue-engine-selector", queue.selector);
27242825// Add to DOM
2929-document.body.append(aud, art, oqa, dac);
2626+document.body.append(dac);
30273128// Effect - Link the repeat/shuffle & queue-audio orchestrators
3229effect(() => {
3333- const rso = defaults.orchestrator.repeatShuffle;
3430 const repeat = rso.repeat();
35313632 if (repeat && !oqa.hasAttribute("repeat")) {
src/themes/loader/constituent/index.js
This is a binary file and will not be displayed.
+122
src/themes/loader/constituent/index.vto
···11+---
22+layout: layouts/constituent.vto
33+base: ../../../
44+55+styles:
66+ - styles/base.css
77+ - styles/diffuse/page.css
88+ - styles/vendor/phosphor/fill/style.css
99+1010+scripts:
1111+ - index.js
1212+---
1313+1414+<header>
1515+ <div>
1616+ <div>
1717+ <a class="diffuse-logo" href="./" style="display: inline-block;">
1818+ {{ await comp.diffuse.logo() }}
1919+ </a>
2020+ </div>
2121+ <p class="construct dither-mask" style="margin-top: 0;">
2222+ Constituent loader ❈
2323+ </p>
2424+ <p>
2525+ This tool allows you to load a custom <a href="#constituents">constituent</a> besides the <a href="#constituents">existing ones</a>. <strong>If you're missing a feature in Diffuse, this is the place to be!</strong>
2626+ </p>
2727+ </div>
2828+ <div class="dither-mask filler"></div>
2929+</header>
3030+<main>
3131+ <!-- COMMUNITY -->
3232+ <div class="columns">
3333+ <section>
3434+ <h2 id="generate">Generate</h2>
3535+ <p>
3636+ TODO: Explain how to instruct AI to generate a constituent for you. For example, "I want a nice album overview grouped by the month they were added to my collection"
3737+ </p>
3838+ </section>
3939+4040+ <section>
4141+ <h2 id="community">Community</h2>
4242+ <p>
4343+ Check out some constituents from the community and load them here.
4444+ </p>
4545+ <p>
4646+ <small><i class="ph-fill ph-info"></i> Nothing here yet, we're still in alpha.</small>
4747+ </p>
4848+ </section>
4949+ </div>
5050+5151+ <!-- CONSTRUCT -->
5252+ <section>
5353+ <h2 id="construct">Build it yourself</h2>
5454+ <!--<p></p>-->
5555+5656+ <div class="columns">
5757+ <div class="flex">
5858+ <p style="margin-top: 0; max-width: 100%;">
5959+ If you know a bit of HTML & Javascript, you can write your own or plug in some code you found elsewhere (be careful what to copy/paste though):
6060+ </p>
6161+6262+ <form>
6363+ <textarea class="monospace-font" placeholder="<code>goes here</code>"></textarea>
6464+ </form>
6565+ </div>
6666+6767+ <div class="flex">
6868+ <p style="margin-top: 0">
6969+ Your code here builds on the <a href="themes/loader/constituent/#foundation">foundation</a> listed below, it'll be injected into a <code><body></code> element.
7070+ </p>
7171+ <p style="margin-bottom: 0;">
7272+ <small>Some tips:</small>
7373+ </p>
7474+ <ul style="margin-top: var(--space-3xs);">
7575+ <li><small>Use <code>type="module"</code> when writing scripts.</small></li>
7676+ </ul>
7777+ <p>
7878+ <span class="button-row">
7979+ <button disabled>Save</button>
8080+ <button disabled>Preview</button>
8181+ <button disabled>Open in new tab</button>
8282+ </span>
8383+ </p>
8484+ <p>
8585+ Add dependencies for:
8686+ </p>
8787+ <form>
8888+ <select>
8989+ <option>Playing audio</option>
9090+ <option>Adding items to the queue</option>
9191+ <option>Browsing collection</option>
9292+ </select>
9393+ </form>
9494+ <p>
9595+ <span class="button-row">
9696+ <button disabled>Add code</button>
9797+ </span>
9898+ </p>
9999+ </div>
100100+ </div>
101101+ </section>
102102+103103+ <!-- FOUNDATION -->
104104+ <section>
105105+ <h2 id="foundation">Foundation</h2>
106106+ <p>
107107+ The default configuration for constituents includes the following elements which are loaded automatically:
108108+ </p>
109109+ <ul>
110110+ <li>orchestrator / input</li>
111111+ <li>orchestrator / output</li>
112112+ <li>orchestrator / process-tracks <small>(process on launch)</small></li>
113113+ <li>processor / metadata</li>
114114+ </ul>
115115+ <p>
116116+ Besides this the foundation provides most other elements preconfigured. These are lazy loaded so you do need to call the method in order to load it. For example:
117117+ </p>
118118+ <pre><code>{{-
119119+ "import defaults from \"@common/constituents/default/config.js\"\ndefaults.lazy.engine.audio()"
120120+ }}</code></pre>
121121+ </section>
122122+</main>