dagargo / overwitch

JACK client for Overbridge devices
GNU General Public License v3.0
120 stars 14 forks source link

Move device definitions outside the C code #37

Closed dagargo closed 1 year ago

dagargo commented 2 years ago

To add support for new devices without the need of new releases, we need to add a JSON file with the device definitions which could be overridden by the user.

szszoke commented 2 years ago

Consider supporting a list of paths for the definition file.

  1. Same folder as the executable file
  2. Config folder in a system directory

The benefits would be that during development, you would only have to change files in the source directory.

When the application is launched, it would look for a definition file in the same folder where it was launched from and then fall back to the system-wide definition file.

dagargo commented 2 years ago

The idea is to implent it the same way it's in Elektroid.

This means that if the config file is found in ~/.config/overwitch/devices.json, this will take preference over the file distributed with the package (and located with all the other resources).

See https://github.com/dagargo/elektroid#adding-and-reconfiguring-devices for more information.

This won't be in the 1.0 release but it will be in the 1.1.

dagargo commented 1 year ago

Implemented in 819a13c54855016f3bc5daa3c4553b3113a88b96 as mentioned above.

Besides, a liboverwitch shared library is installed with the binaries, which might be helpful for you. GLib and the JSON parsing library are not needed and can be excluded from the library by passing some options to ./configure (see the documentation for more details), which should help with embedded-like devices. In this case, the C code definitions apply.