/[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 2439 by schoenebeck, Mon Mar 4 15:12:48 2013 UTC revision 2440 by schoenebeck, Sat Mar 30 23:38:59 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                          char* pData = (char*) packet->data;                          uint8_t* pData = (uint8_t*) packet->data;
173                          int k = 0;                          int k = 0;
174                          // A MIDIPacket can have more than one (non SysEx) MIDI event in one                          // 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                          // packet. However SysEx messages are guaranteed to be alone in one
# Line 180  namespace LinuxSampler { Line 180  namespace LinuxSampler {
180    
181                                  if (k + eventSize > packet->length) goto next_packet;                                  if (k + eventSize > packet->length) goto next_packet;
182    
183                                  DispatchRaw(packet->data);                                  DispatchRaw(&pData[k]);
184                                  k += eventSize;                                  k += eventSize;
185                          } while (k < packet->length);                          } while (k < packet->length);
186    
# Line 190  namespace LinuxSampler { Line 190  namespace LinuxSampler {
190          }          }
191                    
192          void MidiInputDeviceCoreMidi::MidiInputPortCoreMidi::connectToSource(MIDIEndpointRef source) {          void MidiInputDeviceCoreMidi::MidiInputPortCoreMidi::connectToSource(MIDIEndpointRef source) {
193                  // check if we already have such a connection, if yes, disconnect it first                  // check if we already have such a connection, if yes, ignore it
194                  for (uint i = 0; i < bindings.size(); ++i) {                  for (uint i = 0; i < bindings.size(); ++i) {
195                          if (bindings[i] == source) {                          if (bindings[i] == source) return;
                                 MIDIPortDisconnectSource(pDevice->pBridge, source);  
                                 break;  
                         }  
196                  }                  }
197                  // now establish the CoreMIDI connection                  // now establish the CoreMIDI connection
198                  MIDIPortConnectSource(pDevice->pBridge, source, this);                  MIDIPortConnectSource(pDevice->pBridge, source, this);

Legend:
Removed from v.2439  
changed lines
  Added in v.2440

  ViewVC Help
Powered by ViewVC