| 181 | } |
| 182 | |
| 183 | void EffectChain::DrawModule() |
| 184 | { |
| 185 | if (Minimized() || IsVisible() == false) |
| 186 | return; |
| 187 | |
| 188 | mEffectSpawnList->SetShowing(mShowSpawnList); |
| 189 | mSpawnEffectButton->SetShowing(mShowSpawnList && mSpawnIndex != -1); |
| 190 | if (mSpawnIndex != -1) |
| 191 | mSpawnEffectButton->SetLabel((std::string("spawn ") + mEffectSpawnList->GetLabel(mSpawnIndex)).c_str()); |
| 192 | |
| 193 | for (int i = 0; i < mEffects.size(); ++i) |
| 194 | { |
| 195 | ofVec2f pos = GetEffectPos(i); |
| 196 | |
| 197 | if (gTime < mSwapTime) //in swap animation |
| 198 | { |
| 199 | double progress = 1 - (mSwapTime - gTime) / gSwapLength; |
| 200 | if (i == mSwapFromIdx) |
| 201 | { |
| 202 | pos.set(mSwapToPos.x * (1 - progress) + pos.x * progress, |
| 203 | mSwapToPos.y * (1 - progress) + pos.y * progress); |
| 204 | } |
| 205 | if (i == mSwapToIdx) |
| 206 | { |
| 207 | pos.set(mSwapFromPos.x * (1 - progress) + pos.x * progress, |
| 208 | mSwapFromPos.y * (1 - progress) + pos.y * progress); |
| 209 | } |
| 210 | } |
| 211 | |
| 212 | mEffects[i]->SetPosition(pos.x, pos.y); |
| 213 | float w, h; |
| 214 | mEffects[i]->GetDimensions(w, h); |
| 215 | w = MAX(w, MIN_EFFECT_WIDTH); |
| 216 | |
| 217 | mEffectControls[i].mMoveLeftButton->SetShowing(i > 0); |
| 218 | mEffectControls[i].mMoveLeftButton->SetPosition(pos.x + w / 2 - 46, pos.y - 30); |
| 219 | mEffectControls[i].mMoveLeftButton->Draw(); |
| 220 | |
| 221 | mEffectControls[i].mMoveRightButton->SetShowing(i < (int)mEffects.size() - 1 && !(GetKeyModifiers() & kModifier_Shift)); |
| 222 | mEffectControls[i].mMoveRightButton->SetPosition(pos.x + w / 2 + 35, pos.y - 30); |
| 223 | mEffectControls[i].mMoveRightButton->Draw(); |
| 224 | |
| 225 | mEffectControls[i].mDeleteButton->SetShowing(i == (int)mEffects.size() - 1 || (GetKeyModifiers() & kModifier_Shift)); |
| 226 | mEffectControls[i].mDeleteButton->SetPosition(pos.x + w / 2 + 35, pos.y - 30); |
| 227 | mEffectControls[i].mDeleteButton->Draw(); |
| 228 | |
| 229 | mEffectControls[i].mDryWetSlider->SetPosition(pos.x + w / 2 - 30, pos.y - 29); |
| 230 | mEffectControls[i].mDryWetSlider->Draw(); |
| 231 | } |
| 232 | |
| 233 | for (int i = 0; i < mEffects.size(); ++i) |
| 234 | { |
| 235 | mEffects[i]->Draw(); |
| 236 | |
| 237 | float x, y, w, h; |
| 238 | mEffects[i]->GetPosition(x, y, true); |
| 239 | mEffects[i]->GetDimensions(w, h); |
| 240 | w = MAX(w, MIN_EFFECT_WIDTH); |
nothing calls this directly
no test coverage detected