/[svn]/linuxsampler/trunk/src/engines/gig/Engine.cpp
ViewVC logotype

Diff of /linuxsampler/trunk/src/engines/gig/Engine.cpp

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

revision 1748 by persson, Sun Jun 22 14:46:46 2008 UTC revision 1751 by schoenebeck, Mon Jul 28 07:36:35 2008 UTC
# Line 953  namespace LinuxSampler { namespace gig { Line 953  namespace LinuxSampler { namespace gig {
953       *       *
954       *  @param pData - pointer to sysex data       *  @param pData - pointer to sysex data
955       *  @param Size  - lenght of sysex data (in bytes)       *  @param Size  - lenght of sysex data (in bytes)
956         *  @param pSender - the MIDI input port on which the SysEx message was
957         *                   received
958       */       */
959      void Engine::SendSysex(void* pData, uint Size) {      void Engine::SendSysex(void* pData, uint Size, MidiInputPort* pSender) {
960          Event event             = pEventGenerator->CreateEvent();          Event event             = pEventGenerator->CreateEvent();
961          event.Type              = Event::type_sysex;          event.Type              = Event::type_sysex;
962          event.Param.Sysex.Size  = Size;          event.Param.Sysex.Size  = Size;
963          event.pEngineChannel    = NULL; // as Engine global event          event.pEngineChannel    = NULL; // as Engine global event
964            event.pMidiInputPort    = pSender;
965          if (pEventQueue->write_space() > 0) {          if (pEventQueue->write_space() > 0) {
966              if (pSysexBuffer->write_space() >= Size) {              if (pSysexBuffer->write_space() >= Size) {
967                  // copy sysex data to input buffer                  // copy sysex data to input buffer
# Line 1946  namespace LinuxSampler { namespace gig { Line 1949  namespace LinuxSampler { namespace gig {
1949                              dmsg(3,("\t\t\tNew scale applied.\n"));                              dmsg(3,("\t\t\tNew scale applied.\n"));
1950                              break;                              break;
1951                          }                          }
1952                            case 0x15: { // chromatic / drumkit mode
1953                                dmsg(3,("\t\tMIDI Instrument Map Switch\n"));
1954                                uint8_t part = addr[1] & 0x0f;
1955                                uint8_t map;
1956                                if (!reader.pop(&map)) goto free_sysex_data;
1957                                for (int i = 0; i < engineChannels.size(); ++i) {
1958                                    EngineChannel* pEngineChannel = engineChannels[i];
1959                                    if (
1960                                        (pEngineChannel->midiChannel == part ||
1961                                         pEngineChannel->midiChannel == midi_chan_all) &&
1962                                        pEngineChannel->GetMidiInputPort() == itSysexEvent->pMidiInputPort
1963                                    ) {
1964                                        try {
1965                                            pEngineChannel->SetMidiInstrumentMap(map);
1966                                        } catch (Exception e) {
1967                                            dmsg(2,("\t\t\tCould not apply MIDI instrument map %d to part %d: %s\n", map, part, e.Message().c_str()));
1968                                            goto free_sysex_data;
1969                                        } catch (...) {
1970                                            dmsg(2,("\t\t\tCould not apply MIDI instrument map %d to part %d (unknown exception)\n", map, part));
1971                                            goto free_sysex_data;
1972                                        }
1973                                    }
1974                                }
1975                                dmsg(3,("\t\t\tApplied MIDI instrument map %d to part %d.\n", map, part));
1976                                break;
1977                            }
1978                      }                      }
1979                  }                  }
1980                  else if (addr[0] == 0x40 && (addr[1] & 0xf0) == 0x20) { // Part Parameters (2)                  else if (addr[0] == 0x40 && (addr[1] & 0xf0) == 0x20) { // Part Parameters (2)
# Line 2088  namespace LinuxSampler { namespace gig { Line 2117  namespace LinuxSampler { namespace gig {
2117      }      }
2118    
2119      String Engine::Version() {      String Engine::Version() {
2120          String s = "$Revision: 1.93 $";          String s = "$Revision: 1.95 $";
2121          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
2122      }      }
2123    

Legend:
Removed from v.1748  
changed lines
  Added in v.1751

  ViewVC Help
Powered by ViewVC