diff --git a/src/_data/facets.json b/src/_data/facets.json index 8e224e3f..5b3e3d31 100644 --- a/src/_data/facets.json +++ b/src/_data/facets.json @@ -5,7 +5,7 @@ "kind": "prelude", "category": "Playback", "featured": true, - "desc": "Automatically put tracks into the queue. **Always on.**" + "desc": "Automatically put tracks into the queue. **Always on.** These tracks will always be located after the ones you've added manually." }, { "url": "facets/playback/auto-queue/index.html", diff --git a/src/_includes/layouts/diffuse.vto b/src/_includes/layouts/diffuse.vto index 223c6c0e..add6679f 100644 --- a/src/_includes/layouts/diffuse.vto +++ b/src/_includes/layouts/diffuse.vto @@ -42,13 +42,14 @@ base: "./" "imports": { "~/": "./", - "@atcute/tid": "./vendor/@atcute/tid/index.js", - "@awesome.me/webawesome/dist/": "./vendor/@awesome.me/webawesome/", "@awesome.me/webawesome/dist-cdn/": "./vendor/@awesome.me/webawesome/", "@phosphor-icons/web/": "./vendor/@phosphor-icons/web/", + + "@atcute/tid": "./vendor/@atcute/tid/index.js", "idb-keyval": "./vendor/idb-keyval/index.js", - "lit-html": "./vendor/lit-html/index.js" + "lit-html": "./vendor/lit-html/index.js", + "throttle-debounce": "./vendor/throttle-debounce/index.js" } } diff --git a/src/components/orchestrator/process-tracks/element.js b/src/components/orchestrator/process-tracks/element.js index d663174e..fedd9263 100644 --- a/src/components/orchestrator/process-tracks/element.js +++ b/src/components/orchestrator/process-tracks/element.js @@ -63,18 +63,30 @@ class ProcessTracksOrchestrator extends BroadcastableDiffuseElement { strategy: "replicate", fn: this.#performedInitialProcess.set, }, + getIsProcessing: { + strategy: "leaderOnly", + fn: this.#isProcessing.get, + }, + setIsProcessing: { + strategy: "replicate", + fn: this.#isProcessing.set, + }, process: { strategy: "leaderOnly", fn: this.process }, }); if (!actions) return; this.process = actions.process; - this.#isProcessing.set = actions.setPerfInit; + this.#isProcessing.set = actions.setIsProcessing; - // Sync #performedInitialProcess with leader + // Sync #performedInitialProcess and #isProcessing with leader actions.getPerfInit().then((val) => { this.#performedInitialProcess.value = val; }); + + actions.getIsProcessing().then((val) => { + this.#isProcessing.value = val; + }); } // Super @@ -161,7 +173,7 @@ class ProcessTracksOrchestrator extends BroadcastableDiffuseElement { if (this.#isProcessing.value) return; // Start - this.#isProcessing.value = true; + this.#isProcessing.set(true); console.log("🪵 Processing initiated"); const tracksCol = this.output.tracks.collection(); @@ -173,7 +185,7 @@ class ProcessTracksOrchestrator extends BroadcastableDiffuseElement { // Fin console.log("🪵 Processing completed"); - this.#isProcessing.value = false; + this.#isProcessing.set(false); } } diff --git a/src/components/orchestrator/sources/element.js b/src/components/orchestrator/sources/element.js index 268f48f5..4e0d2581 100644 --- a/src/components/orchestrator/sources/element.js +++ b/src/components/orchestrator/sources/element.js @@ -1,3 +1,5 @@ +import deepDiff from "@fry69/deep-diff"; + import { BroadcastableDiffuseElement, query } from "~/common/element.js"; import { groupTracksPerScheme } from "~/common/utils.js"; import { signal } from "~/common/signal.js"; @@ -74,7 +76,9 @@ class Sources extends BroadcastableDiffuseElement { record[scheme] = sources; }); - this.#sources.value = record; + if (deepDiff(this.#sources.value, record)) { + this.#sources.value = record; + } }); } } diff --git a/src/facets/connect/index.inline.js b/src/facets/connect/index.inline.js index b38d6e31..aa3ab8ae 100644 --- a/src/facets/connect/index.inline.js +++ b/src/facets/connect/index.inline.js @@ -49,8 +49,7 @@ litRender(
These are some of the options available to add as an audio source, or to - use as user-data storage. Some offer both, the remainder offers only one - or the other. + use as user-data storage. Some offer both.
- Diffuse is not your typical streaming service, we have to add sources of audio so we have stuff to play. This button below adds some demo content, so you can experiment with the software right away. -
- -- -
- -- Now we should explore what is possible with our audio. Because Diffuse is cooperative and malleable software, our interface can look like anything, and we can pick the features we like. That might sound overwhelming, so let's keep it simple for now. -
- -- Let's pick an interface that automatically puts audio from our collection into the queue, and another to play what got put into the queue. -
- -- -
- -- So you said I could pick the features and interfaces that I liked, how does that work? -
- -- To do that, we have to look at the other pages shown in the navigation here, such as the featured page. There you'll be able to browse through all the features and interfaces that are provided by Diffuse. -
- -- To use a feature, you click the toggle to enable it, this will add it to your software. Interfaces can be added too, but it's not required, you can try them out right away by clicking the link in their title. For interfaces that are more like traditional web applications, delivering more encompassing experiences, look at themes. -
- -- TODO: explain adding your own inputs, syncing user data, etc. -
-- These features and interfaces are housed into units that we call "facets". They consist of Diffuse elements that are connected, they broadcast their state and your data that has been updated. + These features and interfaces are housed into units that we call "facets". They consist of Diffuse elements that are connected, they broadcast their state and the parts of your data that have been updated.
Finally, facets are just regular web pages so they can live wherever. We save them to the user-data storage that's configured and give the user the option to share it. This means that you can load features and interfaces from other people, building software cooperatively.
+ Diffuse is not your typical streaming service, we have to add sources of audio so we have stuff to play. This button below adds some demo content, so you can experiment with the software right away. +
+ ++ +
+ ++ Now we should explore what is possible with our audio. Because Diffuse is cooperative and malleable software, our interface can look like anything, and we can pick the features we like. That might sound overwhelming, so let's keep it simple for now. +
+ ++ Let's pick an interface that automatically puts audio from our collection into the queue, and another to play what got put into the queue. +
+ ++ +
+ ++ So you said I could pick the features and interfaces that I liked, how does that work? +
+ ++ To do that, we have to look at the other pages shown in the navigation here, such as the featured page. There you'll be able to browse through all the features and interfaces that are provided by Diffuse. +
+ ++ To use a feature, you click the toggle to enable it, this will add it to your software. Interfaces can be added too, but it's not required, you can try them out right away by clicking the link in their title. For interfaces that are more like traditional web applications, delivering more encompassing experiences, look at themes. +
+ ++ TODO: explain adding your own inputs, syncing user data, etc. +
+