A music player that connects to your cloud/distributed storage.
0
fork

Configure Feed

Select the types of activity you want to include in your feed.

fix: rearrange constituent defaults

+177 -143
+153 -128
src/common/constituents/default.js
··· 22 22 * Default config for constituents. 23 23 */ 24 24 export function config() { 25 - // Input 26 - const input = new InputOrchestrator(); 27 - input.setAttribute("group", GROUP); 28 - input.setAttribute("id", "input"); 25 + // Pre-instantiated 26 + const instantiated = { 27 + engine: { 28 + queue: queue(), 29 + }, 30 + orchestrator: { 31 + input: input(), 32 + output: output(), 33 + queueTracks: queueTracks(), 34 + processTracks: processTracks(), 35 + repeatShuffle: repeatShuffle(), 36 + }, 37 + processor: { 38 + metadata: metadata(), 39 + }, 40 + }; 29 41 30 - document.body.append(input); 42 + // Return elements 43 + return { 44 + GROUP, 45 + 46 + instantiated, 47 + 48 + lazy: { 49 + engine: { 50 + audio, 51 + }, 52 + orchestrator: { 53 + queueAudio, 54 + searchTracks, 55 + sources, 56 + }, 57 + processor: { 58 + artwork, 59 + search, 60 + }, 61 + }, 62 + }; 63 + } 31 64 32 - // Output 33 - const output = new OutputOrchestrator(); 34 - output.setAttribute("group", GROUP); 35 - output.setAttribute("id", "output"); 65 + // 🥡 36 66 37 - document.body.append(output); 67 + // Engines 68 + function audio() { 69 + const a = new AudioEngine(); 70 + a.setAttribute("group", GROUP); 38 71 39 - // Processors 40 - const metadata = new MetadataProcessor(); 41 - metadata.setAttribute("group", GROUP); 72 + addToBodyIfNeeded(a); 73 + return a; 74 + } 42 75 43 - document.body.append(metadata); 76 + function queue() { 77 + const q = new Queue(); 78 + q.setAttribute("group", GROUP); 44 79 45 - // Orchestrators 46 - const opt = new ProcessTracksOrchestrator(); 47 - opt.setAttribute("group", GROUP); 48 - opt.setAttribute("input-selector", input.selector); 49 - opt.setAttribute("output-selector", output.selector); 50 - opt.setAttribute("metadata-processor-selector", metadata.selector); 51 - opt.toggleAttribute("process-when-ready"); 80 + addToBodyIfNeeded(q); 81 + return q; 82 + } 52 83 53 - document.body.append(opt); 84 + // Processors 85 + function artwork() { 86 + const a = new ArtworkProcessor(); 87 + a.setAttribute("group", GROUP); 54 88 55 - // LAZY 56 - // ---- 89 + addToBodyIfNeeded(a); 90 + return a; 91 + } 57 92 58 - // Engines 59 - function audio() { 60 - const a = new AudioEngine(); 61 - a.setAttribute("group", GROUP); 93 + function metadata() { 94 + const m = new MetadataProcessor(); 95 + m.setAttribute("group", GROUP); 62 96 63 - addToBodyIfNeeded(a); 64 - return a; 65 - } 97 + addToBodyIfNeeded(m); 98 + return m; 99 + } 66 100 67 - function queue() { 68 - const q = new Queue(); 69 - q.setAttribute("group", GROUP); 101 + function search() { 102 + const s = new SearchProcessor(); 103 + s.setAttribute("group", GROUP); 70 104 71 - addToBodyIfNeeded(q); 72 - return q; 73 - } 105 + addToBodyIfNeeded(s); 106 + return s; 107 + } 74 108 75 - // Processors 76 - function artwork() { 77 - const a = new ArtworkProcessor(); 78 - a.setAttribute("group", GROUP); 109 + // Orchestrators 110 + function input() { 111 + const i = new InputOrchestrator(); 112 + i.setAttribute("group", GROUP); 113 + i.setAttribute("id", "input"); 79 114 80 - addToBodyIfNeeded(a); 81 - return a; 82 - } 115 + addToBodyIfNeeded(i); 116 + return i; 117 + } 83 118 84 - function search() { 85 - const s = new SearchProcessor(); 86 - s.setAttribute("group", GROUP); 119 + function output() { 120 + const o = new OutputOrchestrator(); 121 + o.setAttribute("group", GROUP); 122 + o.setAttribute("id", "output"); 87 123 88 - addToBodyIfNeeded(s); 89 - return s; 90 - } 124 + addToBodyIfNeeded(o); 125 + return o; 126 + } 91 127 92 - // Orchestrators 93 - function queueAudio() { 94 - const a = audio(); 95 - const q = queue(); 128 + function processTracks() { 129 + const i = input(); 130 + const o = output(); 131 + const m = metadata(); 96 132 97 - const oqa = new QueueAudioOrchestrator(); 98 - oqa.setAttribute("group", GROUP); 99 - oqa.setAttribute("audio-engine-selector", a.selector); 100 - oqa.setAttribute("input-selector", input.selector); 101 - oqa.setAttribute("queue-engine-selector", q.selector); 133 + const opt = new ProcessTracksOrchestrator(); 134 + opt.setAttribute("group", GROUP); 135 + opt.setAttribute("input-selector", i.selector); 136 + opt.setAttribute("output-selector", o.selector); 137 + opt.setAttribute("metadata-processor-selector", m.selector); 138 + opt.toggleAttribute("process-when-ready"); 102 139 103 - addToBodyIfNeeded(oqa); 104 - return oqa; 105 - } 140 + document.body.append(opt); 141 + } 106 142 107 - function queueTracks() { 108 - const q = queue(); 143 + function queueAudio() { 144 + const a = audio(); 145 + const i = input(); 146 + const q = queue(); 109 147 110 - const oqt = new QueueTracksOrchestrator(); 111 - oqt.setAttribute("group", GROUP); 112 - oqt.setAttribute("input-selector", input.selector); 113 - oqt.setAttribute("output-selector", output.selector); 114 - oqt.setAttribute("queue-engine-selector", q.selector); 148 + const oqa = new QueueAudioOrchestrator(); 149 + oqa.setAttribute("group", GROUP); 150 + oqa.setAttribute("audio-engine-selector", a.selector); 151 + oqa.setAttribute("input-selector", i.selector); 152 + oqa.setAttribute("queue-engine-selector", q.selector); 115 153 116 - addToBodyIfNeeded(oqt); 117 - return oqt; 118 - } 154 + addToBodyIfNeeded(oqa); 155 + return oqa; 156 + } 119 157 120 - function repeatShuffle() { 121 - const q = queue(); 158 + function queueTracks() { 159 + const i = input(); 160 + const o = output(); 161 + const q = queue(); 122 162 123 - const ors = new RepeatShuffleOrchestrator(); 124 - ors.setAttribute("group", GROUP); 125 - ors.setAttribute("queue-engine-selector", q.selector); 163 + const oqt = new QueueTracksOrchestrator(); 164 + oqt.setAttribute("group", GROUP); 165 + oqt.setAttribute("input-selector", i.selector); 166 + oqt.setAttribute("output-selector", o.selector); 167 + oqt.setAttribute("queue-engine-selector", q.selector); 126 168 127 - addToBodyIfNeeded(ors); 128 - return ors; 129 - } 169 + addToBodyIfNeeded(oqt); 170 + return oqt; 171 + } 130 172 131 - function searchTracks() { 132 - const s = search(); 173 + function repeatShuffle() { 174 + const q = queue(); 133 175 134 - const ost = new SearchTracksOrchestrator(); 135 - ost.setAttribute("group", GROUP); 136 - ost.setAttribute("input-selector", input.selector); 137 - ost.setAttribute("output-selector", output.selector); 138 - ost.setAttribute("search-processor-selector", s.selector); 176 + const ors = new RepeatShuffleOrchestrator(); 177 + ors.setAttribute("group", GROUP); 178 + ors.setAttribute("queue-engine-selector", q.selector); 139 179 140 - addToBodyIfNeeded(ost); 141 - return ost; 142 - } 180 + addToBodyIfNeeded(ors); 181 + return ors; 182 + } 143 183 144 - function sources() { 145 - const so = new SourcesOrchestrator(); 146 - so.setAttribute("group", GROUP); 147 - so.setAttribute("input-selector", input.selector); 148 - so.setAttribute("output-selector", output.selector); 184 + function searchTracks() { 185 + const i = input(); 186 + const o = output(); 187 + const s = search(); 149 188 150 - addToBodyIfNeeded(so); 151 - return so; 152 - } 189 + const ost = new SearchTracksOrchestrator(); 190 + ost.setAttribute("group", GROUP); 191 + ost.setAttribute("input-selector", i.selector); 192 + ost.setAttribute("output-selector", o.selector); 193 + ost.setAttribute("search-processor-selector", s.selector); 153 194 154 - // Return elements 155 - return { 156 - GROUP, 195 + addToBodyIfNeeded(ost); 196 + return ost; 197 + } 157 198 158 - engine: {}, 159 - orchestrator: { 160 - input, 161 - output, 162 - processTracks: opt, 163 - }, 164 - processor: { 165 - metadata, 166 - }, 199 + function sources() { 200 + const i = input(); 201 + const o = output(); 202 + const so = new SourcesOrchestrator(); 203 + so.setAttribute("group", GROUP); 204 + so.setAttribute("input-selector", i.selector); 205 + so.setAttribute("output-selector", o.selector); 167 206 168 - lazy: { 169 - engine: { 170 - audio, 171 - queue, 172 - }, 173 - orchestrator: { 174 - queueAudio, 175 - queueTracks, 176 - repeatShuffle, 177 - searchTracks, 178 - sources, 179 - }, 180 - processor: { 181 - artwork, 182 - search, 183 - }, 184 - }, 185 - }; 207 + addToBodyIfNeeded(so); 208 + return so; 186 209 } 210 + 211 + // 🛠️ 187 212 188 213 /** 189 214 * @param {DiffuseElement} element
+12 -9
src/themes/blur/artwork-controller/index.js
··· 5 5 6 6 // Prerequisites 7 7 const aud = defaults.lazy.engine.audio(); 8 - const queue = defaults.lazy.engine.queue(); 9 - 10 8 const art = defaults.lazy.processor.artwork(); 11 - 12 9 const oqa = defaults.lazy.orchestrator.queueAudio(); 13 - const rso = defaults.lazy.orchestrator.repeatShuffle(); 14 - 15 - defaults.lazy.orchestrator.queueTracks(); 16 10 17 11 // Controller 18 12 const dac = new ArtworkController(); 19 13 dac.setAttribute("artwork-processor-selector", art.selector); 20 14 dac.setAttribute("audio-engine-selector", aud.selector); 21 - dac.setAttribute("input-selector", defaults.orchestrator.input.selector); 22 - dac.setAttribute("queue-engine-selector", queue.selector); 23 - dac.setAttribute("repeat-shuffle-orchestrator-selector", rso.selector); 15 + dac.setAttribute( 16 + "input-selector", 17 + defaults.instantiated.orchestrator.input.selector, 18 + ); 19 + dac.setAttribute( 20 + "queue-engine-selector", 21 + defaults.instantiated.engine.queue.selector, 22 + ); 23 + dac.setAttribute( 24 + "repeat-shuffle-orchestrator-selector", 25 + defaults.instantiated.orchestrator.repeatShuffle.selector, 26 + ); 24 27 25 28 // Add to DOM 26 29 document.body.append(dac);
+12 -6
src/themes/webamp/browser/index.js
··· 1 1 import defaults from "@common/constituents/default/config.js"; 2 2 import BrowserElement from "@themes/webamp/browser/element.js"; 3 3 4 - const queue = defaults.lazy.engine.queue(); 5 4 const search = defaults.lazy.processor.search(); 6 - 7 - defaults.lazy.orchestrator.queueTracks(); 8 5 defaults.lazy.orchestrator.searchTracks(); 9 6 10 7 const el = new BrowserElement(); 11 - el.setAttribute("input-selector", defaults.orchestrator.input.selector); 12 - el.setAttribute("output-selector", defaults.orchestrator.output.selector); 13 - el.setAttribute("queue-engine-selector", queue.selector); 8 + el.setAttribute( 9 + "input-selector", 10 + defaults.instantiated.orchestrator.input.selector, 11 + ); 12 + el.setAttribute( 13 + "output-selector", 14 + defaults.instantiated.orchestrator.output.selector, 15 + ); 16 + el.setAttribute( 17 + "queue-engine-selector", 18 + defaults.instantiated.engine.queue.selector, 19 + ); 14 20 el.setAttribute("search-processor-selector", search.selector); 15 21 16 22 document.querySelector("#placeholder")?.replaceWith(el);