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

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

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

revision 411 by schoenebeck, Sat Feb 26 02:01:14 2005 UTC revision 412 by schoenebeck, Sat Feb 26 22:44:51 2005 UTC
# Line 73  namespace LinuxSampler { namespace gig { Line 73  namespace LinuxSampler { namespace gig {
73          // set all MIDI controller values to zero          // set all MIDI controller values to zero
74          memset(ControllerTable, 0x00, 128);          memset(ControllerTable, 0x00, 128);
75    
76            // reset voice stealing parameters
77            itLastStolenVoice = RTList<Voice>::Iterator();
78            iuiLastStolenKey  = RTList<uint>::Iterator();
79    
80          // reset key info          // reset key info
81          for (uint i = 0; i < 128; i++) {          for (uint i = 0; i < 128; i++) {
82              if (pMIDIKeyInfo[i].pActiveVoices)              if (pMIDIKeyInfo[i].pActiveVoices)
# Line 98  namespace LinuxSampler { namespace gig { Line 102  namespace LinuxSampler { namespace gig {
102          if (pEngine) pEngine->ResetInternal();          if (pEngine) pEngine->ResetInternal();
103      }      }
104    
     int EngineChannel::RenderAudio(uint Samples) {  
         return (pEngine) ? pEngine->RenderAudio(this, Samples) : 0;  
     }  
   
105      LinuxSampler::Engine* EngineChannel::GetEngine() {      LinuxSampler::Engine* EngineChannel::GetEngine() {
106          return pEngine;          return pEngine;
107      }      }
# Line 214  namespace LinuxSampler { namespace gig { Line 214  namespace LinuxSampler { namespace gig {
214          if (pEngine) pEngine->Enable();          if (pEngine) pEngine->Enable();
215      }      }
216    
217      void EngineChannel::Connect(AudioOutputDevice* pAudioOut) {              void EngineChannel::Connect(AudioOutputDevice* pAudioOut) {
218            if (pEngine && pEngine->pAudioOutputDevice != pAudioOut) {
219                DisconnectAudioOutputDevice();
220            }
221          pEngine = Engine::AcquireEngine(this, pAudioOut);          pEngine = Engine::AcquireEngine(this, pAudioOut);
222          ResetInternal();                  ResetInternal();        
223          for (uint i = 0; i < 128; i++) {          for (uint i = 0; i < 128; i++) {
# Line 239  namespace LinuxSampler { namespace gig { Line 242  namespace LinuxSampler { namespace gig {
242              pEngine = NULL;              pEngine = NULL;
243              Engine::FreeEngine(this, oldAudioDevice);              Engine::FreeEngine(this, oldAudioDevice);
244              AudioDeviceChannelLeft  = -1;              AudioDeviceChannelLeft  = -1;
245              AudioDeviceChannelRight = -1;              AudioDeviceChannelRight = -1;            
             oldAudioDevice->Disconnect(this);  
246          }          }
247      }      }
248    
# Line 287  namespace LinuxSampler { namespace gig { Line 289  namespace LinuxSampler { namespace gig {
289              event.Type                = Event::type_note_on;              event.Type                = Event::type_note_on;
290              event.Param.Note.Key      = Key;              event.Param.Note.Key      = Key;
291              event.Param.Note.Velocity = Velocity;              event.Param.Note.Velocity = Velocity;
292                event.pEngineChannel      = this;            
293              if (this->pEventQueue->write_space() > 0) this->pEventQueue->push(&event);              if (this->pEventQueue->write_space() > 0) this->pEventQueue->push(&event);
294              else dmsg(1,("Engine: Input event queue full!"));              else dmsg(1,("EngineChannel: Input event queue full!"));
295          }          }
296      }      }
297    
# Line 305  namespace LinuxSampler { namespace gig { Line 308  namespace LinuxSampler { namespace gig {
308              event.Type                = Event::type_note_off;              event.Type                = Event::type_note_off;
309              event.Param.Note.Key      = Key;              event.Param.Note.Key      = Key;
310              event.Param.Note.Velocity = Velocity;              event.Param.Note.Velocity = Velocity;
311                event.pEngineChannel      = this;
312              if (this->pEventQueue->write_space() > 0) this->pEventQueue->push(&event);              if (this->pEventQueue->write_space() > 0) this->pEventQueue->push(&event);
313              else dmsg(1,("Engine: Input event queue full!"));              else dmsg(1,("EngineChannel: Input event queue full!"));
314          }          }
315      }      }
316    
# Line 321  namespace LinuxSampler { namespace gig { Line 325  namespace LinuxSampler { namespace gig {
325              Event event             = pEngine->pEventGenerator->CreateEvent();              Event event             = pEngine->pEventGenerator->CreateEvent();
326              event.Type              = Event::type_pitchbend;              event.Type              = Event::type_pitchbend;
327              event.Param.Pitch.Pitch = Pitch;              event.Param.Pitch.Pitch = Pitch;
328                event.pEngineChannel    = this;
329              if (this->pEventQueue->write_space() > 0) this->pEventQueue->push(&event);              if (this->pEventQueue->write_space() > 0) this->pEventQueue->push(&event);
330              else dmsg(1,("Engine: Input event queue full!"));              else dmsg(1,("EngineChannel: Input event queue full!"));
331          }          }
332      }      }
333    
# Line 339  namespace LinuxSampler { namespace gig { Line 344  namespace LinuxSampler { namespace gig {
344              event.Type                = Event::type_control_change;              event.Type                = Event::type_control_change;
345              event.Param.CC.Controller = Controller;              event.Param.CC.Controller = Controller;
346              event.Param.CC.Value      = Value;              event.Param.CC.Value      = Value;
347                event.pEngineChannel      = this;
348              if (this->pEventQueue->write_space() > 0) this->pEventQueue->push(&event);              if (this->pEventQueue->write_space() > 0) this->pEventQueue->push(&event);
349              else dmsg(1,("Engine: Input event queue full!"));              else dmsg(1,("EngineChannel: Input event queue full!"));
350          }          }
351      }      }
352    

Legend:
Removed from v.411  
changed lines
  Added in v.412

  ViewVC Help
Powered by ViewVC