/[svn]/linuxsampler/trunk/src/effects/EffectChain.cpp
ViewVC logotype

Diff of /linuxsampler/trunk/src/effects/EffectChain.cpp

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

revision 2124 by schoenebeck, Sat Sep 18 09:24:41 2010 UTC revision 2135 by schoenebeck, Thu Sep 30 20:00:43 2010 UTC
# Line 1  Line 1 
1  /***************************************************************************  /***************************************************************************
2   *                                                                         *   *                                                                         *
3   *   Copyright (C) 2008 Christian Schoenebeck                              *   *   Copyright (C) 2008 - 2010 Christian Schoenebeck                       *
4   *                                                                         *   *                                                                         *
5   *   This program is free software; you can redistribute it and/or modify  *   *   This program is free software; you can redistribute it and/or modify  *
6   *   it under the terms of the GNU General Public License as published by  *   *   it under the terms of the GNU General Public License as published by  *
# Line 24  Line 24 
24    
25  namespace LinuxSampler {  namespace LinuxSampler {
26    
27  EffectChain::EffectChain(AudioOutputDevice* pDevice) {  EffectChain::EffectChain(AudioOutputDevice* pDevice, int iEffectChainId) {
28      this->pDevice = pDevice;      this->pDevice = pDevice;
29        iID = iEffectChainId;
30  }  }
31    
32  void EffectChain::AppendEffect(Effect* pEffect) {  void EffectChain::AppendEffect(Effect* pEffect) {
# Line 45  void EffectChain::InsertEffect(Effect* p Line 46  void EffectChain::InsertEffect(Effect* p
46      for (int i = 0; i < iChainPos; ++i) ++iter;      for (int i = 0; i < iChainPos; ++i) ++iter;
47      _ChainEntry entry = { pEffect, true };      _ChainEntry entry = { pEffect, true };
48      vEntries.insert(iter, entry);      vEntries.insert(iter, entry);
49        pEffect->SetParent(this);
50  }  }
51    
52  void EffectChain::RemoveEffect(int iChainPos) throw (Exception) {  void EffectChain::RemoveEffect(int iChainPos) throw (Exception) {
# Line 55  void EffectChain::RemoveEffect(int iChai Line 57  void EffectChain::RemoveEffect(int iChai
57          );          );
58      std::vector<_ChainEntry>::iterator iter = vEntries.begin();      std::vector<_ChainEntry>::iterator iter = vEntries.begin();
59      for (int i = 0; i < iChainPos; ++i) ++iter;      for (int i = 0; i < iChainPos; ++i) ++iter;
60        Effect* pEffect = (*iter).pEffect;
61      vEntries.erase(iter);      vEntries.erase(iter);
62        pEffect->SetParent(NULL); // mark effect as not in use anymore
63  }  }
64    
65  void EffectChain::RenderAudio(uint Samples) {  void EffectChain::RenderAudio(uint Samples) {
# Line 115  void EffectChain::ClearAllChannels() { Line 119  void EffectChain::ClearAllChannels() {
119      }      }
120  }  }
121    
122    int EffectChain::ID() const {
123        return iID;
124    }
125    
126  } // namespace LinuxSampler  } // namespace LinuxSampler

Legend:
Removed from v.2124  
changed lines
  Added in v.2135

  ViewVC Help
Powered by ViewVC