···2121 - title: "Loader"
2222 todo: true
2323 desc: >
2424- **A theme that loads other themes!** Load a theme from a URL, text snippet or from your user data output. _If you're taking the first steps to customize, checkout the [constituents loader](#constituents) first!_
2424+ **A theme that loads other themes!** _If you're taking the first steps to customize, checkout the [constituents loader](#constituents) first!_
2525 - url: "themes/webamp/"
2626 title: "Webamp"
2727 desc: >
···3737 - url: "themes/loader/constituent/"
3838 title: "Loader"
3939 desc: >
4040- **Bring in other constituents!** Load a constituent from a URL, text snippet or from your user data output.
4040+ **Bring in other constituents!** Load a constituent from a code snippet, store it in your user data output, explore community creations, or generate one.
4141 - url: "themes/webamp/browser/"
4242 title: "Webamp / Browser"
4343 desc: >
···112112 <h2 id="foundation" style="margin-top: 0;">Foundation</h2>
113113114114 <p>
115115- Diffuse comes with a foundation that preconfigures all elements so you don't have to set them up yourself, along with an assemblage of elements for certain activities. It internally tracks the DOM addition of the custom elements, so no need to worry about setting up an element multiple times.
115115+ Diffuse comes with a foundation that preconfigures all elements so you don't have to set them up yourself, along with a combination of elements for certain features. It internally tracks the DOM addition of the custom elements, so no need to worry about setting up an element multiple times.
116116 </p>
117117 <p>
118118 <small><i class="ph-fill ph-info"></i> Refer to the <a href="#elements">elements index</a> to find out what each element does.</small>
···124124 {{ /echo }}
125125{{ echo -}}foundation.engine.audio(){{- /echo }}
126126{{ echo -}}foundation.engine.queue(){{- /echo }}
127127+{{ echo -}}foundation.engine.repeatShuffle(){{- /echo }}
127128129129+{{ echo -}}foundation.orchestrator.autoQueue(){{- /echo }}
128130{{ echo -}}foundation.orchestrator.input(){{- /echo }}
129131{{ echo -}}foundation.orchestrator.output(){{- /echo }}
130132{{ echo -}}foundation.orchestrator.queueAudio(){{- /echo }}
131131-{{ echo -}}foundation.orchestrator.queueTracks(){{- /echo }}
132133{{ echo -}}foundation.orchestrator.processTracks(){{- /echo }}
133133-{{ echo -}}foundation.orchestrator.repeatShuffle(){{- /echo }}
134134{{ echo -}}foundation.orchestrator.searchTracks(){{- /echo }}
135135{{ echo -}}foundation.orchestrator.sources(){{- /echo }}
136136···141141 </div>
142142143143 <p>
144144- <small>Assemblages:</small>
144144+ <small>Features:</small>
145145 </p>
146146 <ul style="margin-bottom: 0;">
147147 <li>
148148+ <span>Fill the queue automatically <small>(infinite play)</small></span>
149149+ <div class="list-description">
150150+ <code>foundation.feature.fillQueueAutomatically()</code>
151151+ </div>
152152+ </li>
153153+ <li>
148154 <span>Play audio from the queue</span>
149155 <div class="list-description">
150150- <code>foundation.assemblage.playAudioFromQueue()</code>
156156+ <code>foundation.feature.playAudioFromQueue()</code>
151157 </div>
152158 </li>
153159 <li>
154154- <span>Queue management</span>
160160+ <span>Process inputs <small>(into tracks, etc)</small></span>
155161 <div class="list-description">
156156- <code>foundation.assemblage.queueManagement()</code>
162162+ <code>foundation.feature.processInputs()</code>
157163 </div>
158164 </li>
159165 <li>
160166 <span>Search through your collection</span>
161167 <div class="list-description" style="margin-bottom: 0;">
162162- <code>foundation.assemblage.searchThroughCollection()</code>
168168+ <code>foundation.feature.searchThroughCollection()</code>
163169 </div>
164170 </li>
171171+ </ul>
172172+ <h3>Notes</h3>
173173+ <p>
174174+ While you have the ability to do whatever you want in a custom constituent, the existing constituents are designed to work a certain way; so here's some things to keep in mind:
175175+ </p>
176176+ <ul>
177177+ <li><span>In most cases you'll want to call <code>foundation.feature.processInputs()</code> so that your audio files and streams actually show up.</span></li>
178178+ <li><span>Most elements are configured in broadcast mode so they communicate across tabs. There are a few exceptions such as inputs, where we prefer parallelisation.</span></li>
165179 </ul>
166180 </section>
167181
+12-6
src/themes/webamp/browser/index.js
···11import foundation from "@common/constituents/foundation.js";
22import BrowserElement from "@themes/webamp/browser/element.js";
3344-const que = foundation.assemblage.queueManagement();
55-const sea = foundation.assemblage.searchThroughCollection();
44+foundation.features.fillQueueAutomatically();
55+foundation.features.processInputs();
66+foundation.features.searchThroughCollection();
77+88+const inp = foundation.orchestrator.input();
99+const out = foundation.orchestrator.output();
1010+const que = foundation.engine.queue();
1111+const sea = foundation.processor.search();
612713const el = new BrowserElement();
88-el.setAttribute("input-selector", que.orchestrator.input.selector);
99-el.setAttribute("output-selector", que.orchestrator.output.selector);
1010-el.setAttribute("queue-engine-selector", que.engine.queue.selector);
1111-el.setAttribute("search-processor-selector", sea.processor.search.selector);
1414+el.setAttribute("input-selector", inp.selector);
1515+el.setAttribute("output-selector", out.selector);
1616+el.setAttribute("queue-engine-selector", que.selector);
1717+el.setAttribute("search-processor-selector", sea.selector);
12181319document.querySelector("#placeholder")?.replaceWith(el);