--- linuxsampler/trunk/src/engines/gig/Engine.cpp 2005/03/04 22:54:11 424 +++ linuxsampler/trunk/src/engines/gig/Engine.cpp 2005/03/09 22:12:15 438 @@ -56,12 +56,12 @@ // check if there's already an engine for the given audio output device if (engines.count(pDevice)) { dmsg(4,("Using existing gig::Engine.\n")); - pEngine = engines[pDevice]; + pEngine = engines[pDevice]; } else { // create a new engine (and disk thread) instance for the given audio output device dmsg(4,("Creating new gig::Engine.\n")); pEngine = (Engine*) EngineFactory::Create("gig"); pEngine->Connect(pDevice); - engines[pDevice] = pEngine; + engines[pDevice] = pEngine; } // register engine channel to the engine instance pEngine->engineChannels.push_back(pChannel); @@ -101,11 +101,11 @@ pSysexBuffer = new RingBuffer(SYSEX_BUFFER_SIZE, 0); pEventQueue = new RingBuffer(MAX_EVENTS_PER_FRAGMENT, 0); pEventPool = new Pool(MAX_EVENTS_PER_FRAGMENT); - pVoicePool = new Pool(MAX_AUDIO_VOICES); + pVoicePool = new Pool(MAX_AUDIO_VOICES); pVoiceStealingQueue = new RTList(pEventPool); pEvents = new RTList(pEventPool); pCCEvents = new RTList(pEventPool); - + for (uint i = 0; i < Event::destination_count; i++) { pSynthesisEvents[i] = new RTList(pEventPool); } @@ -201,7 +201,7 @@ // delete all input events pEventQueue->init(); - } + } void Engine::Connect(AudioOutputDevice* pAudioOut) { pAudioOutputDevice = pAudioOut; @@ -216,7 +216,7 @@ String msg = "Audio output device unable to provide 2 audio channels, cause: " + e.Message(); throw LinuxSamplerException(msg); } - + this->MaxSamplesPerCycle = pAudioOutputDevice->MaxSamplesPerCycle(); this->SampleRate = pAudioOutputDevice->SampleRate(); @@ -320,7 +320,7 @@ *pEvents->allocAppend() = *pEvent; } eventQueueReader.free(); // free all copied events from input queue - } + } /** * Let this engine proceed to render the given amount of sample points. The @@ -401,7 +401,7 @@ // get all events from the engine channels's input event queue which belong to the current fragment // (these are the common events like NoteOn, NoteOff, ControlChange, etc.) - ImportEvents(pEngineChannel->pEventQueue, Samples); + ImportEvents(pEngineChannel->pEventQueue, Samples); // process events @@ -452,7 +452,7 @@ } } - + // now render all postponed voices from voice stealing { RTList::Iterator itVoiceStealEvent = pVoiceStealingQueue->first(); @@ -476,7 +476,7 @@ pVoiceStealingQueue->clear(); pEngineChannel->itLastStolenVoice = RTList::Iterator(); pEngineChannel->iuiLastStolenKey = RTList::Iterator(); - + // free all keys which have no active voices left { @@ -540,7 +540,7 @@ * @param itNoteOnEvent - key, velocity and time stamp of the event */ void Engine::ProcessNoteOn(EngineChannel* pEngineChannel, Pool::Iterator& itNoteOnEvent) { - + const int key = itNoteOnEvent->Param.Note.Key; // Change key dimension value if key is in keyswitching area @@ -570,6 +570,8 @@ // allocate and trigger a new voice for the key LaunchVoice(pEngineChannel, itNoteOnEventOnKeyList, 0, false, true); + + pKey->RoundRobinIndex++; } /** @@ -992,7 +994,7 @@ m[i+2] = val; m[i+3] = val; } - } + } uint Engine::VoiceCount() { return ActiveVoiceCount; @@ -1031,7 +1033,7 @@ } String Engine::Version() { - String s = "$Revision: 1.29 $"; + String s = "$Revision: 1.30 $"; return s.substr(11, s.size() - 13); // cut dollar signs, spaces and CVS macro keyword }