midir
midir copied to clipboard
Opt-in support for JACK backend on Windows
- Adds
winjack
feature to allow using JACK as the backend on Windows (non-breaking) - moves VirtualInput and VirtualOutput out of the
os
module and into their ownvirtual
module (breaking)
jack-sys
doesn't provide a link to libjack on Windows, so consumers will need to supply their own. I included linking to JACK2 at the standard installation path for the integration test and examples.
Thanks for the PR! I didn't know that Jack is available on Windows, too. How commonly is this used? I added a few review comments for you to address.
How commonly is this used?
I suspect it's fairly uncommon, but it is at least supported by Ardour for example. As far as I know it's the only way to allow applications to create their own virtual MIDI ports on Windows, which is my use case.
I added a few review comments for you to address.
Your comments aren't showing up for me, stuck pending?
Your comments aren't showing up for me, stuck pending?
Sorry, you're right, I forgot to actually finalize the review.
While this may be useful for local development and use, it would not be practical to distribute applications using midir with this feature until dynamic loading is implemented upstream in jack-sys.
it would not be practical to distribute applications using midir with this feature until dynamic loading is implemented upstream in jack-sys.
I suppose that doesn't really matter without midir dynamically picking the backend at runtime (#4). Even if libjack is dynamically loaded, it's not practical to distribute a Windows build using midir with the JACK backend if there's no fallback when libjack isn't installed.
Just a note to myself: The PR should be merged as is (modulo the current outstanding comments), but eventually I want to do a semver-breaking change and
- upgrade
jack-sys
to 0.2.3 or later (see also #99) - remove
winjack
in favor of justjack
(I think it would then still be possible to use platform specific Cargo dependencies to enablejack
on Linux and macOS, but not on Windows, if that is what one desires) - remove the
os::virtual
module completely
Version 0.9 of the JACK bindings have been released together with version 0.3 of jack-sys. This brings major breaking changes for jack-sys because it now uses dlib instead of always linking libjack. Refer to my PR updating the documentation for details. This solves the problem of platform-specific ways to link libjack thereby obviating the need for a separate feature for Windows. So I suggest to close this PR without merging.
@Be-ing To me this means that we should at least make sure (once we upgrade to 0.3) that Windows supports building with jack
, i.e. adding it to the CI. This PR could be reworked in that direction.
And @calvinkosmatka's concern is still valid that supporting the jack
feature on Windows is a breaking change because currently it can be enabled without any effect on Windows.
Also, I assume that #102 would apply to Windows as well?
supporting the jack feature on Windows is a breaking change
Yes, so bump the minor version to indicate that.
Also, I assume that https://github.com/Boddlnagg/midir/issues/102 would apply to Windows as well?
Yes, the OS doesn't matter for that.