/[svn]/linuxsampler/trunk/src/engines/EngineBase.h
ViewVC logotype

Diff of /linuxsampler/trunk/src/engines/EngineBase.h

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

revision 2611 by schoenebeck, Mon Jun 9 19:20:37 2014 UTC revision 2618 by schoenebeck, Wed Jun 11 11:39:44 2014 UTC
# Line 914  namespace LinuxSampler { Line 914  namespace LinuxSampler {
914                          dmsg(5,("Engine: instrument change command received\n"));                          dmsg(5,("Engine: instrument change command received\n"));
915                          cmd.bChangeInstrument = false;                          cmd.bChangeInstrument = false;
916                          pEngineChannel->pInstrument = cmd.pInstrument;                          pEngineChannel->pInstrument = cmd.pInstrument;
917                          pEngineChannel->pScript = cmd.pScript; //TODO: previous script should be freed as soon as EngineBase switched the instrument, right now 2 scripts are kept in memory all the time, even though the old one is not used anymore                          pEngineChannel->pScript = cmd.pScript;
918                          instrumentChanged = true;                          instrumentChanged = true;
919    
920                          pEngineChannel->MarkAllActiveVoicesAsOrphans();                          pEngineChannel->MarkAllActiveVoicesAsOrphans();
# Line 925  namespace LinuxSampler { Line 925  namespace LinuxSampler {
925                              RTList<ScriptEvent>::Iterator itScriptEvent =                              RTList<ScriptEvent>::Iterator itScriptEvent =
926                                  pEngineChannel->pScript->pEvents->allocAppend();                                  pEngineChannel->pScript->pEvents->allocAppend();
927    
928                                itScriptEvent->cause.pEngineChannel = pEngineChannel;
929                                itScriptEvent->handlers[0] = pEngineChannel->pScript->handlerInit;
930                                itScriptEvent->handlers[1] = NULL;
931    
932                              VMExecStatus_t res = pScriptVM->exec(                              VMExecStatus_t res = pScriptVM->exec(
933                                  pEngineChannel->pScript->parserContext, &*itScriptEvent                                  pEngineChannel->pScript->parserContext, &*itScriptEvent
934                              );                              );
# Line 1308  namespace LinuxSampler { Line 1312  namespace LinuxSampler {
1312                  pChannel->ProcessKeySwitchChange(key);                  pChannel->ProcessKeySwitchChange(key);
1313    
1314                  pKey->KeyPressed = true; // the MIDI key was now pressed down                  pKey->KeyPressed = true; // the MIDI key was now pressed down
1315                    pChannel->KeyDown[key] = true; // just used as built-in %KEY_DOWN script variable
1316                  pKey->Velocity   = itNoteOnEventOnKeyList->Param.Note.Velocity;                  pKey->Velocity   = itNoteOnEventOnKeyList->Param.Note.Velocity;
1317                  pKey->NoteOnTime = FrameTime + itNoteOnEventOnKeyList->FragmentPos(); // will be used to calculate note length                  pKey->NoteOnTime = FrameTime + itNoteOnEventOnKeyList->FragmentPos(); // will be used to calculate note length
1318    
# Line 1384  namespace LinuxSampler { Line 1389  namespace LinuxSampler {
1389                  #endif                  #endif
1390    
1391                  pKey->KeyPressed = false; // the MIDI key was now released                  pKey->KeyPressed = false; // the MIDI key was now released
1392                    pChannel->KeyDown[iKey] = false; // just used as built-in %KEY_DOWN script variable
1393    
1394                  // move event to the key's own event list                  // move event to the key's own event list
1395                  RTList<Event>::Iterator itNoteOffEventOnKeyList = itNoteOffEvent.moveToEndOf(pKey->pEvents);                  RTList<Event>::Iterator itNoteOffEventOnKeyList = itNoteOffEvent.moveToEndOf(pKey->pEvents);

Legend:
Removed from v.2611  
changed lines
  Added in v.2618

  ViewVC Help
Powered by ViewVC