Thanks for making an interesting project. I can see from your
documentation that the Jack class is the interface to the jack server
system. Its clear that you can call connect and disconnect to
JackClients that are registered with the Jack. it appears from the api
that this is a one way flow in that I can only write code to direct
the jack server what to do.
I'm curious to know if the Jack class also listens to the server and
notifies the JackClient if a connection or disconnection has happened
so that my application can react to events that may have happened to
the jack system outside of my application? I think that would be a
really cool feature but I'm not sure how to go about adding it if it
isn't there.
Thanks.
Bill.
Thanks for your message and interest in JNAJack.
On 9 December 2011 17:54, bill <bill...@colorfulsoftware.com> wrote:
> Greetings Neil.
>
> Thanks for making an interesting project. I can see from your
> documentation that the Jack class is the interface to the jack server
> system. Its clear that you can call connect and disconnect to
> JackClients that are registered with the Jack. it appears from the api
> that this is a one way flow in that I can only write code to direct
> the jack server what to do.
>
You are not restricted to connecting ports on the client you pass in
to the Jack.connect() method. You can connect any ports between any
clients in JACK. That you need to pass in a client to this method at
all is down to the underlying API of JACK - I understand why it needs
it, but it does make the usage of these methods a little unintuitive.
JNAJack used to try and get around this by having its own hidden
client, but this just caused issues. It's why the earlier methods in
the Jack class are deprecated. If you look at the source
http://code.google.com/p/praxis/source/browse/audio.jnajack/src/org/jaudiolibs/jnajack/Jack.java
you can see that these deprecated methods now create a temporary
client.
> I'm curious to know if the Jack class also listens to the server and
> notifies the JackClient if a connection or disconnection has happened
> so that my application can react to events that may have happened to
> the jack system outside of my application? I think that would be a
> really cool feature but I'm not sure how to go about adding it if it
> isn't there.
>
At the moment, no. This is supported in the underlying API, and if
you wanted to play around with the machine generated code in the
lowlevel binding you could probably do this. Using anything in
lowlevel is unsupported! You can find the interface here -
http://code.google.com/p/praxis/source/browse/audio.jnajack/src/org/jaudiolibs/jnajack/lowlevel/JackLibrary.java
but you'll need a good grasp of JNA.
Feel free to file an RFE for these missing callbacks - I can look at
writing a nice API around them in the new year.
Best wishes,
Neil
--
Neil C Smith
Artist : Technologist : Adviser
http://neilcsmith.net
On 9 December 2011 19:03, billbrown <bill...@colorfulsoftware.com> wrote:
> Hi Neil:
>
> what about something like this in the JackClient
>
> setJackPortConnectCallback(JackPortConnectCallback callback)
That's the easy bit! :-)
The method(s) in the callback interface is more difficult -
translating typedef void(* JackPortConnectCallback)(jack_port_id_t a,
jack_port_id_t b, int connect, void *arg) into something vaguely
useful within the context of JNAJack.
Maybe -
portsConnected(String port_name1, String port_name2);
portsDisconnected(String port_name1, String port_name2);
>
> and I'm thinking it would allow you to listen to the connections and
> disconnections of the ports that you registered with this JackClient. That
> way, my application that is using an instance of JackClient will be able to
> know when the ports registered with it are connected and disconnected from
> other applications. That is what I'm most interested in I think.
I'm not sure JACK filters the connection information to just the
client - I think it passes information about all clients to the
callback. In which case, JNAJack will too. If using the API above,
you'd just need to check the port name started with your client name.
All full port names are client_name:port_name
> Where can I file an RFE for this library for you? Let me know.
>
http://code.google.com/p/java-audio-utils/issues/list