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 * |
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) { |
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) { |
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) { |
119 |
} |
} |
120 |
} |
} |
121 |
|
|
122 |
|
int EffectChain::ID() const { |
123 |
|
return iID; |
124 |
|
} |
125 |
|
|
126 |
} // namespace LinuxSampler |
} // namespace LinuxSampler |