have a look at my abstraction [jmmmp/ardourjack-gui], there's a small gui to control jack, and also a transporter unit for ardour. I programmed that long time ago, don't know if is still works.
Joćo
I actually tried your patch a long time back and it worked, but just now it produces the following error on any attempt to use the jack connections:
JACKerror: Disconnect: can't disconnect named semaphore name = jack_sem.1000_default_jack_connect err = Invalid argument