From 90f58d65c51670bc03e38c3e909a21072fa21c35 Mon Sep 17 00:00:00 2001 From: sletz Date: Thu, 8 Jan 2009 11:22:04 +0000 Subject: [PATCH] Use up to BUFFER_SIZE_MAX frames in midi ports, fix for ticket #117. git-svn-id: http://subversion.jackaudio.org/jack/jack2/trunk/jackmp@3236 0c269be4-1314-0410-8aa9-9f06e86f4224 --- ChangeLog | 4 ++++ common/JackMidiPort.cpp | 3 ++- common/JackNetInterface.cpp | 6 ++++++ 3 files changed, 12 insertions(+), 1 deletion(-) diff --git a/ChangeLog b/ChangeLog index 52c38f16..c403217d 100644 --- a/ChangeLog +++ b/ChangeLog @@ -23,6 +23,10 @@ Michael Voigt Jackdmp changes log --------------------------- +2009-01-07 Stephane Letz + + * Use up to BUFFER_SIZE_MAX frames in midi ports, fix for ticket #117. + 2009-01-05 Stephane Letz * Synchronize jack2 public headers with jack1 ones. diff --git a/common/JackMidiPort.cpp b/common/JackMidiPort.cpp index 1a35cbb9..41dcb151 100644 --- a/common/JackMidiPort.cpp +++ b/common/JackMidiPort.cpp @@ -71,7 +71,8 @@ static void MidiBufferInit(void* buffer, size_t buffer_size, jack_nframes_t nfra { JackMidiBuffer* midi = (JackMidiBuffer*)buffer; midi->magic = JackMidiBuffer::MAGIC; - midi->buffer_size = buffer_size; + /* Since port buffer has actually always BUFFER_SIZE_MAX frames, we can safely use all the size */ + midi->buffer_size = BUFFER_SIZE_MAX * sizeof(float); midi->Reset(nframes); } diff --git a/common/JackNetInterface.cpp b/common/JackNetInterface.cpp index a9862b4c..efd79fab 100644 --- a/common/JackNetInterface.cpp +++ b/common/JackNetInterface.cpp @@ -24,6 +24,12 @@ Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. using namespace std; +/* + TODO : since midi buffers now uses up to BUFFER_SIZE_MAX frames, + probably also use BUFFER_SIZE_MAX in everything related to MIDI events + handling (see MidiBufferInit in JackMidiPort.cpp) +*/ + namespace Jack { // JackNetInterface*******************************************