control_voltage totally missing
I see that is_control_voltage (the port flag) is absolutely not managed. Is there any plan for this or a particular problem ? All other port flags are present (is_input, is_output, is_physical, can_monitor, is_terminal).
I wasn't aware of such a thing, and I think it's not a port flag.
The only time the word "voltage" appears in the JACK2 sources is here: https://github.com/jackaudio/jack2/blob/43e1173e3060b2ebc9b6c54058464d5145afbf6e/common/jack/metadata.h#L303-L312
I'm not familiar with the metadata API and I don't know what would be needed to support this from Python.
Please let me know if you have any more information.
Pull requests are always welcome!
Ohh, I must have been fooled by that: https://github.com/jackaudio/pyjacklib/blob/1d1822f5cb4eb0b16c489f7a684d4b143b539fa0/jacklib/api.py#L200 actually, my program was written with pyjacklib and I changed for jackclient (highly simpler, thanks !).
I have not seen that JackPortIsControlVoltage is not in Jack API, Maybe something falktx added for Carla. Carla also set the value "CV" to the metadata http://jackaudio.org/metadata/signal-type . Sadly, I don't know other programs managing CV ports. Hopefully, my program recognize a CV port from this custom flag or from metadata.
@falkTX may know.
It will be added on a next release, see https://github.com/jackaudio/jack2/commit/6dd022fc352d66d7bad05ba694f9c598c3ac12d4
I might add it already on the next one before MIDI2 support is ready.
Ok, it is not the same number (I had 0x100 in pyjacklib, it is now 0x20), so I have to modify my code. Anyway, I think it could be nice for jackclient-python to have public access to 'flags', maybe with an enum.Flag .
@falkTX note that Carla uses 0x100 and not 0x20:
- https://github.com/falkTX/Carla/blob/54ebc831f54d37b23a400f85cb3d44637718d52e/source/backend/engine/CarlaEngineJack.cpp#L26
- https://github.com/falkTX/Carla/blob/54ebc831f54d37b23a400f85cb3d44637718d52e/source/jackbridge/JackBridge.hpp#L148
Yeah the changes on Carla were made a long time ago and used a far away enough value so it wouldnt collide with any newly added flags. I will take the chance to update Carla side then, completely forgot about it to be honest..
Fixed in https://github.com/falkTX/Carla/commit/e8ee9d8a2864a4398d18e180ae3e8622e38a6350
@falkTX is it intentional that 0x20 appears twice?
JackPortIsCV = 0x20,
JackPortIsMIDI2 = 0x20,
https://github.com/falkTX/Carla/commit/e8ee9d8a2864a4398d18e180ae3e8622e38a6350
https://github.com/jackaudio/jack2/commit/6dd022fc352d66d7bad05ba694f9c598c3ac12d4
You seem to use it consistently in both places, but I'm having a hard time understanding what it means that both have the same enum value.
read the description more carefully, one applies on top of audio ports, the other on midi
@mgeier : I could of course propose a PR with the 2 new flags. Would you accept the possibility to access to flags via the public API ? I think that possible flags should be embedded in the python file and not calling the flag in the lib, to avoid JACK version problems. The JackPortFlags could be a enum.Flag or more probably enum.IntFlag.
@falkTX
read the description more carefully, one applies on top of audio ports, the other on midi
Thanks! I indeed didn't read it carefully (and still haven't, and probably won't), but you just reminded me to have a look at the wrapper code (I haven't looked at this for a while) and I found that there are actually two separate classes: Port for audio ports and MidiPort for MIDI ports. So it's no problem if the same bit has a different meaning in each of those.
@Houston4444
I could of course propose a PR with the 2 new flags. Would you accept the possibility to access to flags via the public API ?
Sure, we can prepare that, but I would like to add it only once this is available in a JACK release (candidate).
I think that possible flags should be embedded in the python file and not calling the flag in the lib, to avoid JACK version problems.
I'm not sure what you mean, but it would be great if you could make a PR, that should clarify things.
FYI, there is already some code that only works in certain JACK versions, for example Client.set_port_rename_callback doesn't work with JACK 1. I think that's fine, as long as it is documented.
The JackPortFlags could be a enum.Flag or more probably enum.IntFlag.
Do you mean in addition to the existing Port/MidiPort properties like is_input and is_physical etc.?
This seems redundant and it seems to violate the Python mantra "There should be one-- and preferably only one --obvious way to do it." Or am I missing something?
Anyway, if you make a PR we can discuss this in detail.