commit 38b0b8628e90f0c4ca4c67f55aa89a864ec6472a
parent a7ab42da1c1fa61c5d5edd7e6c6e0a3a00b978ec
Author: fundamental <[email protected]>
Date: Sat, 19 Feb 2011 20:53:00 -0500
Jack: Fixing midi & portability issues
Applying patch submitted by Hans Petter Selasky
1) the thread ID must be pre-casted to (long), because on Linux pthread_t is
an integer, but on FreeBSD it is void *.
2) It was not possible to select OSS audio OUT and JACK MIDI IN, because the
code in zynaddsubfx was expecting that JACK audio was also selected before
executing the JACK MIDI part.
Diffstat:
1 file changed, 3 insertions(+), 2 deletions(-)
diff --git a/src/Nio/JackEngine.cpp b/src/Nio/JackEngine.cpp
@@ -217,7 +217,7 @@ void JackEngine::stopMidi()
int JackEngine::clientId()
{
if (NULL != jackClient)
- return jack_client_thread_id(jackClient);
+ return (long)jack_client_thread_id(jackClient);
else
return -1;
}
@@ -242,6 +242,8 @@ int JackEngine::processCallback(jack_nframes_t nframes)
if (NULL != audio.ports[0] && NULL != audio.ports[1])
okaudio = processAudio(nframes);
+ if (okaudio)
+ handleMidi(nframes);
return okaudio ? 0 : -1;
}
@@ -264,7 +266,6 @@ bool JackEngine::processAudio(jack_nframes_t nframes)
//Assumes size of smp.l == nframes
memcpy(audio.portBuffs[0], smp.l, bufferSize*sizeof(REALTYPE));
memcpy(audio.portBuffs[1], smp.r, bufferSize*sizeof(REALTYPE));
- handleMidi(nframes);
return true;
}