If a module contains several input and output jacks, is it possible to obtain the information which one of them are currently connected by a common cable?
For example: the module has three inputs "in1", "in2" and "in3" as well as three outputs "out1", "out2" and "out3". How to detect that user connected "out2" to "in3"?
The VoltageAudioJack objects seem not to offer any methods for this, and the events do not provide enough information either.
(In fact the cable ID in there is always 0, there is only the "clicked" VoltageAudioJack passed as first parameter "component". Even more confusing: connecting a jack sends both a "connect" event as well as an "disconnect" event at the same time...)
Audio Jacks and cable information
Audio Jacks and cable information
Last edited by drøhn C on Fri Jul 02, 2021 10:24 am, edited 1 time in total.
- honki-bobo
- Posts: 310
- Joined: Sat Nov 09, 2019 1:18 pm
Re: Audio Jacks and cable information
My first idea was to use the SetUserProperty and GetUserProperty methods of the VoltageComponent class. Both, VoltageAudioJack and VoltageAudioCable extend this class. So you could add the jack as a property to the cable.
But, as you already mentioned, there is no way (at least that I know of) to get the cable as an object and use it in the code. I've just made a quick check and can confirm that the cable ID that is supposed to be passed as longValue with the Jack_Connected and Jack_Disconnected notifications is always 0. I suppose this is a bug. Could someone @cherryaudio confirm this?
Besides that, a Jack_Connected notification only occurs with the first cable connected to a jack, and similarly a Jack_Disconnect notification only occurs when the last cable is disconnected.
If somebody knows how to solve this. I'd be interested, too
Best regards,
Martin
But, as you already mentioned, there is no way (at least that I know of) to get the cable as an object and use it in the code. I've just made a quick check and can confirm that the cable ID that is supposed to be passed as longValue with the Jack_Connected and Jack_Disconnected notifications is always 0. I suppose this is a bug. Could someone @cherryaudio confirm this?
Besides that, a Jack_Connected notification only occurs with the first cable connected to a jack, and similarly a Jack_Disconnect notification only occurs when the last cable is disconnected.
If somebody knows how to solve this. I'd be interested, too
Best regards,
Martin
Re: Audio Jacks and cable information
Hi Martin,
Where is the VoltageAudioCable class you mentioned? I can't find it in the API.
Where is the VoltageAudioCable class you mentioned? I can't find it in the API.
- honki-bobo
- Posts: 310
- Joined: Sat Nov 09, 2019 1:18 pm
Re: Audio Jacks and cable information
Download the Voltage Module Designer - Development Kit from your Library and unpack it. You will find the API documentation in Documentation/JavaDocs/voltage/core/VoltageAudioCable.html
Re: Audio Jacks and cable information
I guess there's also not a way to disconnect a cable using Java is there?
Request for Music
Re: Audio Jacks and cable information
Thanks for that info Martin.
@creat and everyone else, unfortunately it looks like all VoltageAudioCable adds is a GetValue() SetValue() method pair.
In an ideal world the sockets interface would expose the collection of cable objects connected to a socket, a means of disconnecting the cables and possibly even a means of making new connections (this being the most tricky).
Cable objects would have an interface that included get methods for the module package name, instance number and socket name at the other end of the cable.
Also this would be the place for reading and writing cable colors! And maybe customizing marching ant animation.
Ultimately a Cable class could perhaps also implement a "meta message" system where data other than the core value could be exchanged between modules as an option.
In a far off place one might imagine auto connection mechanisms where a manufacturer could say that socket A of module B should automatically connect to socket C of all modules of type D then send a meta message E and maintain the connection if it gets a reply of F.
@creat and everyone else, unfortunately it looks like all VoltageAudioCable adds is a GetValue() SetValue() method pair.
In an ideal world the sockets interface would expose the collection of cable objects connected to a socket, a means of disconnecting the cables and possibly even a means of making new connections (this being the most tricky).
Cable objects would have an interface that included get methods for the module package name, instance number and socket name at the other end of the cable.
Also this would be the place for reading and writing cable colors! And maybe customizing marching ant animation.
Ultimately a Cable class could perhaps also implement a "meta message" system where data other than the core value could be exchanged between modules as an option.
In a far off place one might imagine auto connection mechanisms where a manufacturer could say that socket A of module B should automatically connect to socket C of all modules of type D then send a meta message E and maintain the connection if it gets a reply of F.