No callback problem
No callback problem
- Subject: No callback problem
- From: "Christian Martin" <email@hidden>
- Date: Fri, 31 Jan 2003 12:46:58 -0500
Hi,
I working on an application which send and receives sysex messages. I am
able to send sysex messages to the MIDI device since it is responding
accordingly. The MIDI device responds by sending other MIDI messages which I
can see coming in using a freeware called MIDI Monitor. But the application
never receive the messages or the callback function does not. I am using OS
X 10.2.3, Midisport USB 2x2, the application is partly JAVA (GUI part) and
partly C++ for handling MIDI calls to CoreMIDI framework.
I clearly do not know what I am doing wrong here.
Any help ?
Here is a simplified version of the code:
#include <pthread.h>
#include <CoreMIDI/MIDIServices.h>
#include <CoreAudio/HostTime.h>
MIDIClientRef gMidiClient;
MIDIPortRef gOutPort;
MIDIPortRef gInPort;
struct MIDISysexSendRequest gsSysex;
static void ReceiveMessageProc( const MIDIPacketList *pktlist,
void *unused,
void *srcConnRefCon );
...
void StartMidi()
{
OSStatus stat;
stat = MIDIClientCreate( gstrRefName, // "JavaMidi"
NULL, /* MIDINotifyProc notifyProc; we do not handle this cas */
0L, /* (void *) ¬ifyRefCon */
&gMidiClient
);
stat = MIDIOutputPortCreate( gMidiClient, CFSTR("Output"),
&gOutPort);
stat = MIDIInputPortCreate( gMidiClient, CFSTR("Input"),
ReceiveMessageProc,
NULL, // not of any use ???
&gInPort);
err = MIDIPortConnectSource(gInPort, MIDIGetSource(gMHC.mhc_inDeviceID) /*
integer between 0 and GetNbrSources() */
(void*)0L );
}
static void ReceiveMessageProc( const MIDIPacketList *pktList,
void *unused,
void *srcConnRefCon )
{
unused;
volatile int nSensorNbr = 0;
mhc_mutex->lock();
//...
mhc_mutex->unlock();
}
_________________________________________________________________
MSN 8 helps eliminate e-mail viruses. Get 2 months FREE*.
http://join.msn.com/?page=features/virus
_______________________________________________
coreaudio-api mailing list | email@hidden
Help/Unsubscribe/Archives:
http://www.lists.apple.com/mailman/listinfo/coreaudio-api
Do not post admin requests to the list. They will be ignored.