Пример #1
0
void VideoEditor::slotPreviewToggled(bool state)
{
    if (state == true)
    {
        m_video->start(m_doc->masterTimer(), functionParent());
        connect(m_video, SIGNAL(stopped(quint32)),
                this, SLOT(slotPreviewStopped(quint32)));
    }
    else
        m_video->stop(functionParent());
}
Пример #2
0
void VCCueList::setChaserID(quint32 fid)
{
    bool running = false;

    if (m_chaserID == fid)
        return;

    Function *current = m_doc->function(m_chaserID);
    Function *function = m_doc->function(fid);

    if (current != NULL)
    {
        /* Get rid of old function connections */
        disconnect(current, SIGNAL(running(quint32)),
                   this, SLOT(slotFunctionRunning(quint32)));
        disconnect(current, SIGNAL(stopped(quint32)),
                   this, SLOT(slotFunctionStopped(quint32)));
        disconnect(current, SIGNAL(currentStepChanged(int)),
                   this, SLOT(slotCurrentStepChanged(int)));

        if(current->isRunning())
        {
            running = true;
            current->stop(functionParent());
        }
    }
Пример #3
0
void EFXEditor::continueRunning(bool running)
{
    if (running == true)
    {
        if (m_doc->mode() == Doc::Operate)
            m_efx->start(m_doc->masterTimer(), functionParent());
        else
            m_testButton->click();
    }
}
Пример #4
0
void EFXEditor::slotTestClicked()
{
    if (m_testButton->isChecked() == true)
    {
        m_efx->start(m_doc->masterTimer(), functionParent());

        //Restart animation so preview it is in sync with real test
        m_previewArea->restart();
    }
    else
        m_efx->stopAndWait();
}
Пример #5
0
void VCButton::setFunctionID(quint32 fid)
{
    bool running = false;

    if (m_functionID == fid)
        return;

    Function* current = m_doc->function(m_functionID);
    if (current != NULL)
    {
        /* Get rid of old function connections */
        disconnect(current, SIGNAL(running(quint32)),
                this, SLOT(slotFunctionRunning(quint32)));
        disconnect(current, SIGNAL(stopped(quint32)),
                this, SLOT(slotFunctionStopped(quint32)));
        disconnect(current, SIGNAL(flashing(quint32,bool)),
                this, SLOT(slotFunctionFlashing(quint32,bool)));

        if(current->isRunning())
        {
            running = true;
            current->stop(functionParent());
        }
    }
void Exporter::extractLight(MObject& mObj)
{
	//different space variables
	MSpace::Space world_space = MSpace::kPostTransform;
	MSpace::Space object_space = MSpace::kLast;
	MSpace::Space transform_space = MSpace::kPreTransform;

	//temp storage for light
	pointLightStruct tempPointLights;
	ambientLightStruct tempAmbiLights;
	spotLightStruct tempSpotLights;
	directionalLightStruct tempDirLights;
	areaLightStruct tempAreaLights;

	//binder en ljusfunktion till objektet
	MFnLight func(mObj);

	//dess parent
	MFnDagNode functionParent(func.parent(0));

	//ljusets f�rg
	MColor col(0.0f, 0.0f, 0.0f);
	//possible fault: func maybe fnlight????
	col = func.color();


	//Get Transform experimentation
	MFnTransform fs(func.parent(0));
	//MMatrix matrix = fs.transformation().asMatrix();
	//std::cout << "\nTransform Matrix: " << matrix << std::endl;

	MVector lightTranslation = fs.translation(transform_space);


	//output light
	std::cout << "parent " << functionParent.name().asChar()
		<< "\ntype " << mObj.apiTypeStr()
		<< "\nLight color " << col.r << " " << col.g << " " << col.b
		<< "\nLight intensity " << func.intensity()
		<< "\nLight direction " << func.lightDirection(0, world_space, 0) << "\n" << std::endl;

	std::cout << "translation: " << lightTranslation << "\n" << std::endl;

	//f�r specifika attribut till specifika ljustyper:
	switch (mObj.apiType())
	{
		//pointlight-only attributes:
	case MFn::kPointLight:
	{
		MFnPointLight fnPointLight(mObj);
		tempPointLights.color.x = col.r;
		tempPointLights.color.y = col.g;
		tempPointLights.color.z = col.b;
		tempPointLights.intensity = func.intensity();
		tempPointLights.pos = lightTranslation;

		//push back in the light temp storage
		scene_.lights.pointLights.push_back(tempPointLights);

	}
	break;
	//ambientlight-only
	case MFn::kAmbientLight:
	{
		MFnAmbientLight fnAmbientLight(mObj);
		tempAmbiLights.color.x = col.r;
		tempAmbiLights.color.y = col.g;
		tempAmbiLights.color.z = col.b;
		tempAmbiLights.intensity = func.intensity();
		tempAmbiLights.pos = lightTranslation;

		//push back in the light temp storage
		scene_.lights.ambientLights.push_back(tempAmbiLights);

	}
	break;
	//spotlight-only
	case MFn::kSpotLight:
	{
		MFnSpotLight fnSpotLight(mObj);
		//cone angle represents the angle that the spotlight cone makes with the spotlight direction vector
		//penumbra angle is the outer edge of the light 
		//dropoff represents the degree to which the light intensity decreases with the angular distance from the light direction vector.
		std::cout << "Cone angle " << fnSpotLight.coneAngle() << "\nPenumbra angle " << fnSpotLight.penumbraAngle()
			<< "\nDropoff " << fnSpotLight.dropOff() << "\n" << std::endl;

		tempSpotLights.color.x = col.r;
		tempSpotLights.color.y = col.g;
		tempSpotLights.color.z = col.b;
		tempSpotLights.intensity = func.intensity();
		tempSpotLights.coneAngle = fnSpotLight.coneAngle();
		tempSpotLights.penumbraAngle = fnSpotLight.penumbraAngle();
		tempSpotLights.dropoff = fnSpotLight.dropOff();
		tempSpotLights.dir = func.lightDirection(0, MSpace::kWorld, 0);
		tempSpotLights.pos = lightTranslation;

		//push back in the light temp storage
		scene_.lights.spotLights.push_back(tempSpotLights);

	}
	break;
	//directional light-only
	case MFn::kDirectionalLight:
	{
		MFnDirectionalLight fnDirLight(mObj);

		tempDirLights.color.x = col.r;
		tempDirLights.color.y = col.g;
		tempDirLights.color.z = col.b;
		tempDirLights.intensity = func.intensity();
		tempDirLights.dir = func.lightDirection(0, MSpace::kWorld, 0);
		tempDirLights.pos = lightTranslation;

		//push back in the light temp storage
		scene_.lights.dirLights.push_back(tempDirLights);

	}
	break;
	//arealight-only
	case MFn::kAreaLight:
	{
		MFnAreaLight fnAreaLight(mObj);

		tempAreaLights.color.x = col.r;
		tempAreaLights.color.y = col.g;
		tempAreaLights.color.z = col.b;
		tempAreaLights.intensity = func.intensity();
		tempAreaLights.pos = lightTranslation;

		//push back in the light temp storage
		scene_.lights.areaLights.push_back(tempAreaLights);

	}
	break;

	default:
		break;

		//scene_.lights.push_back(TempLightStorage);

	}

}
Пример #7
0
AudioEditor::~AudioEditor()
{
    m_audio->stop(functionParent());
}