Beispiel #1
0
ccBox::ccBox(const CCVector3& dims, const ccGLMatrix* transMat/*= 0*/, QString name/*=QString("Box")*/)
	: ccGenericPrimitive(name,transMat)
	, m_dims(dims)
{
	buildUp();
	applyTransformationToVertices();
}
Beispiel #2
0
ccPlane::ccPlane(PointCoordinateType xWidth, PointCoordinateType yWidth, const ccGLMatrix* transMat/*=0*/, QString name/*=QString("Plane")*/)
	: ccGenericPrimitive(name,transMat)
	, m_xWidth(xWidth)
	, m_yWidth(yWidth)
{
	buildUp();
	applyTransformationToVertices();
}
Beispiel #3
0
bool ccGenericPrimitive::updateRepresentation()
{
	bool success = buildUp();
	if (success)
	{
		applyTransformationToVertices();
	}

	return success;
}
Beispiel #4
0
void ccCone::setTopRadius(PointCoordinateType radius)
{
	if (m_topRadius == radius)
		return;

	assert(radius > 0);
	m_topRadius = radius;
	
	buildUp();
	applyTransformationToVertices();
}
Beispiel #5
0
void ccCone::setHeight(PointCoordinateType height)
{
	if (m_height == height)
		return;

	assert(height > 0);
	m_height = height;
	
	buildUp();
	applyTransformationToVertices();
}
Beispiel #6
0
void ccBox::setDimensions(const CCVector3& dims)
{
    if (m_dims.x == dims.x && m_dims.y == dims.y && m_dims.z == dims.z)
    {
        return;
    }

    assert(dims.x > 0 && dims.y > 0 && dims.z > 0);
    m_dims = dims;

    buildUp();
    applyTransformationToVertices();
}
Beispiel #7
0
bool ccGenericPrimitive::setDrawingPrecision(unsigned steps)
{
	if (m_drawPrecision == steps)
		return true;
	if (steps < 4)
		return false;

	m_drawPrecision = steps;

	if (!buildUp())
		return false;

	applyTransformationToVertices();

	return true;
}
mediacenter::mediacenter(QWidget *parent)
    : QMainWindow(parent)
{
    memset(m_dmxBuffer, 0, 512);
    m_dmxThread = new DMXThread(m_dmxBuffer);

    QFile file("settings.json");
    if (file.open(QIODevice::ReadOnly) == false)
    {
        qDebug() << "Could not open" << file.fileName() << "for reading";
    }

    QJsonParseError error;
    QJsonDocument jsonDoc = QJsonDocument::fromJson(file.readAll(), &error);
    file.close();

    m_settingsObject = jsonDoc.object();

    lbars = new LightBars(m_dmxBuffer, this);
    lbars->buildUp(m_settingsObject);
	lbars->show();

	lpresets = new LightPresets( lbars, this );
    lpresets->buildUp(m_settingsObject);
	lpresets->show();

    /*bcontrol = new BeamerControl( this );
	connect( bcontrol, SIGNAL( stateChanged( QString ) ), this, SLOT( beamerStateChange( QString ) ) );
	connect( bcontrol, SIGNAL( updateStatus() ), this, SLOT( setSystrayToolTip() ) );
    bcontrol->show();*/
    bcontrol = nullptr;

	configDMX = new ConfigureDMX( this );
    configDMX->setWindowIcon(QIcon(QPixmap(QString("://on.xpm"))));

	connect( configDMX, SIGNAL( configured() ), lbars, SLOT( buildUp() ) );

	QRect geo = qApp->desktop()->availableGeometry();
	lbars->move( geo.width() - lbars->geometry().size().width() - 6, geo.y() );
	lpresets->move( lbars->geometry().x() - lpresets->geometry().width() - 9, geo.y() );
    /*bcontrol->move( lbars->geometry().x() - bcontrol->geometry().width() - 9,
        lpresets->geometry().y() + lpresets->geometry().height() + 3);*/

	hide();

    m_systray = new QSystemTrayIcon(QIcon(QString("://off.xpm")), this);
    m_systray->show();

	QMenu *menu = new QMenu();
	menu->addAction( tr("Connect DMX"), this, SLOT( connectDMX() ) );
	menu->addAction( tr("Disconnect DMX"), this, SLOT( disconnectDMX() ) );
	menu->addSeparator();
	menu->addAction( tr("Show All"), this, SLOT(showAllControls()) );
	menu->addAction( tr("Hide All"), this, SLOT(hideAllControls()) );
	menu->addSeparator();
	menu->addAction( tr("Show/Hide Light Bars"), lbars, SLOT( showToggle() ) );
	menu->addAction( tr("Show/Hide Light Presets"), lpresets, SLOT( showToggle() ) );
    //menu->addAction( tr("Show/Hide Beamer Control"), bcontrol, SLOT( showToggle() ) );
	menu->addSeparator();
    //menu->addAction( tr("Configure DMX Channels"), configDMX, SLOT( show() ) );
    //menu->addAction( tr("Configure Beamer Connection"), this, SLOT( configureBeamer() ) );
	menu->addSeparator();
	menu->addAction( tr("Close"), qApp, SLOT(quit()) );
	
    m_systray->setContextMenu( menu );

    m_dmxThread->connectDMX();
    m_dmxThread->start(QThread::TimeCriticalPriority);

#ifdef QT_DEBUG
    DebugWindow *debugWindow = new DebugWindow(m_dmxBuffer, this);
    debugWindow->show();
#endif //QT_DEBUG

}