/[svn]/linuxsampler/trunk/src/drivers/midi/MidiInputDeviceCoreMidi.cpp
ViewVC logotype

Diff of /linuxsampler/trunk/src/drivers/midi/MidiInputDeviceCoreMidi.cpp

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 2430 by persson, Sun Dec 2 16:30:42 2012 UTC revision 2431 by schoenebeck, Mon Mar 4 15:12:48 2013 UTC
# Line 169  namespace LinuxSampler { Line 169  namespace LinuxSampler {
169          void MidiInputDeviceCoreMidi::MidiInputPortCoreMidi::ProcessMidiEvents(const MIDIPacketList *pktlist) {          void MidiInputDeviceCoreMidi::MidiInputPortCoreMidi::ProcessMidiEvents(const MIDIPacketList *pktlist) {
170                  MIDIPacket *packet = (MIDIPacket *)pktlist->packet;                  MIDIPacket *packet = (MIDIPacket *)pktlist->packet;
171                  for (unsigned int i = 0; i < pktlist->numPackets; ++i) {                  for (unsigned int i = 0; i < pktlist->numPackets; ++i) {
172                          //TODO: To be checked : several events per packet ?                          char* pData = (char*) packet->data;
173                          DispatchRaw(packet->data);                          int k = 0;
174                            // A MIDIPacket can have more than one (non SysEx) MIDI event in one
175                            // packet. However SysEx messages are guaranteed to be alone in one
176                            // MIDIPacket.
177                            do {
178                                    int eventSize = expectedEventSize(pData[k]);
179                                    if (eventSize < 0) eventSize = packet->length - k;
180    
181                                    if (k + eventSize > packet->length) goto next_packet;
182    
183                                    DispatchRaw(packet->data);
184                                    k += eventSize;
185                            } while (k < packet->length);
186    
187                    next_packet:
188                          packet = MIDIPacketNext(packet);                          packet = MIDIPacketNext(packet);
189                  }                  }
190          }          }

Legend:
Removed from v.2430  
changed lines
  Added in v.2431

  ViewVC Help
Powered by ViewVC