Themes
Themes are “applet compositions” and provide a traditional browser web application way of using them. Each theme is unique, not just a skin (eg. not like winamp skins).
For example, most themes here will limit the currently playing audio tracks to one item, but you might as well create a DJ theme that can play multiple items at the same time.
Abstractions
These are applet configurations that enable certain use cases outside the traditional web app experience. Just like themes, these include various assumptions of how certain parts of the system should interact.
TODO: Enable intelligent user (ai) agent use-case.
Constituents
Constituents are UI applets that are used in themes and abstractions. These are organised per theme or abstraction, but that doesn't mean they are restricted to that theme or abstraction, you can mix and match as you like. You can even use them on their own.
Some themes may be constructed out of various applets that are not listed here. The reason for that is those applets cannot be used solely on their own, they require an external context to coordinate them.
There's tradeoffs to both approaches. A particular tradeoff to keep in mind for constituents is that they'll have nested dependencies. So when overriding applets dependencies, the overrides need to passed down the tree.
Applets
Applets are web applets, the components of the system. These are then recombined into an entire music player experience, or whatever you want to build.
Configurators
Applets that serve as an intermediate in order to make a particular kind of applet configurable. In other words, these allow for an applet to be swapped out with another that takes the same, or a subset of the actions and data output.
Engines
Applets with each a singular purpose and don't have any UI. There are specialised UI and orchestrators applets that control these.
Input
Inputs are sources of audio tracks. Each track is an entry in the list of possible items to play. These can be files or streams, static or dynamic.
Orchestrators
These too are applet compositions. However, unlike themes, these are purely logical. Mostly exist in order to construct sensible defaults to use across themes and abstractions.
Output
Output is application-derived data such as playlists. These applets can receive such data and keep it around.
- IndexedDB
- Native File System
- (WIP) Storacha Storage + Automerge CRDT
- (TODO) Keyhive/Beelay
- (TODO) Dialog DB
Processors
These applets work with the tracks generated by the input applets to add more data to them, or process them in some other way.
Supplements
Additional applets, such as scrobblers.
Build your own
Ideally you'd be able to mix and match these applets to build your own music player. There are still a few todos and unknowns here:
- Haven't tested this idea cross-origin. No idea if the applets work when included on a different origin (though it should).
- Currently using a fork of the web applets SDK that adds a few features (waiting on PRs). Meaning that it won't be as easy to write your own applets in the same way as done here.
- I wrote some custom code on top of the web applets SDK that makes the applets talk to each other over a broadcast channel. This should ideally become a JS library or added to the web applets SDK. Though you can just copy-paste from the Diffuse repo if you want (it's not that much code).
- ... Probably a bunch of stuff I'm forgetting, teaching materials, ...