void absolute() { x = eAbs(x); y = eAbs(y); z = eAbs(z); w = eAbs(w); }
void eTfEffectDistortionProcess(eTfEffect *fx, eTfSynth &synth, eTfInstrument &instr, eF32 **signal, eU32 len) { eASSERT_ALIGNED16(fx); eTfEffectDistortion *dist = static_cast<eTfEffectDistortion *>(fx); eF32 amount = 1.0f - instr.params[TF_DISTORT_AMOUNT]; if (amount != dist->generatedAmount) { dist->generatedAmount = amount; for (eU32 base = 0; base<32768; base++) dist->powTable[base] = ePow(base/32768.f, amount); } for(eU32 i=0;i<2;i++) { eF32 *in = signal[i]; eU32 len2 = len; while(len2--) { eF32 val = *in; eF32 sign = eSign(val); eF32 abs = eAbs(val); if (abs > 1.0f) abs = 1.0f; eU32 offs = eFtoL(abs * 32767.0f); *in++ = sign * dist->powTable[offs]; } } }
void eGuiOpPage::mouseReleaseEvent(QGraphicsSceneMouseEvent *me) { QGraphicsScene::mouseReleaseEvent(me); // Do not modify the insert-at cursor for drag & drop movements. const QPointF dist = me->scenePos()-m_pressPos; if (eAbs((eInt)dist.x()) > eGuiOperator::WIDTH || eAbs((eInt)dist.y()) > eGuiOperator::HEIGHT) { return; } // Reposition insert-at cursor on left/right mouse click. if (m_pressButtons & (Qt::LeftButton | Qt::RightButton)) { m_insertAt.x = me->scenePos().x()/eGuiOperator::WIDTH; m_insertAt.y = me->scenePos().y()/eGuiOperator::HEIGHT; invalidate(); } }