Ejemplo n.º 1
0
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);
	}
}
Ejemplo n.º 2
0
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);
}
Ejemplo n.º 3
0
void TouchManager::mouseTouchMoved(const ci::app::MouseEvent &event, int id){
	ci::Vec2f globalPos = translateMousePoint(event.getPos());
	inputMoved(id, globalPos);
}