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

Diff of /linuxsampler/trunk/src/engines/AbstractEngineChannel.cpp

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

revision 2594 by schoenebeck, Thu Jun 5 00:16:25 2014 UTC revision 2596 by schoenebeck, Thu Jun 5 19:39:12 2014 UTC
# Line 171  namespace LinuxSampler { Line 171  namespace LinuxSampler {
171    
172          script.handlerInit = script.parserContext->eventHandlerByName("init");          script.handlerInit = script.parserContext->eventHandlerByName("init");
173          script.handlerNote = script.parserContext->eventHandlerByName("note");          script.handlerNote = script.parserContext->eventHandlerByName("note");
174            script.handlerRelease = script.parserContext->eventHandlerByName("release");
175          script.handlerController = script.parserContext->eventHandlerByName("controller");          script.handlerController = script.parserContext->eventHandlerByName("controller");
176          script.bHasValidScript =          script.bHasValidScript =
177              script.handlerInit || script.handlerNote || script.handlerController;              script.handlerInit || script.handlerNote || script.handlerRelease ||
178                script.handlerController;
179    
180          // amount of script handlers each script event has to execute          // amount of script handlers each script event has to execute
181          int handlerExecCount = 0;          int handlerExecCount = 0;
182          if (script.handlerInit) handlerExecCount++;          if (script.handlerInit) handlerExecCount++; // "init" handler is always executed before the actual event handler
183          if (script.handlerNote || script.handlerController) handlerExecCount++;          if (script.handlerNote || script.handlerRelease || script.handlerController) // only one of these are executed after "init" handler
184                handlerExecCount++;
185    
186          // create script event pool (if it doesn't exist already)          // create script event pool (if it doesn't exist already)
187          if (!pScriptEvents)          if (!pScriptEvents)
# Line 228  namespace LinuxSampler { Line 231  namespace LinuxSampler {
231              script.parserContext = NULL;              script.parserContext = NULL;
232              script.handlerInit = NULL;              script.handlerInit = NULL;
233              script.handlerNote = NULL;              script.handlerNote = NULL;
234                script.handlerRelease = NULL;
235              script.handlerController = NULL;              script.handlerController = NULL;
236          }          }
237          script.bHasValidScript = false;          script.bHasValidScript = false;
# Line 883  namespace LinuxSampler { Line 887  namespace LinuxSampler {
887          }          }
888          eventQueueReader.free(); // free all copied events from input queue          eventQueueReader.free(); // free all copied events from input queue
889      }      }
890        
891        /**
892         * Called by real-time instrument script functions to schedule a new event
893         * somewhere in future.
894         */
895        void AbstractEngineChannel::ScheduleEvent(const Event* pEvent, int delay) { //TODO: delay not implemented yet
896            // since delay is not implemented yet, we simply add the new event
897            // to the event list of the current audio fragmet cycle for now
898            RTList<Event>::Iterator itEvent = pEvents->allocAppend();
899            if (itEvent) *itEvent = *pEvent; // copy event
900        }
901    
902      FxSend* AbstractEngineChannel::AddFxSend(uint8_t MidiCtrl, String Name) throw (Exception) {      FxSend* AbstractEngineChannel::AddFxSend(uint8_t MidiCtrl, String Name) throw (Exception) {
903          if (pEngine) pEngine->DisableAndLock();          if (pEngine) pEngine->DisableAndLock();

Legend:
Removed from v.2594  
changed lines
  Added in v.2596

  ViewVC Help
Powered by ViewVC