mpd-now-playable/schemata/config-v1.json
Danielle McLean 00ba34bd0b
Refactor Cocoa stuff into a 'receiver'
The idea here is that there are other places that might want to know
what's playing, besides MPNowPlayingInfoCenter. For example, to expose
the now playing info to Übersicht efficiently, it needs to be available
from a web browser, ideally using WebSockets. So there could be a
receiver that runs a small WebSockets server and sends out now playing
info to anyone who connects.

Additionally, I hope to write receivers for MPRIS and for the System
Media Transport Controls on Windows, making mpd-now-playable equally
useful across all platforms.

None of this is implemented yet, of course, but I hope to get the
WebSockets receiver done pretty soon!

I'm going to keep the default behaviour unchanged. Unless you
explicitly configure different receivers in config.toml,
mpd-now-playable will just behave as an MPNowPlayingInfoCenter
integration as it's always done.
2024-07-09 12:52:49 +10:00

85 lines
2 KiB
JSON

{
"$defs": {
"CocoaReceiverConfig": {
"properties": {
"kind": {
"const": "cocoa",
"default": "cocoa",
"enum": [
"cocoa"
],
"title": "Kind",
"type": "string"
}
},
"title": "CocoaReceiverConfig",
"type": "object"
},
"MpdConfig": {
"properties": {
"host": {
"default": "127.0.0.1",
"description": "The hostname or IP address of your MPD server. If you're running MPD on your local machine, you don't need to configure this.",
"format": "hostname",
"title": "Host",
"type": "string"
},
"password": {
"description": "The password required to connect to your MPD instance, if you need one.",
"format": "password",
"title": "Password",
"type": "string",
"writeOnly": true
},
"port": {
"default": 6600,
"description": "The port on which to connect to MPD. Unless you're managing multiple MPD servers on one machine for some reason, you probably haven't changed this from the default port, 6600.",
"maximum": 65535,
"minimum": 1,
"title": "Port",
"type": "integer"
}
},
"title": "MpdConfig",
"type": "object"
}
},
"$id": "https://cdn.00dani.me/m/schemata/mpd-now-playable/config-v1.json",
"$schema": "https://json-schema.org/draft/2020-12/schema",
"properties": {
"cache": {
"description": "A URL describing a cache service for mpd-now-playable to use. Supported protocols are memory://, redis://, and memcached://.",
"format": "uri",
"title": "Cache",
"type": "string"
},
"mpd": {
"$ref": "#/$defs/MpdConfig"
},
"receivers": {
"default": [
{
"kind": "cocoa"
}
],
"items": {
"discriminator": {
"mapping": {
"cocoa": "#/$defs/CocoaReceiverConfig"
},
"propertyName": "kind"
},
"oneOf": [
{
"$ref": "#/$defs/CocoaReceiverConfig"
}
]
},
"title": "Receivers",
"type": "array"
}
},
"title": "Config",
"type": "object"
}