/[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 1886 by schoenebeck, Tue Mar 11 15:20:46 2008 UTC revision 1887 by persson, Sat Apr 18 08:17:16 2009 UTC
# Line 1  Line 1 
1  /***************************************************************************  /***************************************************************************
2   *                                                                         *   *                                                                         *
3   *   Copyright (C) 2004, 2005 Grame                                        *   *   Copyright (C) 2004, 2005 Grame                                        *
4   *   Copyright (C) 2005 - 2008 Christian Schoenebeck                       *   *   Copyright (C) 2005 - 2009 Christian Schoenebeck                       *
5   *                                                                         *   *                                                                         *
6   *   This program is free software; you can redistribute it and/or modify  *   *   This program is free software; you can redistribute it and/or modify  *
7   *   it under the terms of the GNU General Public License as published by  *   *   it under the terms of the GNU General Public License as published by  *
# Line 91  namespace LinuxSampler { Line 91  namespace LinuxSampler {
91    
92                  for (unsigned int i = 0; i < pktlist->numPackets; ++i) {                  for (unsigned int i = 0; i < pktlist->numPackets; ++i) {
93    
                         int cin = packet->data[0] & 0xF0;  
   
94                          // To be checked : several events per packet                          // To be checked : several events per packet
95    
96                          switch(cin) { // status byte                          port->DispatchRaw(packet->data);
   
                                 case 0xB0:  
                                         if (packet->data[1] == 0)  
                                                 port->DispatchBankSelectMsb(packet->data[2],packet->data[0]&0x0F);  
                                         else if (packet->data[1] == 32)  
                                                 port->DispatchBankSelectLsb(packet->data[2],packet->data[0]&0x0F);  
                                         port->DispatchControlChange(packet->data[1],packet->data[2],packet->data[0]&0x0F);  
                                         break;  
   
                                 case 0xD0:  
                                         port->DispatchControlChange(128,packet->data[1],packet->data[0]&0x0F);  
                                         break;  
   
                                 case 0xE0:  
                                         port->DispatchPitchbend(packet->data[1],packet->data[0]&0x0F);  
                                         break;  
   
                                 case 0x90:  
                                         if (packet->data[1] < 0x80) {  
                                                 if (packet->data[2] > 0){  
                                                         port->DispatchNoteOn(packet->data[1],packet->data[2], packet->data[0]&0x0F);  
                                                 }else{  
                                                         port->DispatchNoteOff(packet->data[1],packet->data[2],packet->data[0]&0x0F);  
                                                 }  
                                         }  
                                         break;  
   
                                 case 0x80:  
                                         if (packet->data[1] < 0x80) {  
                                                 port->DispatchNoteOff(packet->data[1],packet->data[2],packet->data[0]&0x0F);  
                                         }  
                                         break;  
   
                                 case 0xC0:  
                                         if (packet->data[1] < 0x80) {  
                                                 port->DispatchProgramChange(packet->data[1], packet->data[0] & 0x0F);  
                                         }  
                                         break;  
                         }  
97    
98                          packet = MIDIPacketNext(packet);                          packet = MIDIPacketNext(packet);
99                  }                  }
# Line 175  namespace LinuxSampler { Line 134  namespace LinuxSampler {
134      }      }
135    
136      String MidiInputDeviceCoreMidi::Version() {      String MidiInputDeviceCoreMidi::Version() {
137              String s = "$Revision: 1.11 $";              String s = "$Revision: 1.12 $";
138              return s.substr(11, s.size() - 13); // cut dollar signs, spaces and CVS macro keyword              return s.substr(11, s.size() - 13); // cut dollar signs, spaces and CVS macro keyword
139      }      }
140    

Legend:
Removed from v.1886  
changed lines
  Added in v.1887

  ViewVC Help
Powered by ViewVC