예제 #1
0
파일: vcxypad.cpp 프로젝트: speakman/qlc
void VCXYPad::mouseMoveEvent(QMouseEvent* e)
{
	if (_app->mode() == App::Operate)
	{
		/* Mouse moves the XY point in operate mode */
		int x = CLAMP(e->x(), 0, width());
		int y = CLAMP(e->y(), 0, height());
		QPoint point(x, y);

		setCurrentXYPosition(point);
		outputDMX(point);
		update();
	}

	VCWidget::mouseMoveEvent(e);
}
예제 #2
0
int VellemanOut_Test::qt_metacall(QMetaObject::Call _c, int _id, void **_a)
{
    _id = QObject::qt_metacall(_c, _id, _a);
    if (_id < 0)
        return _id;
    if (_c == QMetaObject::InvokeMetaMethod) {
        switch (_id) {
        case 0: initial(); break;
        case 1: openClose(); break;
        case 2: infoText(); break;
        case 3: outputDMX(); break;
        default: ;
        }
        _id -= 4;
    }
    return _id;
}
예제 #3
0
파일: vcxypad.cpp 프로젝트: speakman/qlc
void VCXYPad::mousePressEvent(QMouseEvent* e)
{
	if (_app->mode() == App::Operate)
	{
		/* Mouse moves the XY point in operate mode */
		int x = CLAMP(e->x(), 0, width());
		int y = CLAMP(e->y(), 0, height());
		QPoint point(x, y);

		setCurrentXYPosition(point);
		outputDMX(point);
		setMouseTracking(true);
		setCursor(Qt::CrossCursor);
	}

	VCWidget::mousePressEvent(e);
}
예제 #4
0
void HIDDMXDevice::init()
{
    /* Device name */
    m_handle = hid_open_path(path().toUtf8().constData());
    
    if (!m_handle)
    {
        QMessageBox::warning(NULL, (tr("HID DMX Interface Error")),
            (tr("Unable to open %1. Make sure the udev rule is installed.").arg(name())),
             QMessageBox::AcceptRole, QMessageBox::AcceptRole);
    }

    /** Reset channels when opening the interface: */
    m_dmx_cmp.fill(0, 512);
    m_dmx_in_cmp.fill(0, 512);
    outputDMX(m_dmx_cmp, true);
}