|
From: <pst...@us...> - 2008-05-24 19:10:45
|
Revision: 563
http://jazzplusplus.svn.sourceforge.net/jazzplusplus/?rev=563&view=rev
Author: pstieber
Date: 2008-05-24 12:10:41 -0700 (Sat, 24 May 2008)
Log Message:
-----------
Updated to handle the latest tMetaEvent encapsulation changes on Linux.
Modified Paths:
--------------
trunk/jazz/src/Player.cpp
Modified: trunk/jazz/src/Player.cpp
===================================================================
--- trunk/jazz/src/Player.cpp 2008-05-24 19:03:32 UTC (rev 562)
+++ trunk/jazz/src/Player.cpp 2008-05-24 19:10:41 UTC (rev 563)
@@ -1734,13 +1734,14 @@
{
// todo
tSysEx *s = pEvent->IsSysEx();
- struct sysex_info *sysex = (struct sysex_info *)new char [sizeof(struct sysex_info) + s->Length + 1];
+ struct sysex_info *sysex = (struct sysex_info *)new char [
+ sizeof(struct sysex_info) + s->GetDataLength() + 1];
sysex->key = SYSEX_PATCH;
sysex->device_no = mididev;
- sysex->len = s->Length + 1;
+ sysex->len = s->GetDataLength() + 1;
sysex->data[0] = 0xf0;
- memcpy(sysex->data + 1, s->mpData, s->Length);
+ memcpy(sysex->data + 1, s->GetData(), s->GetDataLength());
SEQ_WRPATCH(sysex, sizeof(*sysex) + sysex->len - 1);
delete [] (char *)sysex;
@@ -1749,19 +1750,23 @@
{
// OSS wants small packets with max 6 bytes
tSysEx *sx = pEvent->IsSysEx();
+ const unsigned char* pData = pEvent->IsSysEx()->GetData();
const int N = 6;
int i, j;
char buf[N];
buf[0] = (char)0xf0;
i = 1;
- for (j = 0; j < sx->Length; j++) {
- if (i == N) {
+ for (j = 0; j < sx->GetDataLength(); j++)
+ {
+ if (i == N)
+ {
SEQ_SYSEX(mididev, (unsigned char *)buf, N);
i = 0;
}
- buf[i++] = sx->mpData[j];
+ buf[i++] = pData[j];
}
- if (i > 0) {
+ if (i > 0)
+ {
SEQ_SYSEX(mididev, (unsigned char *)buf, i);
}
}
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|