void TouchManager::touchesMoved(const ds::ui::TouchEvent &event) { for (auto touchIt = event.getTouches().begin(); touchIt != event.getTouches().end(); ++touchIt) { int fingerId = touchIt->getId() + MOUSE_RESERVED_IDS; if(mDiscardTouchMap[fingerId]){ continue; } ci::Vec2f touchPos = touchIt->getPos(); if(mOverrideTranslation && !event.getInWorldSpace()){ overrideTouchTranslation(touchPos); } inputMoved(fingerId, touchPos); } }
void AudioMixer::moveInputTo(AudioInput *input, int before) { if(before < 0) { // Position is relative to the right before += m_inputs.count() + 1; } before = qBound(0, before, m_inputs.count()); // We need to be careful as the `before` index includes ourself int index = indexOfInput(input); if(before == index) return; // Moving to the same spot if(before > index) before--; // Adjust to not include ourself m_inputs.remove(index); m_inputs.insert(before, input); // Emit move signal emit inputMoved(input, before); }
void TouchManager::mouseTouchMoved(const ci::app::MouseEvent &event, int id){ ci::Vec2f globalPos = translateMousePoint(event.getPos()); inputMoved(id, globalPos); }