summaryrefslogtreecommitdiff
path: root/config.go
AgeCommit message (Collapse)Author
2024-10-08Add config option "enabled"xengineering
This allows to disable soundbox devices inside the configuration file. Thus the MAC address can be kept inside the config while the device does not have to be reachable during usage of the app. Later the GUI should be able to change this during runtime.
2024-10-08Use only one Config structxengineering
This commit switches from a GlobalConfig struct with named sub-structs to a single struct definition with anonymous sub-structs. The advantage is that there are not so many names the reader has to understand. A custom UnmarshalJSON() function on the Config struct level ensures that the error checking can be embedded into the parsing process and native Go types like net.HardwareAddr can be used in the struct definition while the string-based struct for JSON unmarshaling is an implementation detail of the custom UnmarshalJSON() function. In general the user of this type and its method only has to parse the config with json.Unmarshal(), handle error at this step and can rely on validated configuration data with native Go types from that point on.
2024-10-07Parse config at startupxengineering
2024-10-07Allow URL configuration in config filexengineering
2024-10-06Switch from local playback to soundbox streamingxengineering
This commit replaces the local playback of the received audio content by forwarding it to one or multiple soundbox devices. For this purpose the soundbox-go[1] library is used. The target devices cannot be selected via the GUI. Thus all devices are specified in the ~/.config/soundbox/config.json file. The format has to be looked up based on the code. Further documentation will follow. [1]: https://xengineering.eu/git/soundbox-go