/[svn]/linuxsampler/trunk/src/drivers/audio/AudioOutputDevice.cpp
ViewVC logotype

Diff of /linuxsampler/trunk/src/drivers/audio/AudioOutputDevice.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 554 by schoenebeck, Thu May 19 19:25:14 2005 UTC
# Line 201  namespace LinuxSampler { Line 201  namespace LinuxSampler {
201          }          }
202      }      }
203    
204      void AudioOutputDevice::Connect(EngineChannel* pEngineChannel) {      void AudioOutputDevice::Connect(Engine* pEngine) {
205          if (EngineChannels.find(pEngineChannel) == EngineChannels.end()) {          if (Engines.find(pEngine) == Engines.end()) {
206              pEngineChannel->Connect(this);              Engines.insert(pEngine);
207              EngineChannels.insert(pEngineChannel);              // make sure the engine knows about the connection
208                //pEngine->Connect(this);
209          }          }
210      }      }
211    
212      void AudioOutputDevice::Disconnect(EngineChannel* pEngineChannel) {      void AudioOutputDevice::Disconnect(Engine* pEngine) {
213          if (EngineChannels.find(pEngineChannel) != EngineChannels.end()) { // if clause to prevent disconnect loop          if (Engines.find(pEngine) != Engines.end()) { // if clause to prevent disconnect loop
214              EngineChannels.erase(pEngineChannel);              Engines.erase(pEngine);
215              pEngineChannel->DisconnectAudioOutputDevice();              // make sure the engine knows about the disconnection
216                //pEngine->DisconnectAudioOutputDevice();
217          }          }
218      }      }
219    
# Line 245  namespace LinuxSampler { Line 247  namespace LinuxSampler {
247          int result = 0;          int result = 0;
248    
249          // let all connected engines render audio for the current audio fragment cycle          // let all connected engines render audio for the current audio fragment cycle
250          #if USE_EXCEPTIONS          #if CONFIG_RT_EXCEPTIONS
251          try          try
252          #endif // USE_EXCEPTIONS          #endif // CONFIG_RT_EXCEPTIONS
253          {          {
254              std::set<EngineChannel*>::iterator iterEngineCh = EngineChannels.begin();              std::set<Engine*>::iterator iterEngine = Engines.begin();
255              std::set<EngineChannel*>::iterator end          = EngineChannels.end();              std::set<Engine*>::iterator end        = Engines.end();
256              for (; iterEngineCh != end; iterEngineCh++) {              for (; iterEngine != end; iterEngine++) {
257                  int res = (*iterEngineCh)->RenderAudio(Samples);                  int res = (*iterEngine)->RenderAudio(Samples);
258                  if (res != 0) result = res;                  if (res != 0) result = res;
259              }              }
260          }          }
261          #if USE_EXCEPTIONS          #if CONFIG_RT_EXCEPTIONS
262          catch (std::runtime_error se) {          catch (std::runtime_error se) {
263              std::cerr << "std::runtime_error: " << se.what() << std::endl << std::flush;              std::cerr << "std::runtime_error: " << se.what() << std::endl << std::flush;
264              exit(EXIT_FAILURE);              exit(EXIT_FAILURE);
265          }          }
266          #endif // USE_EXCEPTIONS          #endif // CONFIG_RT_EXCEPTIONS
267    
268          return result;          return result;
269      }      }

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

  ViewVC Help
Powered by ViewVC