hydrogen-music / hydrogen

The advanced drum machine for Linux, macOS, and Windows
http://www.hydrogen-music.org
GNU General Public License v2.0
1.03k stars 172 forks source link

Dynamic JACK support check #1845

Closed theGreatWhiteShark closed 1 year ago

theGreatWhiteShark commented 1 year ago

when using JACK the libjack.so|.dylib|.dll has to be present on the system. For Hydrogen provided via Linux OS repos this is no problem as the corresponding package is installed as well.

But in our Windows and macOS bundles as well in the Flatpak and AppImage version on Linux this is a problem as the libjack shared lib must not be included in the bundle. If it is present on system, Hydrogen JACK support works as expected. If not, Hydrogen still suggests in the GUI that JACK is available.

With the following fix we check at runtime whether libjack is present or not. In the latter case, it will not be covered by the "Auto" driver and is not shown in the Preferences Dialog. The implementation of the JackAudioDriver, however, was not touched. The resulting hydrogen binary is still linked against libjack and no JACK support should break.

In addition, a list of supported audio drivers is now just compiled once in the constructor of AudioEngine (and not in two different places and two different ways).

addresses #1836